Steps to install RocketMQ instance on Linux

Steps to install RocketMQ instance on Linux

1. Install JDK

1.1 Check whether the current virtual machine environment has JDK rpm -qa|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 upload the tar package to the folder

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

Configure the /etc/profile file and add JDK environment variables

export JAVA_HOME=/usr/local/java/jdk1.8.0_121 Replace your 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 check the version

2. Install RocketMQ

2.1 Configure the /etc/hosts file and write the IP addresses of the two hosts

  • 192.168.42.22 rocketmq-nameserver1
  • 192.168.42.22 rocketmq-master1
  • 192.168.42.33 rocketmq-nameserver2
  • 192.168.42.33 rocketmq-master2

2.2 Restart the network card service network restart

2.3 Upload the rocketmq compressed package to /usr/local

2.4 Switch to /usr/local and decompress the rocketmq compressed package tar -zxvf xxxxxx

2.5 Change the name of the decompression folder

mv alibaba-rocketmq alibaba-rocketmq-3.2.6

2.6 Create a soft link

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

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

2.9 master01 configures borker-a.properties

brokerName=broker-a corresponds to the file name

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

master02 configures borker-b.properties

brokerName=broker-b corresponds to the file name

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

2.10 Changelog

mkdir -p /usr/local/rocketmq/logs

cd /usr/local/rocketmq/conf && sed -i 's#${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

Start: nohup sh mqnamesrv &

jps checks whether the JDK process has NamesrvStartup

2.13 Start BrokerServer

cd /usr/local/rocketmq/bin

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

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

jps checks whether the JDK process has BrokerStartup

3. Monitor the RocketMQ status through the console

3.1 Upload the Tomcat compressed package to the virtual machine and decompress it /usr/local tar -zxvf xxxx decompression

3.2 Upload rocketmq-web-console.war to the webapps directory of Tomcat decompression directory

3.3 Start Tomcat

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

./startup.sh starts ./shutdown.sh stops

3.4 Modify the unzipped 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 Firewalls of both machines are turned off

systemctl stop firewalld.service

systemctl disable firewalld.service

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

The above are all the relevant knowledge points introduced this time. You can follow them to learn. Thank you for your support of 123WORDPRESS.COM.

You may also be interested in:
  • Spring Boot elegant use of RocketMQ method example
  • Implementation of Java RocketMQ routing registration and deletion
  • Sample code for implementing delayed messages using Kotlin+RocketMQ
  • RocketMQ consumption load balancing--push consumption details
  • Detailed steps for building and deploying RocketMQ on Windows
  • Java RocketMQ Quick Start Basics
  • Detailed installation and use of RocketMQ in Docker
  • SpringBoot integrates RocketMQ and sample code for pitfalls
  • A brief talk about the experience of integrating Springboot with RocketMQ
  • RocketMQ retry mechanism and message power code example analysis

<<:  How to switch between Vue production and development environments and use filters

>>:  MySQL latest version 8.0.17 decompression version installation tutorial

Recommend

How to run the springboot project in docker

1. Click Terminal below in IDEA and enter mvn cle...

Explanation of the basic syntax of Mysql database stored procedures

drop procedure sp_name// Before this, I have told...

JS implements array filtering from simple to multi-condition filtering

Table of contents Single condition single data fi...

Solve the problem of inconsistent front and back end ports of Vue

Vue front and back end ports are inconsistent In ...

Install and deploy java8 and mysql under centos7

Generally, learning Java and deploying projects a...

Analysis of examples of using anti-shake and throttling in Vue components

Be careful when listening for events that are tri...

Example of Vue routing listening to dynamically load the same page

Table of contents Scenario Analysis Development S...

Analyze Mysql transactions and data consistency processing issues

This article analyzes the consistency processing ...

Basic notes on html and css (must read for front-end)

When I first came into contact with HTML, I alway...

Vue realizes the whole process of slider drag verification function

Rendering Define the skeleton, write HTML and CSS...

Implementation of vite+vue3.0+ts+element-plus to quickly build a project

Table of contents vite function Use Environment B...