How to Install and Deploy Apache RocketMQ 5.1.4 on Ubuntu
This guide walks you through setting up the Java environment, downloading Apache RocketMQ 5.1.4, installing its NameServer, Broker, and optional Proxy components on an Ubuntu 20.04 cloud instance, and configuring both local and cluster deployment modes with optional visual dashboard tools.
System Environment
Java : openjdk version "1.8.0_392" Operating System : Tencent Cloud Ubuntu 20.04 image RocketMQ : rocketmq-5.1.4
Download RocketMQ
Official download page: https://rocketmq.apache.org/zh/docs/quickStart/01quickstart (see “Download and Install” section). GitHub release: https://github.com/apache/rocketmq/releases/tag/rocketmq-all-5.1.4 Ubuntu image download:
# Download release from the Apache mirror
$ wget https://dist.apache.org/repos/dist/release/rocketmq/5.1.4/rocketmq-all-5.1.4-bin-release.zipDeployment
Installation
Move the downloaded RocketMQ package to the working directory (here /opt) and unzip:
mv rocketmq-all-5.1.4-bin-release.zip /opt
cd /opt
unzip rocketmq-all-5.1.4-bin-release.zipComponent Description
RocketMQ 5.x includes three components: NameServer, Broker, and Proxy.
NameServer : registration center that maintains Broker registration info and provides address lookup for Producers and Consumers.
Broker : message server that stores, receives, and forwards messages.
Proxy : optional component that offers load balancing, traffic control, and rate limiting. Not required before version 5.x.
Deployment Modes
RocketMQ 5.x adds the Proxy component, allowing two deployment modes:
Local mode : Broker and Proxy run in the same process; only simple Proxy configuration is needed.
Cluster mode : Broker and Proxy are deployed independently, adding Proxy to an existing cluster.
Local Mode Deployment
Since Proxy is stateless, the cluster configuration remains based on the Broker.
Start NameServer
Enter the bin directory and run:
# Enter directory
cd /opt/rocketmq-all-5.1.4-bin-release/bin
# Start NameServer
nohup sh mqnamesrv &Note: The default JVM memory for NameServer is 4 GB; adjust as needed.
Start Broker + Proxy
Configuration adjustment : If the server has both internal and public IPs, set brokerIP1 to the public IP in conf/broker.conf.
vim /opt/rocketmq-all-5.1.4-bin-release/conf/broker.conf
# modify brokerIP1 to public IPThe default Broker memory is 8 GB; modify as required.
Start the broker with Proxy enabled (replace localhost:9876 with the actual NameServer address):
# Enter directory
cd /opt/rocketmq-all-5.1.4-bin-release/bin
# Start Broker with Proxy
nohup sh bin/mqbroker -n localhost:9876 --enable-proxy &Cluster Mode Deployment
NameServer: same steps as local mode.
Broker: same installation steps; start command example:
# On machine A, start the first Master (NameServer IP 192.168.1.1)
nohup sh bin/mqbroker -n 192.168.1.1:9876 &Proxy: install on a separate server and start:
# Enter working directory
cd /opt/rocketmq-all-5.1.4-bin-release/bin
# Start Proxy (NameServer IP 192.168.1.1)
nohup sh bin/mqproxy -n 192.168.1.1:9876 &Advanced Deployment Options
Beyond single‑node deployment, RocketMQ supports:
Multiple nodes, single replica : multiple Masters without Slaves.
Multiple nodes, multiple replicas – asynchronous replication : Masters with Slaves, async sync.
Multiple nodes, multiple replicas – synchronous replication : Masters with Slaves, sync sync.
Master‑slave automatic failover : automatic promotion of a Slave when the Master fails.
Refer to the official deployment documentation for details.
Visualization Client Tool
RocketMQ Dashboard – the official visual management tool.
Source code: https://github.com/apache/rocketmq-dashboard
Modify application.yml to set rocketmq.config.namesrvAddrs to the NameServer address, then run locally or package as a JAR for server deployment.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
MaGe Linux Operations
Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
