Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Centos activemq cluster configuration Networks of Brokers

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

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.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report