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

Linux install RocketMQ instance steps

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

1. Install JDK

1.1 check whether there is JDK rpm-qa in the current virtual machine environment | grep java

1.2 Uninstall rpm-e-nodeps xxxxxx (your own openjdk)

1.3 install JDK

Create a new java folder in / usr/local, and then upload the tar package to the folder

Switch to / usr/local/java and use tar-zxvf xxx to decompress

Configure / etc/profile file, add JDK environment variable

Export JAVA_HOME=/usr/local/java/jdk1.8.0_121 replaces its own path

Export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar

Export PATH=$JAVA_HOME/bin:$PATH

Application file source / etc/profile

Use java-version to view the version

two。 Install RocketMQ

2.1 configuration / etc/hosts file, the URL is written into the ip of the two hosts

192.168.42.22 rocketmq-nameserver1192.168.42.22 rocketmq-master1192.168.42.33 rocketmq-nameserver2192.168.42.33 rocketmq-master2

2.2 restart the Nic service network restart

2.3 upload rocketmq package and upload it to / usr/local

2.4 switch to / usr/local to extract the rocketmq package tar-zxvf xxxxxx

2.5 change the name of the extracted folder

Mv alibaba-rocketmq alibaba-rocketmq-3.2.6

2.6 create a soft connection

Ln-s alibaba-rocketmq-3.2.6 rocketmq

2.7 mkdir / usr/local/rocketmq/store

Mkdir / usr/local/rocketmq/store/commitlog

Mkdir / usr/local/rocketmq/store/consumequeue

Mkdir / usr/local/rocketmq/store/index

Upload borker-a.properties and borker-b.properties to / usr/local/recketmq/conf/2m-noslave

2.9 master01 configuration borker-a.properties

BrokerName=broker-a corresponding file name

NamesrvAddr=rocketmq-nameserver1:9876;rocketmq-nameserver2:9876

Master02 configuration borker-b.properties

BrokerName=broker-b corresponding file name

NamesrvAddr=rocketmq-nameserver1:9876;rocketmq-nameserver2:9876

2.10 modify log

Mkdir-p / usr/local/rocketmq/logs

Cd / usr/local/rocketmq/conf & & sed-I's xml ${user.home} # / usr/local/rocketmq#g' *. Xml

2.11 configure JVM parameters and modify them according to the actual size of your virtual machine

Vi / usr/local/rocketmq/bin/runbroker.sh

JAVA_OPT= "${JAVA_OPT}-server-Xms1g-Xmx1g-Xmn512m-XX:PermSize=128m-XX:MaxPermSize=320m"

Vi / usr/local/rocketmq/bin/runserver.sh

JAVA_OPT= "${JAVA_OPT}-server-Xms1g-Xmx1g-Xmn512m-XX:PermSize=128m-XX:MaxPermSize=320m"

2.12 start NameServer

Cd / usr/local/rocketmq/bin

Launch: nohup sh mqnamesrv &

Jps to check whether the JDK process has NamesrvStartup

2.13 start BrokerServer

Cd / usr/local/rocketmq/bin

Master01 startup: nohup sh mqbroker-c / usr/local/rocketmq/conf/2m-noslave/broker-a.properties > / dev/null 2 > & 1 &

Master02 startup: nohup sh mqbroker-c / usr/local/rocketmq/conf/2m-noslave/broker-b.properties > / dev/null 2 > & 1 &

Jps to check whether the JDK process has BrokerStartup

3. Monitor rocketmq status through the console console

Upload the Tomcat package to the virtual machine for decompression / usr/local tar-zxvf xxxx decompression

Upload rocketmq-web-console.war to webapps in the decompressed directory of Tomcat

3.3.Starting Tomcat

Switch to / usr/local/apache-tomcat-7.0.65/bin

. / startup.sh start. / shutdown.sh stop

3.4 modify the decompressed rocketmq-web-console

/ usr/local/apache-tomcat-7.0.65/webapps/rocketmq-web-console/WEB-INF/classes/config.properties configuration file

Configuration:

Rocketmq.namesrv.addr=192.168.42.22:9876;192.168.42.33:9876

ThrowDone=true

3.5 both machines' firewalls are turned off

Systemctl stop firewalld.service

Systemctl disable firewalld.service

After the configuration is completed, the web page visits the console, and the effect is as follows

The above is all the relevant knowledge points of this introduction, you can follow the study, thank you for your support.

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