組建ACTIVEMQ CLUSTER,使得其中一個(gè)ACTIVE MQ DOWN掉時(shí),能自動(dòng)切換到其他節(jié)點(diǎn)。
ACTIVEMQ 只有MASTER-SLAVE模式,集群中的多個(gè)節(jié)點(diǎn)共享消息的存儲(chǔ),多個(gè)節(jié)點(diǎn)同時(shí)啟動(dòng)時(shí),競爭消息存儲(chǔ)的鎖,誰先取得,誰就是MASTER,當(dāng)MASTER DOWN掉時(shí),鎖被釋放,SALVE中馬上又競爭鎖,取得者成為MASTER。
方案:
- 安裝NFSV4
- 修改消息存儲(chǔ)路徑
<persistenceAdapter>
<kahaDB directory="/sharedFileSystem/sharedBrokerData"/>
</persistenceAdapter>
- 客戶端修改連接字符串
failover://(tcp://master:61616,tcp://slave:61616)?randomize=false

--》
https://my.oschina.net/hzchenyh/blog/716424
https://www.iteye.com/blog/shift-alt-ctrl-2069250
https://stackoverflow.com/questions/53542928/activemq-ha-on-failover
https://activemq.apache.org/shared-file-system-master-slaveActiveMQ(6)-基于networkConnector的Broker-Cluster方案
https://blog.csdn.net/jinjin603/article/details/78657387Multi Data Centre Message Brokers with ActiveMQ
https://medium.com/thg-tech-blog/multi-data-centre-message-brokers-with-activemq-28495046370eActiveMQ中的NetworkConnector(網(wǎng)絡(luò)連接器)詳解
https://www.iteye.com/blog/manzhizhen-2116920a