2 个 ubuntu 虚拟机上的 tomcat 8.5 集群问题 - 跳过状态转移集群组中没有活动成员

问题描述

我正在尝试使用 2 台 ubuntu 机器创建一个 tomcat 集群。 Tomcat 在两个虚拟机上都成功启动。但是,war 文件不会复制到 node2 上。错误说:跳过状态转移。集群组中没有活动成员。请让我知道 config.xml 中是否有任何错误 我在两个虚拟机上都使用 tomcat 8.5。

以下是node1上server.xml内容

<Engine name="Catalina" defaultHost="localhost" jvmRoute="test01">
<Host name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="true"
            xmlValidation="false" xmlNamespaceAware="false">
<Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"
                 channelSendOptions="8">

          <Manager className="org.apache.catalina.ha.session.DeltaManager"
                   expireSessionsOnShutdown="false"
                   notifyListenersOnReplication="true"/>

          <Channel className="org.apache.catalina.tribes.group.GroupChannel">
            <Membership className="org.apache.catalina.tribes.membership.McastService"
                        address="228.0.0.4"
                        port="45564"
                        frequency="500"
                        dropTime="3000"/>
            <Receiver className="org.apache.catalina.tribes.transport.nio.NioReceiver"
                      address="auto"
                      port="4000"
                      autoBind="100"
                      selectorTimeout="5000"
                      maxThreads="6"/>

            <Sender className="org.apache.catalina.tribes.transport.ReplicationTransmitter">
              <Transport className="org.apache.catalina.tribes.transport.nio.PooledParallelSender"/>
            </Sender>
            <Interceptor className="org.apache.catalina.tribes.group.interceptors.TcpFailureDetector"/>
            <Interceptor className="org.apache.catalina.tribes.group.interceptors.MessagedispatchInterceptor"/>
          </Channel>

          <Valve className="org.apache.catalina.ha.tcp.ReplicationValve"
                 filter=""/>
          <Valve className="org.apache.catalina.ha.session.JvmRouteBinderValve"/>

          <Deployer className="org.apache.catalina.ha.deploy.FarmWarDeployer"
                    tempDir="/tmp/war-temp/"
                    deployDir="/tmp/war-deploy/"
                    watchDir="/tmp/war-listen/"
                    watchEnabled="false"/>

          <ClusterListener className="org.apache.catalina.ha.session.ClusterSessionListener"/>
        </Cluster>
</Host>
</Engine>

以下是节点2上server.xml内容

<Engine name="Catalina" defaultHost="localhost" jvmRoute="test02">
<Host name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="true"
            xmlValidation="false" xmlNamespaceAware="false">
<Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"
                 channelSendOptions="8">

          <Manager className="org.apache.catalina.ha.session.DeltaManager"
                   expireSessionsOnShutdown="false"
                   notifyListenersOnReplication="true"/>

          <Channel className="org.apache.catalina.tribes.group.GroupChannel">
            <Membership className="org.apache.catalina.tribes.membership.McastService"
                        address="228.0.0.4"
                        port="45564"
                        frequency="500"
                        dropTime="3000"/>
            <Receiver className="org.apache.catalina.tribes.transport.nio.NioReceiver"
                      address="auto"
                      port="4000"
                      autoBind="100"
                      selectorTimeout="5000"
                      maxThreads="6"/>

            <Sender className="org.apache.catalina.tribes.transport.ReplicationTransmitter">
              <Transport className="org.apache.catalina.tribes.transport.nio.PooledParallelSender"/>
            </Sender>
            <Interceptor className="org.apache.catalina.tribes.group.interceptors.TcpFailureDetector"/>
            <Interceptor className="org.apache.catalina.tribes.group.interceptors.MessagedispatchInterceptor"/>
          </Channel>

          <Valve className="org.apache.catalina.ha.tcp.ReplicationValve"
                 filter=""/>
          <Valve className="org.apache.catalina.ha.session.JvmRouteBinderValve"/>

          <Deployer className="org.apache.catalina.ha.deploy.FarmWarDeployer"
                    tempDir="/tmp/war-temp/"
                    deployDir="/tmp/war-deploy/"
                    watchDir="/tmp/war-listen/"
                    watchEnabled="false"/>

          <ClusterListener className="org.apache.catalina.ha.session.ClusterSessionListener"/>
        </Cluster>
</Host>
</Engine>

来自catalina.out node1的日志如下:

26-May-2021 13:01:50.682 INFO [Catalina-startStop-1] org.apache.catalina.ha.tcp.SimpleTcpCluster.startInternal Cluster is about to start
26-May-2021 13:01:50.686 INFO [Catalina-startStop-1] org.apache.catalina.tribes.transport.ReceiverBase.bind Receiver Server Socket bound to:/10.1.0.7:4000
26-May-2021 13:01:50.696 INFO [Catalina-startStop-1] org.apache.catalina.tribes.membership.McastServiceImpl.setupSocket Setting cluster mcast soTimeout to 500
26-May-2021 13:01:50.701 INFO [Catalina-startStop-1] org.apache.catalina.tribes.membership.McastServiceImpl.waitForMembers Sleeping for 1000 milliseconds to establish cluster membership,start level:4
26-May-2021 13:01:51.701 INFO [Catalina-startStop-1] org.apache.catalina.tribes.membership.McastServiceImpl.waitForMembers Done sleeping,membership established,start level:4
26-May-2021 13:01:51.702 INFO [Catalina-startStop-1] org.apache.catalina.tribes.membership.McastServiceImpl.waitForMembers Sleeping for 1000 milliseconds to establish cluster membership,start level:8
26-May-2021 13:01:52.703 INFO [Catalina-startStop-1] org.apache.catalina.tribes.membership.McastServiceImpl.waitForMembers Done sleeping,start level:8
26-May-2021 13:01:52.704 INFO [Catalina-startStop-1] org.apache.catalina.ha.deploy.FarmWarDeployer.start Cluster FarmWarDeployer started.
26-May-2021 13:01:52.739 INFO [Catalina-startStop-1] org.apache.catalina.ha.session.JvmRouteBinderValve.startInternal JvmRouteBinderValve started
26-May-2021 13:01:52.763 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR deploying web application archive /opt/tomcat/webapps/test.war
26-May-2021 13:02:22.826 INFO [localhost-startStop-1] org.apache.catalina.ha.session.DeltaManager.startInternal Register manager /test to cluster element Host with name localhost
26-May-2021 13:02:22.827 INFO [localhost-startStop-1] org.apache.catalina.ha.session.DeltaManager.startInternal Starting clustering manager at /test
26-May-2021 13:02:22.827 INFO [localhost-startStop-1] org.apache.catalina.ha.session.DeltaManager.getAllClusterSessions Manager [/test]: skipping state transfer. No members active in cluster group.

来自 catalina.out node2 的日志如下:

26-May-2021 13:00:59.544 INFO [Catalina-startStop-1] org.apache.catalina.ha.tcp.SimpleTcpCluster.startInternal Cluster is about to start
26-May-2021 13:00:59.617 INFO [Catalina-startStop-1] org.apache.catalina.tribes.transport.ReceiverBase.bind Receiver Server Socket bound to:/10.2.0.5:4000
26-May-2021 13:00:59.633 INFO [Catalina-startStop-1] org.apache.catalina.tribes.membership.McastServiceImpl.setupSocket Setting cluster mcast soTimeout to 500
26-May-2021 13:00:59.636 INFO [Catalina-startStop-1] org.apache.catalina.tribes.membership.McastServiceImpl.waitForMembers Sleeping for 1000 milliseconds to establish cluster membership,start level:4
26-May-2021 13:01:00.636 INFO [Catalina-startStop-1] org.apache.catalina.tribes.membership.McastServiceImpl.waitForMembers Done sleeping,start level:4
26-May-2021 13:01:00.638 INFO [Catalina-startStop-1] org.apache.catalina.tribes.membership.McastServiceImpl.waitForMembers Sleeping for 1000 milliseconds to establish cluster membership,start level:8
26-May-2021 13:01:01.639 INFO [Catalina-startStop-1] org.apache.catalina.tribes.membership.McastServiceImpl.waitForMembers Done sleeping,start level:8
26-May-2021 13:01:01.640 INFO [Catalina-startStop-1] org.apache.catalina.ha.deploy.FarmWarDeployer.start Cluster FarmWarDeployer started.
26-May-2021 13:01:01.669 INFO [Catalina-startStop-1] org.apache.catalina.ha.session.JvmRouteBinderValve.startInternal JvmRouteBinderValve started

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...