premise
Configured jdk environment
First, download: the Apache-ActiveMQ-5.15.2-bin.tar.gz
https://archive.apache.org/dist/activemq/5.15.2/apache-activemq-5.15.2-bin.tar.gz
Second, the installation activemq
#su - admin
1, gz copy of the document / home / admin directory
2, unzip start
tar -zxvf apache-activemq-5.15.2-bin.tar.gz
cd apache-activemq-5.15.2/bin
./activemq start
#su – root
ln -s /home/admin/activemq/bin/activemq /etc/init.d/
Service starts
#su - admin
/etc/init.d/activemq start
Set boot from the start
#cat /etc/rc.local
export JAVA_HOME=/usr/local/jdk1.8
su - admin -c '/home/admin/activemq/bin/activemq start'
Log Directory
/home/admin/activemq/data
View control station
Directly open the browser to access locally: Linux's address plus port 8161.
The default login user: admin password: admin
Modify user information to edit conf / jetty-realm.properties to
Cluster configuration
192.168.13.19、192.168.13.24、192.168.13.25
ActiveMQ modify the configuration file conf / activemq.xml
1, the first modification: brokerName = "msgService" MQ needs to be modified into three different
<broker xmlns="http://activemq.apache.org/schema/core" brokerName="msgService" dataDirectory="${activemq.data}">
2, the second modified:
<persistenceAdapter>
<!-- <kahaDB directory="${activemq.data}/kahadb"/> -->
<replicatedLevelDB
directory="${activemq.data}/leveldb"
replicas="3"
bind="tcp://0.0.0.0:0"
zkAddress="192.168.13.19:2181,192.168.13.24:2181,192.168.13.25:2181"
zkPassword=""
zkPath="/activemq/leveldb-stores"
hostname="192.168.13.19"
// were modified to correspond to your own server's ip address
sync="local_disk"
/>