尝试在CentOS 7上启动cosbench遭遇的一些问题

Posted 中道学友

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了尝试在CentOS 7上启动cosbench遭遇的一些问题相关的知识,希望对你有一定的参考价值。

尝试启动cosbench,遭遇报错:

[root]hopisdtmelabs14# cat driver-boot.log                                                                                                                                       /tmp/cosbench/0.4.2/log
java.net.BindException: Address already in use (Bind failed)
         at java.net.PlainSocketImpl.socketBind(Native Method)
         at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:387)
         at java.net.ServerSocket.bind(ServerSocket.java:375)
         at java.net.ServerSocket.<init>(ServerSocket.java:237)
         at java.net.ServerSocket.<init>(ServerSocket.java:128)
         at org.eclipse.osgi.framework.internal.core.ConsoleManager.startConsole(ConsoleManager.java:186)
         at org.eclipse.osgi.framework.internal.core.ConsoleManager.startConsole(ConsoleManager.java:132)
         at org.eclipse.core.runtime.adaptor.EclipseStarter.startup(EclipseStarter.java:269)
         at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:175)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
         at java.lang.reflect.Method.invoke(Method.java:498)
         at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
         at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
         at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
         at org.eclipse.equinox.launcher.Main.main(Main.java:1386)
!SESSION 2020-06-03 06:04:23.609 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.8.0_181
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Command-line arguments:  -console 18089

!ENTRY org.eclipse.osgi 4 0 2020-06-03 06:04:24.132
!MESSAGE Bundle plugins/cosbench-castor not found.


看起来像是网络端口18089已经被占用了,杀掉那些进程,问题解决。


但cosbench driver 还是启动不了。

[root]hopisdtmelabs14# bash ./start-driver.sh                                                                                                                                          /tmp/cosbench/cos
Launching osgi framwork ...
Successfully launched osgi framework!
Booting cosbench driver ...
which: no nc in (/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin:/usr/local/tme/bin:/usr/local/tme/tme_portal/perf_web/bin)
No appropriate tool found to detect cosbench driver status.


看报错,应该是nc(ncat)这个软件没有安装。可是通过yum还没法正常安装。我通过下面的命令解决了这个问题:

# yum -y install wget

# wget https://nmap.org/dist/ncat-7.80-1.x86_64.rpm

# yum localinstall ncat-7.80-1.x86_64.rpm

# cd /usr/bin

# ln -s ncat nc

还是有错误。

# bash ./start-driver.sh                                                                                                                                          /tmp/cosbench/cos
Launching osgi framwork ...
Successfully launched osgi framework!
Booting cosbench driver ...
...........................................................
Starting    cosbench-log_0.4.2    [ERROR]
...........................................................
Starting    cosbench-tomcat_0.4.2    [ERROR]
...........................................................
Starting    cosbench-config_0.4.2    [ERROR]
...........................................................
Starting    cosbench-http_0.4.2    [ERROR]


我怀疑是我的java的版本过高,所以卸掉java 8, 安装java 7。

# rpm -aq | grep -i jdk                                                                                                                                           /tmp/cosbench/cos
java-1.8.0-openjdk-1.8.0.181-3.b13.el7_5.x86_64
copy-jdk-configs-3.3-10.el7_5.noarch
java-1.8.0-openjdk-headless-1.8.0.181-3.b13.el7_5.x86_64


# rpm -e java-1.8.0-openjdk-1.8.0.181-3.b13.el7_5.x86_64

# rpm -e java-1.8.0-openjdk-headless-1.8.0.181-3.b13.el7_5.x86_64

# yum remove java


安装java 7.

#yum install java-1.7.0-openjdk


结果遇到了报错,说有两个软件包太旧了,达不到安装的要求。

尝试安装更新,结果还是报错,无法更新。

[Errno 14] HTTP/HTTPS Error 404


于是执行下面的命令,对yum进行修复。

#yum clean all
#rm -rf /var/cache/yum/*


之后java 7也成功安装了。


但还是报错:

# cat driver-boot.log                                                                                                                                         /tmp/cosbench/cos/log
Listening on port 0.0.0.0/0.0.0.0:18089 ...
!SESSION 2020-06-03 10:12:59.683 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.7.0_261
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Command-line arguments:  -console 18089

!ENTRY org.eclipse.osgi 4 0 2020-06-03 10:13:00.367
!MESSAGE Bundle plugins/cosbench-castor not found.

!ENTRY org.eclipse.osgi 4 0 2020-06-03 10:13:00.368
!MESSAGE Bundle plugins/cosbench-log4j not found.

!ENTRY org.eclipse.osgi 4 0 2020-06-03 10:13:00.368
!MESSAGE Bundle plugins/cosbench-log@6:start not found.

!ENTRY org.eclipse.osgi 4 0 2020-06-03 10:13:00.369
!MESSAGE Bundle plugins/cosbench-config@6:start not found.


经过查询,找到了这篇文章,于是下载了更早的一个版本0.4.2.c4。


终于成功启动了cosbench driver。

# bash ./start-driver.sh                                                                                                                                     /tmp/cosbench/0.4.2.c4
Launching osgi framwork ...
Successfully launched osgi framework!
Booting cosbench driver ...
.
Starting    cosbench-log_0.4.2    [OK]
.
Starting    cosbench-tomcat_0.4.2    [OK]
Starting    cosbench-config_0.4.2    [OK]
Starting    cosbench-http_0.4.2    [OK]
Starting    cosbench-cdmi-util_0.4.2    [OK]
Starting    cosbench-core_0.4.2    [OK]
Starting    cosbench-core-web_0.4.2    [OK]
Starting    cosbench-api_0.4.2    [OK]
Starting    cosbench-mock_0.4.2    [OK]
Starting    cosbench-ampli_0.4.2    [OK]
Starting    cosbench-swift_0.4.2    [OK]
Starting    cosbench-keystone_0.4.2    [OK]
Starting    cosbench-httpauth_0.4.2    [OK]
Starting    cosbench-s3_0.4.2    [OK]
Starting    cosbench-librados_0.4.2    [OK]
Starting    cosbench-scality_0.4.2    [OK]
Starting    cosbench-cdmi-swift_0.4.2    [OK]
Starting    cosbench-cdmi-base_0.4.2    [OK]
Starting    cosbench-driver_0.4.2    [OK]
Starting    cosbench-driver-web_0.4.2    [OK]
Successfully started cosbench driver!
Listening on port 0.0.0.0/0.0.0.0:18089 ...
Persistence bundle starting...
Persistence bundle started.
----------------------------------------------
!!! Service will listen on web port: 18088 !!!
----------------------------------------------


参考资料

================

How to check if port is in use on Linux or Unix

https://www.cyberciti.biz/faq/unix-linux-check-if-port-is-in-use-command/

NETCAT THE MULTI-PURPOSE NETWORKING TOOL

https://landoflinux.com/linux_netcat_command.html

Uninstall JDK rpm to reinstall

https://unix.stackexchange.com/questions/110512/uninstall-jdk-rpm-to-reinstall

yum-errors

https://wiki.centos.org/yum-errors

CosBench on Red Hat Linux

http://www.vtechdiary.com/2018/09/cosbench-on-red-hat-linux.html

Can‘t start the system #380

https://github.com/intel-cloud/cosbench/issues/380










































































































以上是关于尝试在CentOS 7上启动cosbench遭遇的一些问题的主要内容,如果未能解决你的问题,请参考以下文章

CentOS 7 无法启动 postgresql 服务

如何在 Centos 7 中运行/启动 VsCode

在CentOS7上部署Python开发工具Jupyter Notebook的遭遇

玩转ceph性能测试---对象存储

centos 7 上配置mysql 开机启动详解

Docker 17无法在Centos 7中启动