在配置负载均衡环境过程中修改server.xml 后重启tomcat报错,报错信息如下
[root@Alice bin]# ./catalina.sh runUsing CATALINA_BASE: /usr/local/TC6_AUsing CATALINA_HOME: /usr/local/TC6_AUsing CATALINA_TMPDIR: /usr/local/TC6_A/tempUsing JRE_HOME: /usr/java/jdk1.6.0_45Using CLASSPATH: /usr/local/TC6_A/bin/bootstrap.jar2015-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/lib2015-1-9 1:44:18 org.apache.coyote.http11.Http11Protocol init信息: Initializing Coyote HTTP/1.1 on http-100012015-1-9 1:44:18 org.apache.catalina.startup.Catalina load信息: Initialization processed in 784 ms2015-1-9 1:44:18 org.apache.catalina.core.StandardService start信息: Starting service Catalina2015-1-9 1:44:18 org.apache.catalina.core.StandardEngine start信息: Starting Servlet Engine: Apache Tomcat/6.0.372015-1-9 1:44:18 org.apache.catalina.ha.tcp.SimpleTcpCluster start信息: Cluster is about to start2015-1-9 1:44:18 org.apache.catalina.tribes.transport.ReceiverBase getBind严重: Failed bind replication listener on address:autojava.net.UnknownHostException: Alice.An: Alice.Anat 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:autojava.net.UnknownHostException: Alice.An: Alice.Anat 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:40002015-1-9 1:44:18 org.apache.catalina.tribes.transport.ReceiverBase getBind严重: Failed bind replication listener on address:autojava.net.UnknownHostException: Alice.An: Alice.Anat 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: autoat org.apache.catalina.tribes.membership.McastService.setLocalMemberProperties(McastService.java:163)at org.apache.catalina.tribes.group.ChannelCoordinator.internalStart(ChannelCoordinator.java:144)... 18 moreCaused by: java.net.UnknownHostException: autoat 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 more2015-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文件出错了,于是尝试修改如下:
参考文章: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_AUsing CATALINA_HOME: /usr/local/TC6_AUsing CATALINA_TMPDIR: /usr/local/TC6_A/tempUsing JRE_HOME: /usr/java/jdk1.6.0_45Using CLASSPATH: /usr/local/TC6_A/bin/bootstrap.jar2015-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 runUsing CATALINA_BASE: /usr/local/TC6_AUsing CATALINA_HOME: /usr/local/TC6_AUsing CATALINA_TMPDIR: /usr/local/TC6_A/tempUsing JRE_HOME: /usr/java/jdk1.6.0_45Using CLASSPATH: /usr/local/TC6_A/bin/bootstrap.jar2015-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/lib2015-1-9 11:21:34 org.apache.coyote.http11.Http11Protocol init信息: Initializing Coyote HTTP/1.1 on http-100012015-1-9 11:21:34 org.apache.catalina.startup.Catalina load信息: Initialization processed in 1948 ms2015-1-9 11:21:34 org.apache.catalina.core.StandardService start信息: Starting service Catalina2015-1-9 11:21:34 org.apache.catalina.core.StandardEngine start信息: Starting Servlet Engine: Apache Tomcat/6.0.372015-1-9 11:21:34 org.apache.catalina.ha.tcp.SimpleTcpCluster start信息: Cluster is about to start2015-1-9 11:21:34 org.apache.catalina.tribes.transport.ReceiverBase bind信息: Receiver Server Socket bound to:/192.168.0.102:40002015-1-9 11:21:34 org.apache.catalina.tribes.membership.McastServiceImpl setupSocket信息: Setting cluster mcast soTimeout to 5002015-1-9 11:21:34 org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers信息: Sleeping for 1000 milliseconds to establish cluster membership, start level:42015-1-9 11:21:35 org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers信息: Done sleeping, membership established, start level:42015-1-9 11:21:35 org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers信息: Sleeping for 1000 milliseconds to establish cluster membership, start level:82015-1-9 11:21:36 org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers信息: Done sleeping, membership established, start level:82015-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 docs2015-1-9 11:21:37 org.apache.catalina.startup.HostConfig deployDirectory信息: Deploying web application directory ROOT2015-1-9 11:21:37 org.apache.catalina.startup.HostConfig deployDirectory信息: Deploying web application directory manager2015-1-9 11:21:37 org.apache.catalina.startup.HostConfig deployDirectory信息: Deploying web application directory host-manager2015-1-9 11:21:37 org.apache.catalina.startup.HostConfig deployDirectory信息: Deploying web application directory examples2015-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 started2015-1-9 11:21:37 org.apache.coyote.http11.Http11Protocol start信息: Starting Coyote HTTP/1.1 on http-100012015-1-9 11:21:38 org.apache.jk.common.ChannelSocket init信息: JK: ajp13 listening on /0.0.0.0:100092015-1-9 11:21:38 org.apache.jk.server.JkMain start信息: Jk running ID=0 time=0/157 config=null2015-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
再次验证 哈哈! 成了
友情提示:经常会忘关防火墙,所以有问题多想想防火墙有没有关
此问题还需再研究 但是目前暂时算解决了吧
新闻热点
疑难解答