同一网络中的 ActiveMQ Artemis 两个集群

ActiveMQ Artemis two cluster in same network

我想在同一个网络中为 Dev 和 QA(或 prod 和 staging)设置两个集群。每个集群由多个节点组成。节点将可以在网络上访问,我想消除 QA 节点与 Dev 节点的集群。为此我应该更改什么,以下是我的配置。

<connectors>
   <connector name="my-con">tcp://ip:61617</connector>
</connectors>

<acceptors>
   <acceptor name="my-acc">tcp://ip:61617</acceptor>
</acceptors>

<broadcast-groups>
   <broadcast-group name="bg-stage">
      <group-address>${udp-address:231.7.7.7}</group-address>
      <group-port>9877</group-port>
      <broadcast-period>100</broadcast-period>
      <connector-ref>my-con</connector-ref>
   </broadcast-group>
</broadcast-groups>

<discovery-groups>
   <discovery-group name="dg-stage">
      <group-address>${udp-address:231.7.7.7}</group-address>
      <group-port>9877</group-port>
      <refresh-timeout>10000</refresh-timeout>
   </discovery-group>
</discovery-groups>

<cluster-connections>
   <cluster-connection name="my-cluster">
      <connector-ref>my-con</connector-ref>
      <retry-interval>500</retry-interval>
      <use-duplicate-detection>true</use-duplicate-detection>
      <message-load-balancing>ON_DEMAND</message-load-balancing>
      <max-hops>1</max-hops>
      <discovery-group-ref discovery-group-name="dg-stage"/>
   </cluster-connection>
</cluster-connections>

是否需要更改不同的集群连接名称、广播组和发现组?

broadcast-groupdiscovery-group 上的 group-port 从默认的 9876 更改为 9877 应该足以将集群彼此隔离。更改配置中的名称除了您自己区分环境之间的配置的能力外,不会真正影响任何其他内容。