activemq-artemis - 复制的 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>
这些配置有什么问题?
解决方案
为了复制消息,它们必须是持久的(即持久的)。根据定义,非持久消息是易变的,因此不会被复制。
推荐阅读
- go - 如何从gorm中的模型中获取表名?
- javascript - Javascript / ES6 从对象数组中解析值
- mongodb - $lookup 使用猫鼬
- java - 为什么在junit测试期间多次初始化bean?
- crystal-lang - 呼叫阻止呼叫不起作用
- hadoop - 如何使用 BDM(Informatica)将文件从本地文件系统复制到 hdfs 文件系统?
- java - JOLT:将逗号分隔值转换为对象
- c# - 在 Windows 服务器中使用正确的设置和配置设置 Elasticsearch 以供生产使用
- javascript - 使用 if、else if 和 else 时出现意外的标记 else
- javascript - 如何在Angular中使用*ngFor动态调用所有图像并显示?