address="auto" //把这个改为localhost或都自己的ip都可以;如果用auto的话,在vmware里会与主机的实际ip产生冲突,原因不知道是什么,呵呵。
port="4000"
autoBind="100"
selectorTimeout="5000"
maxThreads="6"/>
参考文章:
修改后重启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
重启后可以看到虽然还是有报错,但是错误明显少了很多,于是输入 :10001进行验证(10001为自己设置的端口)
依然不成功,想了想恍然大悟,可能是防火墙没关
service iptables status查看防火墙状态,果然是防火墙没关
service iptables stop
再次验证 哈哈! 成了
友情提示:经常会忘关防火墙,所以有问题多想想防火墙有没有关
此问题还需再研究 但是目前暂时算解决了吧
Tomcat负载均衡: Unable to start cluster receiver
实例详解Tomcat组件安装+Nginx反向代理Tomcat+Apache使用mod_jk和mod_proxy反向代理和负载均衡