Get the App
SLTechnology News&Howtos  ›  Servers  › 

Centos activemq cluster configuration Networks of Brokers

Shulou Source: shulou.com Published: 2022-06-03 05:37:09 10月02日 Update

1. Install the JDK running environment

# cd / opt # wget-- no-check-certificate-- no-cookies-- header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u112-b15/jdk-8u112-linux-x64.tar.gz # tar zxvf jdk-8u112-linux-x64.tar.gz # vi / etc/profile add the following content export JAVA_HOME=/opt/jdk-8u112export PATH=$JAVA_HOME/bin:$PATHexport CLASSPATH=.:$JAVA_HOME/lib/dt. Jar:$JAVA_HOME/lib/tools.jar#source / etc/profile#java-versionjava version "1.8.0mm 12" Java (TM) SE Runtime Environment (build 1.8.0_12-b12) Java HotSpot (TM) 64-Bit Server VM (build 25.12-b03 Mixed mode)

2. Install and configure activemq

Here we configure the Networks of Brokers cluster mode

The two broker, activemq-1 and activemq-2, are the master and backup of each other. The messages sent to you will be synchronized to me, and the messages sent to me will also be synchronized to you, realizing the HA. The schematic diagram is as follows: 192.168.1.105 broker 61626

The advantage of this HA scheme is that it occupies less nodes (only 2 nodes are needed), and both broker can respond to the receiving and sending of messages, so the performance is better than zookeeper scheme.

# wget # tar-zxvf apache-activemq-5.14.5-bin.tar.gz# vi conf/activemq.xml 192.168.1.104 is configured (written to 192.168.1.105 file:$ file:$ {activemq.conf} / credentials.properties) Configure on 192.168.1.105 (write 192.168.1.104 credentials.properties 61616) # vi conf/activemq.xml file:$ {activemq.conf} / credentials.properties

After the configuration is finished, we start separately.

# bin/activemq start#tail-f data/activemq.log View the log and you can see that the connection 2017-05-1209 has been established. | INFO | Establishing network connection from vm://activemq-1?async=false&create=false to tcp://192.168.1.105:61626 | org.apache.activemq.network.DiscoveryNetworkConnector | main

Access the activemq console

Http://ip:8161/admin/ (default account: admin default password: admin)

When Producer and Consumer connect to activemq, the configuration file can be written as follows:

...

The advantage of this HA scheme is that it occupies less nodes (only 2 nodes are needed), and both broker can respond to the receiving and sending of messages, so the performance is better than zookeeper scheme.

Tags: Configuration scheme message advantage performance points node better cluster content password console file log mode environment diagram account control run Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Docker vpn macOS Microsoft Linux