Tomcat cluster java.net.NoRouteToHostException: No route to host

xz43發表於2012-04-09
最近配置一個Apache2.22+tomcat6的叢集,出現一個很奇怪的問題。配置過程這裡不做敘述,網上相關文章很多,這裡記錄問題。2臺機器,1臺(IP:26)上有apache和tomcat,另一臺(IP:25)上只有tomcat,使用tomcat自帶的exaple應用測試叢集的分發,一切OK。部署應用後,不管是先啟動26上的tomcat,還是先啟動25上的tomcat,只要一啟動26的tomcat,25的tomcat日誌馬上拋錯:
資訊: Invalid chunk starting at byte [0] and ending at byte [0] with a value of [null] ignored
21:19:27,299  INFO SetEncodeFilter:46 - request path:/console/userAction.edu
2012-4-6 21:20:19 org.apache.catalina.tribes.group.interceptors.TcpFailureDetector memberAlive
嚴重: Unable to perform. failure detection check, assuming member down.
java.net.NoRouteToHostException: No route to host
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
        at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
        at java.net.Socket.connect(Socket.java:520)
        at org.apache.catalina.tribes.group.interceptors.TcpFailureDetector.memberAlive(TcpFailureDetector.java:295)
        at org.apache.catalina.tribes.group.interceptors.TcpFailureDetector.memberAlive(TcpFailureDetector.java:280)
        at org.apache.catalina.tribes.group.interceptors.TcpFailureDetector.memberAdded(TcpFailureDetector.java:125)
        at org.apache.catalina.tribes.group.ChannelInterceptorBase.memberAdded(ChannelInterceptorBase.java:88)
        at org.apache.catalina.tribes.group.ChannelInterceptorBase.memberAdded(ChannelInterceptorBase.java:88)
        at org.apache.catalina.tribes.group.ChannelInterceptorBase.memberAdded(ChannelInterceptorBase.java:88)
        at org.apache.catalina.tribes.group.ChannelCoordinator.memberAdded(ChannelCoordinator.java:229)
        at org.apache.catalina.tribes.membership.McastService.memberAdded(McastService.java:457)
        at org.apache.catalina.tribes.membership.McastServiceImpl$2.run(McastServiceImpl.java:335)
 
網上也沒該問題的有效解決方法,鬱悶了好久,以為自己叢集配置的問題,各個地方逐個檢查也沒成功。無意中想得防火牆,如是關閉了2臺的防火牆,結果馬上恢復正常。故意停掉一個tomcat,使用者連線自動切換什麼的也都正常了。
在防火牆配置檔案開啟了好幾個埠,一旦啟動防火牆,還是報錯,呵呵。看來加的埠還不夠。
 

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/9399028/viewspace-720727/,如需轉載,請註明出處,否則將追究法律責任。

相關文章