复制的 ActiveMQ Artemis 服务器 - 消息不被复制
Replicated ActiveMQ Artemis server - messages are not replicated
我已经配置了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>
这些配置有什么问题?
为了复制消息,它们必须持久(即持久)。根据定义,非持久消息是易变的,因此不会被复制。
我已经配置了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>
这些配置有什么问题?
为了复制消息,它们必须持久(即持久)。根据定义,非持久消息是易变的,因此不会被复制。