Replicated ActiveMQ未复制Artemis伺服器讯息



我已经配置了ActiveMQ主服务器和从服务器。

在主服务器故障的情况下,从服务器被设置为活动服务器,但是以前来自主服务器的消息不可用。

主配置(broker.xml):

<connectors>
<!-- Connector used to be announced through cluster connections and notifications -->
<connector name="artemis">tcp://192.168.2.200:61616</connector>
<!-- connector to the slaves -->
<connector name="slave1-connector">tcp://192.168.2.112:61616</connector>
</connectors>
<ha-policy>
<replication>
<master>
<!--we need this for auto failback-->
<check-for-live-server>true</check-for-live-server>
</master>
</replication>
</ha-policy>

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

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

<cluster-connections>
<cluster-connection name="my-cluster">
<connector-ref>artemis</connector-ref>
<message-load-balancing>STRICT</message-load-balancing>
<static-connectors>
<connector-ref>slave1-connector</connector-ref>
</static-connectors>
</cluster-connection>
</cluster-connections>

从属配置(broker.xml):

<connectors>
<!-- Connector used to be announced through cluster connections and notifications -->
<connector name="artemis">tcp://192.168.2.112:61616</connector>
<!-- connector to the master -->
<connector name="master-connector">tcp://192.168.2.200:61616</connector>
</connectors>
<ha-policy>
<replication>
<slave>
<allow-failback>true</allow-failback>
<!-- not needed but tells the backup not to restart after failback as there will be > 0 backups saved -->
<max-saved-replicated-journals-size>0</max-saved-replicated-journals-size>
<failback-delay>2000</failback-delay>
</slave>
</replication>
</ha-policy>
<cluster-user>admin</cluster-user>
<cluster-password>admin</cluster-password>
<cluster-connections>
<cluster-connection name="my-cluster">
<connector-ref>artemis</connector-ref>
<message-load-balancing>STRICT</message-load-balancing>
<static-connectors>
<connector-ref>master-connector</connector-ref>
</static-connectors>
</cluster-connection>
</cluster-connections>

这些配置有什么问题?

为了复制消息,它们必须是持久的(即持久的)。根据定义,非持久消息是易变的,因此不能复制。

最新更新