5、安装ActiveMQ集群
wget https://mirrors.tuna.tsinghua.edu.cn/apache//activemq/5.14.5/apache-activemq-5.14.5-bin.tar.gz
tar -xvzf apache-activemq-5.14.5-bin.tar.gz
mv apache-activemq-5.14.5 /usr/local
vi /usr/local/activemq/conf/activemq.xml
# 注释掉之前的
<!--
<persistenceAdapter>
<kahaDB directory="${activemq.data}/kahadb"/>
</persistenceAdapter>
-->
# 添加以下
<persistenceAdapter>
<replicatedLevelDB
directory="${activemq.data}/leveldb"
replicas="6" #节点数量
bind="tcp://0.0.0.0:0"
zkAddress="node1:2181,node2:2181,node3:2181"
hostname="localhost"
sync="local_disk"
zkPath="/activemq/leveldb-stores"
/>
</persistenceAdapter>
activemq start
# 主机名为所有节点中的任意一台
http://node5:8161/admin/
帐号:admin
密码:admin