啟動Tomcat 失敗(Unable to start cluster)及解決方法

yuanyuan_186發表於2016-04-30

在配置負載均衡環境過程中修改server.xml  後重啟tomcat報錯,報錯資訊如下

[root@Alice bin]# ./catalina.sh run
Using CATALINA_BASE: /usr/local/TC6_A
Using CATALINA_HOME: /usr/local/TC6_A
Using CATALINA_TMPDIR: /usr/local/TC6_A/temp
Using JRE_HOME: /usr/java/jdk1.6.0_45
Using CLASSPATH: /usr/local/TC6_A/bin/bootstrap.jar
2015-1-9 1:44:18 org.apache.catalina.core.AprLifecycleListener init
資訊: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/java/jdk1.6.0_45/jre/lib/i386/client:/usr/java/jdk1.6.0_45/jre/lib/i386:/usr/java/jdk1.6.0_45/jre/../lib/i386:/usr/java/packages/lib/i386:/lib:/usr/lib
2015-1-9 1:44:18 org.apache.coyote.http11.Http11Protocol init
資訊: Initializing Coyote HTTP/1.1 on http-10001
2015-1-9 1:44:18 org.apache.catalina.startup.Catalina load
資訊: Initialization processed in 784 ms
2015-1-9 1:44:18 org.apache.catalina.core.StandardService start
資訊: Starting service Catalina
2015-1-9 1:44:18 org.apache.catalina.core.StandardEngine start
資訊: Starting Servlet Engine: Apache Tomcat/6.0.37
2015-1-9 1:44:18 org.apache.catalina.ha.tcp.SimpleTcpCluster start
資訊: Cluster is about to start
2015-1-9 1:44:18 org.apache.catalina.tribes.transport.ReceiverBase getBind
嚴重: Failed bind replication listener on address:auto
java.net.UnknownHostException: Alice.An: Alice.An
at java.net.InetAddress.getLocalHost(InetAddress.java:1402)
at org.apache.catalina.tribes.transport.ReceiverBase.getBind(ReceiverBase.java:180)
at org.apache.catalina.tribes.transport.nio.NioReceiver.start(NioReceiver.java:101)
at org.apache.catalina.tribes.group.ChannelCoordinator.internalStart(ChannelCoordinator.java:142)
at org.apache.catalina.tribes.group.ChannelCoordinator.start(ChannelCoordinator.java:97)
at org.apache.catalina.tribes.group.ChannelInterceptorBase.start(ChannelInterceptorBase.java:149)
at org.apache.catalina.tribes.group.interceptors.MessageDispatchInterceptor.start(MessageDispatchInterceptor.java:147)
at org.apache.catalina.tribes.group.ChannelInterceptorBase.start(ChannelInterceptorBase.java:149)
at org.apache.catalina.tribes.group.ChannelInterceptorBase.start(ChannelInterceptorBase.java:149)
at org.apache.catalina.tribes.group.GroupChannel.start(GroupChannel.java:407)
at org.apache.catalina.ha.tcp.SimpleTcpCluster.start(SimpleTcpCluster.java:672)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1047)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
at org.apache.catalina.core.StandardService.start(StandardService.java:525)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
2015-1-9 1:44:18 org.apache.catalina.tribes.transport.ReceiverBase getBind
嚴重: Failed bind replication listener on address:auto
java.net.UnknownHostException: Alice.An: Alice.An
at java.net.InetAddress.getLocalHost(InetAddress.java:1402)
at org.apache.catalina.tribes.transport.ReceiverBase.getBind(ReceiverBase.java:180)
at org.apache.catalina.tribes.transport.ReceiverBase.bind(ReceiverBase.java:204)
at org.apache.catalina.tribes.transport.nio.NioReceiver.bind(NioReceiver.java:132)
at org.apache.catalina.tribes.transport.nio.NioReceiver.start(NioReceiver.java:102)
at org.apache.catalina.tribes.group.ChannelCoordinator.internalStart(ChannelCoordinator.java:142)
at org.apache.catalina.tribes.group.ChannelCoordinator.start(ChannelCoordinator.java:97)
at org.apache.catalina.tribes.group.ChannelInterceptorBase.start(ChannelInterceptorBase.java:149)
at org.apache.catalina.tribes.group.interceptors.MessageDispatchInterceptor.start(MessageDispatchInterceptor.java:147)
at org.apache.catalina.tribes.group.ChannelInterceptorBase.start(ChannelInterceptorBase.java:149)
at org.apache.catalina.tribes.group.ChannelInterceptorBase.start(ChannelInterceptorBase.java:149)
at org.apache.catalina.tribes.group.GroupChannel.start(GroupChannel.java:407)
at org.apache.catalina.ha.tcp.SimpleTcpCluster.start(SimpleTcpCluster.java:672)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1047)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
at org.apache.catalina.core.StandardService.start(StandardService.java:525)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
2015-1-9 1:44:18 org.apache.catalina.tribes.transport.ReceiverBase bind
資訊: Receiver Server Socket bound to:0.0.0.0/0.0.0.0:4000
2015-1-9 1:44:18 org.apache.catalina.tribes.transport.ReceiverBase getBind
嚴重: Failed bind replication listener on address:auto
java.net.UnknownHostException: Alice.An: Alice.An
at java.net.InetAddress.getLocalHost(InetAddress.java:1402)
at org.apache.catalina.tribes.transport.ReceiverBase.getBind(ReceiverBase.java:180)
at org.apache.catalina.tribes.transport.ReceiverBase.getAddress(ReceiverBase.java:264)
at org.apache.catalina.tribes.transport.ReceiverBase.getHost(ReceiverBase.java:269)
at org.apache.catalina.tribes.group.ChannelCoordinator.internalStart(ChannelCoordinator.java:144)
at org.apache.catalina.tribes.group.ChannelCoordinator.start(ChannelCoordinator.java:97)
at org.apache.catalina.tribes.group.ChannelInterceptorBase.start(ChannelInterceptorBase.java:149)
at org.apache.catalina.tribes.group.interceptors.MessageDispatchInterceptor.start(MessageDispatchInterceptor.java:147)
at org.apache.catalina.tribes.group.ChannelInterceptorBase.start(ChannelInterceptorBase.java:149)
at org.apache.catalina.tribes.group.ChannelInterceptorBase.start(ChannelInterceptorBase.java:149)
at org.apache.catalina.tribes.group.GroupChannel.start(GroupChannel.java:407)
at org.apache.catalina.ha.tcp.SimpleTcpCluster.start(SimpleTcpCluster.java:672)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1047)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
at org.apache.catalina.core.StandardService.start(StandardService.java:525)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
2015-1-9 1:44:18 org.apache.catalina.ha.tcp.SimpleTcpCluster start
嚴重: Unable to start cluster.
org.apache.catalina.tribes.ChannelException: java.lang.IllegalArgumentException: java.net.UnknownHostException: auto; No faulty members identified.
at org.apache.catalina.tribes.group.ChannelCoordinator.internalStart(ChannelCoordinator.java:169)
at org.apache.catalina.tribes.group.ChannelCoordinator.start(ChannelCoordinator.java:97)
at org.apache.catalina.tribes.group.ChannelInterceptorBase.start(ChannelInterceptorBase.java:149)
at org.apache.catalina.tribes.group.interceptors.MessageDispatchInterceptor.start(MessageDispatchInterceptor.java:147)
at org.apache.catalina.tribes.group.ChannelInterceptorBase.start(ChannelInterceptorBase.java:149)
at org.apache.catalina.tribes.group.ChannelInterceptorBase.start(ChannelInterceptorBase.java:149)
at org.apache.catalina.tribes.group.GroupChannel.start(GroupChannel.java:407)
at org.apache.catalina.ha.tcp.SimpleTcpCluster.start(SimpleTcpCluster.java:672)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1047)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
at org.apache.catalina.core.StandardService.start(StandardService.java:525)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: java.lang.IllegalArgumentException: java.net.UnknownHostException: auto
at org.apache.catalina.tribes.membership.McastService.setLocalMemberProperties(McastService.java:163)
at org.apache.catalina.tribes.group.ChannelCoordinator.internalStart(ChannelCoordinator.java:144)
... 18 more
Caused by: java.net.UnknownHostExceptionauto
at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
at java.net.InetAddress$1.lookupAllHostAddr(InetAddress.java:876)
at java.net.InetAddress.getAddressFromNameService(InetAddress.java:1229)
at java.net.InetAddress.getAllByName0(InetAddress.java:1180)
at java.net.InetAddress.getAllByName(InetAddress.java:1110)
at java.net.InetAddress.getAllByName(InetAddress.java:1046)
at java.net.InetAddress.getByName(InetAddress.java:996)
at org.apache.catalina.tribes.membership.MemberImpl.setHostname(MemberImpl.java:550)
at org.apache.catalina.tribes.membership.MemberImpl.<init>(MemberImpl.java:129)
at org.apache.catalina.tribes.membership.McastService.setLocalMemberProperties(McastService.java:156)
... 19 more
2015-1-9 1:44:18 org.apache.catalina.startup.Catalina start
嚴重: Catalina.start: 
LifecycleException: org.apache.catalina.tribes.ChannelException: java.lang.IllegalArgumentException: java.net.UnknownHostException: auto; No faulty members identified.
at org.apache.catalina.ha.tcp.SimpleTcpCluster.start(SimpleTcpCluster.java:679)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1047)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
at org.apache.catalina.core.StandardService.start(StandardService.java:525)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
2015-1-9 1:44:18 org.apache.catalina.startup.Catalina start
資訊: Server startup in 237 ms

 

網上查詢關鍵詞 嚴重: Unable to start cluster.
org.apache.catalina.tribes.ChannelException: java.lang.IllegalArgumentException: java.net.UnknownHostException: auto; No faulty members identified. 後查詢到 可能原因是server.xml檔案出錯了,於是嘗試修改如下:

  1. <ReceiverclassName="org.apache.catalina.tribes.transport.nio.NioReceiver" 
  2. address="auto"     //把這個改為localhost或都自己的ip都可以;如果用auto的話,在vmware裡會與主機的實際ip產生衝突,原因不知道是什麼,呵呵。 
  3. port="4000" 
  4. autoBind="100" 
  5. selectorTimeout="5000" 
  6. maxThreads="6"/>

參考文章:http://www.linuxidc.com/Linux/2011-08/39833.htm

修改後重啟Tomcat

./ shutdowm.sh

./catalina.sh run

[root@Alice bin]# ./shutdown.sh 
Using CATALINA_BASE:  /usr/local/TC6_A
Using CATALINA_HOME:  /usr/local/TC6_A
Using CATALINA_TMPDIR: /usr/local/TC6_A/temp
Using JRE_HOME:        /usr/java/jdk1.6.0_45
Using CLASSPATH:      /usr/local/TC6_A/bin/bootstrap.jar
2015-1-9 11:20:56 org.apache.catalina.startup.Catalina stopServer
嚴重: Catalina.stop: 
java.net.ConnectException: Connection refused
   at java.net.PlainSocketImpl.socketConnect(Native Method)
   at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)
   at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)
   at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200)
   at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
   at java.net.Socket.connect(Socket.java:529)
   at java.net.Socket.connect(Socket.java:478)
   at java.net.Socket.<init>(Socket.java:375)
   at java.net.Socket.<init>(Socket.java:189)
   at org.apache.catalina.startup.Catalina.stopServer(Catalina.java:422)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.apache.catalina.startup.Bootstrap.stopServer(Bootstrap.java:338)
   at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:416)
[root@Alice bin]# ./catalina.sh run
Using CATALINA_BASE:  /usr/local/TC6_A
Using CATALINA_HOME:  /usr/local/TC6_A
Using CATALINA_TMPDIR: /usr/local/TC6_A/temp
Using JRE_HOME:        /usr/java/jdk1.6.0_45
Using CLASSPATH:      /usr/local/TC6_A/bin/bootstrap.jar
2015-1-9 11:21:32 org.apache.catalina.core.AprLifecycleListener init
信 息: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/java/jdk1.6.0_45/jre/lib/i386/client:/usr/java/jdk1.6.0_45/jre/lib/i386:/usr/java/jdk1.6.0_45/jre/../lib/i386:/usr/java/packages/lib/i386:/lib:/usr/lib
2015-1-9 11:21:34 org.apache.coyote.http11.Http11Protocol init
資訊: Initializing Coyote HTTP/1.1 on http-10001
2015-1-9 11:21:34 org.apache.catalina.startup.Catalina load
資訊: Initialization processed in 1948 ms
2015-1-9 11:21:34 org.apache.catalina.core.StandardService start
資訊: Starting service Catalina
2015-1-9 11:21:34 org.apache.catalina.core.StandardEngine start
資訊: Starting Servlet Engine: Apache Tomcat/6.0.37
2015-1-9 11:21:34 org.apache.catalina.ha.tcp.SimpleTcpCluster start
資訊: Cluster is about to start
2015-1-9 11:21:34 org.apache.catalina.tribes.transport.ReceiverBase bind
資訊: Receiver Server Socket bound to:/192.168.0.102:4000
2015-1-9 11:21:34 org.apache.catalina.tribes.membership.McastServiceImpl setupSocket
資訊: Setting cluster mcast soTimeout to 500
2015-1-9 11:21:34 org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers
資訊: Sleeping for 1000 milliseconds to establish cluster membership, start level:4
2015-1-9 11:21:35 org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers
資訊: Done sleeping, membership established, start level:4
2015-1-9 11:21:35 org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers
資訊: Sleeping for 1000 milliseconds to establish cluster membership, start level:8
2015-1-9 11:21:36 org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers
資訊: Done sleeping, membership established, start level:8
2015-1-9 11:21:36 org.apache.catalina.ha.deploy.FarmWarDeployer start
嚴重: FarmWarDeployer can only work as host cluster subelement!
2015-1-9 11:21:36 org.apache.catalina.startup.HostConfig deployDirectory
資訊: Deploying web application directory docs
2015-1-9 11:21:37 org.apache.catalina.startup.HostConfig deployDirectory
資訊: Deploying web application directory ROOT
2015-1-9 11:21:37 org.apache.catalina.startup.HostConfig deployDirectory
資訊: Deploying web application directory manager
2015-1-9 11:21:37 org.apache.catalina.startup.HostConfig deployDirectory
資訊: Deploying web application directory host-manager
2015-1-9 11:21:37 org.apache.catalina.startup.HostConfig deployDirectory
資訊: Deploying web application directory examples
2015-1-9 11:21:37 org.apache.catalina.core.ApplicationContext log
資訊: ContextListener: contextInitialized()
2015-1-9 11:21:37 org.apache.catalina.core.ApplicationContext log
資訊: SessionListener: contextInitialized()
2015-1-9 11:21:37 org.apache.catalina.ha.session.JvmRouteBinderValve start
資訊: JvmRouteBinderValve started
2015-1-9 11:21:37 org.apache.coyote.http11.Http11Protocol start
資訊: Starting Coyote HTTP/1.1 on http-10001
2015-1-9 11:21:38 org.apache.jk.common.ChannelSocket init
資訊: JK: ajp13 listening on /0.0.0.0:10009
2015-1-9 11:21:38 org.apache.jk.server.JkMain start
資訊: Jk running ID=0 time=0/157  config=null
2015-1-9 11:21:38 org.apache.catalina.startup.Catalina start
資訊: Server startup in 4021 ms

重啟後可以看到雖然還是有報錯,但是錯誤明顯少了很多,於是輸入 http://localhost:10001進行驗證(10001為自己設定的埠)

依然不成功,想了想恍然大悟,可能是防火牆沒關

service iptables status檢視防火牆狀態,果然是防火牆沒關

service iptables stop

再次驗證 哈哈! 成了

友情提示:經常會忘關防火牆,所以有問題多想想防火牆有沒有關

此問題還需再研究 但是目前暫時算解決了吧

Tomcat負載均衡: Unable to start cluster receiver  http://www.linuxidc.com/Linux/2011-08/39833.htm

Linux下Apache與多個Tomcat 叢集負載均衡 http://www.linuxidc.com/Linux/2012-01/51731.htm

Nginx Tomcat 叢集負載均衡解決筆記 http://www.linuxidc.com/Linux/2013-07/86827.htm

例項詳解Tomcat元件安裝+Nginx反向代理Tomcat+Apache使用mod_jk和mod_proxy反向代理和負載均衡 http://www.linuxidc.com/Linux/2013-06/85290.htm

CentOS 6.5下利用Rsyslog+LogAnalyzer+MySQL部署日誌伺服器 http://www.linuxidc.com/Linux/2014-06/103836.htm

Apache+Tomcat 環境搭建(JK部署過程) http://www.linuxidc.com/Linux/2012-11/74474.htm

Tomcat 的詳細介紹請點這裡
Tomcat 的下載地址請點這裡

本文永久更新連結地址http://www.linuxidc.com/Linux/2015-01/111783.htm

http://www.linuxidc.com/Linux/2015-01/111783.htm

相關文章