ActiveMQ Artemis 2.21 Master/Slave 状态

ActiveMQ Artemis 2.21 Master/Slave Status

我已经在具有共享存储的 1 Master/ 1 Slave 集群中安装了 ActiveMQ Artemis 2.21.0。集群工作正常,但是,我不知道为什么在“集群信息”的 STATUS 部分的 Web 控制台中显示 Lives: 2 , 当只有一个 Master Up 时。备份节点保持在1,这是正确的。

你能帮我反馈一下吗?

master配置如下:

  <connectors>
    <connector name="artemis">tcp://localhost:61616</connector>
  </connectors>

  <cluster-user>admin</cluster-user>
  <cluster-password>admin</cluster-password>

  <broadcast-groups>
     <broadcast-group name="bg-group1">
        <group-address>231.7.7.7</group-address>
        <group-port>9876</group-port>
        <broadcast-period>5000</broadcast-period>
        <connector-ref>artemis</connector-ref>
     </broadcast-group>
  </broadcast-groups>

  <discovery-groups>
     <discovery-group name="dg-group1">
        <group-address>231.7.7.7</group-address>
        <group-port>9876</group-port>
        <refresh-timeout>10000</refresh-timeout>
     </discovery-group>
  </discovery-groups>

  <cluster-connections>
     <cluster-connection name="my-cluster">
        <connector-ref>artemis</connector-ref>
        <message-load-balancing>ON_DEMAND</message-load-balancing>
        <max-hops>0</max-hops>
        <discovery-group-ref discovery-group-name="dg-group1"/>
     </cluster-connection>
  </cluster-connections>


  <ha-policy>
     <shared-store>
        <master>
           <failover-on-shutdown>true</failover-on-shutdown>
        </master>
     </shared-store>
  </ha-policy>

slave配置如下:

  <connectors>
    <connector name="artemis">tcp://localhost:61617</connector>
    <connector name="netty-live-connector">tcp://localhost:61616</connector>
  </connectors>

  <cluster-user>admin</cluster-user>
  <cluster-password>admin</cluster-password>

  <broadcast-groups>
     <broadcast-group name="bg-group1">
        <group-address>231.7.7.7</group-address>
        <group-port>9876</group-port>
        <broadcast-period>5000</broadcast-period>
        <connector-ref>artemis</connector-ref>
     </broadcast-group>
  </broadcast-groups>

  <discovery-groups>
     <discovery-group name="dg-group1">
        <group-address>231.7.7.7</group-address>
        <group-port>9876</group-port>
        <refresh-timeout>10000</refresh-timeout>
     </discovery-group>
  </discovery-groups>

  <cluster-connections>
     <cluster-connection name="my-cluster">
        <connector-ref>artemis</connector-ref>
        <message-load-balancing>ON_DEMAND</message-load-balancing>
        <max-hops>0</max-hops>
        <discovery-group-ref discovery-group-name="dg-group1"/>
     </cluster-connection>
  </cluster-connections>


  <ha-policy>
     <shared-store>
        <slave>
           <allow-failback>true</allow-failback>
        </slave>
     </shared-store>
  </ha-policy>

Web 控制台图像是:

您正在使用默认的 group-addressgroup-port(即分别为 231.7.7.79876),这意味着 任何其他经纪人 在子网上也使用默认值将加入该集群。我建议您尝试使用不同的组地址 and/or 端口,看看您是否仍然遇到同样的问题。