嘗試在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已經被占用了,殺掉那些進程,問題解決。

如何找到占用18089端口的進程?舉例如下:

# netstat -tulpn | grep 18089                                                                                                                                /tmp/cosbench/cos/conf
tcp6       0      0 :::18089                :::*                    LISTEN      4090/java

# ps aux | grep java                                                                                                                                         /tmp/cosbench/cos/conf
root      4090  0.0  0.4 21453452 315076 ?     Sl   10:39   0:18 java -Dcosbench.tomcat.config=conf/driver-tomcat-server.xml -server -cp main/org.eclipse.equinox.launcher_1.2.0.v20110502.jar org.eclipse.equinox.launcher.Main -configuration conf/.driver -console 18089
root      4822  0.3  0.3 20319980 262324 pts/0 Sl   21:13   0:07 java -Dcosbench.tomcat.config=conf/controller-tomcat-server.xml -server -cp main/org.eclipse.equinox.launcher_1.2.0.v20110502.jar org.eclipse.equinox.launcher.Main -configuration conf/.controller -console 19089
root      4965  0.0  0.0 112828  2316 pts/0    S+   21:46   0:00 grep --color=auto java

可以看出來在上面的例子中,4090就是占用了18089端口的進程號了,通過ps aux 還能看到詳細的命令行參數。


但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


裝好了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.


Github的cosbench的站點里的issue#383里的步驟(具體步驟描述在這篇文章),即刪掉cosbench-start.sh里的一行(如下),我也試過了,並沒有解決問題。

TOOL_PARAMS="-i 0" -----Delete this line


經過查詢,找到了這篇文章,推薦不要使用正式版的0.4.2,推薦試試0.4.2.c4, 於是下載了更早的一個版本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 !!!
----------------------------------------------


不知道為什么,在CentOS 7上運行0.4.2 明顯的有問題,卻還不被修復,結果還要去使用稍早的版本release candidate 4, 這個事兒弄的挺惡心的。


To the English readers:

I document the process and issues here in detail, hope other people hit on the same issue can see it, and save time.


參考資料

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

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


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM