配置Tomcat集群时地址冲突异常解决

TOMCAT集群配置好后运行正常,首次访问该服务后出现以下错误:

警告:Errorreceivingmcastpackage.Sleeping500ms

java.lang.IllegalArgumentException:Invalidpackage,shouldstartwith:{84,82,73,66,69,83,45,66}

atorg.apache.catalina.tribes.membership.MemberImpl.getMember(MemberImpl.java:322)

atorg.apache.catalina.tribes.membership.MemberImpl.getMember(MemberImpl.java:298)

atorg.apache.catalina.tribes.membership.MemberImpl.getMember(MemberImpl.java:403)

atorg.apache.catalina.tribes.membership.McastServiceImpl.receive(McastServiceImpl.java:320)

        at org.apache.catalina.tribes.membership.McastServiceImpl$ReceiverThread.run(McastServiceImpl.java:414)

tomcat集群教程的默认配置address="228.0.0.4"修改为address="228.0.0.5"

<Channelclassname="org.apache.catalina.tribes.group.GroupChannel">

<Membershipclassname="org.apache.catalina.tribes.membership.McastService"

address="228.0.0.5"

port="45564"

frequency="500"

dropTime="3000"/>

出现此问题的原因可能是局域网中存在其他集群机器组

具体位置在server.xml文件中:

<Cluster classname="org.apache.catalina.ha.tcp.SimpleTcpCluster">

      <Channel classname="org.apache.catalina.tribes.group.GroupChannel">

<Membershipclassname="org.apache.catalina.tribes.membership.McastService"

address="228.0.0.5"

port="45564"

frequency="500"

                        dropTime="3000"/>

     </Channel>

     ......

</Cluster>

相关推荐