如何解决复制的 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>
这些配置有什么问题?
解决方法
为了复制消息,它们必须持久(即持久)。根据定义,非持久消息是易失性的,因此不会被复制。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。