Running RocketMQ on Mac M1 with Docker: A Step‑by‑Step Guide
This article details how to set up Apache RocketMQ on a Mac M1 using Docker, covering source‑code deployment, Docker container configuration, broker and nameserver setup, dashboard launch, message testing, and troubleshooting common connection issues.
In this guide the author explains how to get Apache RocketMQ running on a Mac M1, first describing the challenges of using the native binary and then showing how Docker can simplify the process.
1. Running RocketMQ from source – The author cloned the RocketMQ source from GitHub (version 4.9.2) and referenced a previous article for detailed steps.
2. Running RocketMQ with Docker
The setup uses three containers: a nameserver (image rocketmqinc/rocketmq), a broker (image dyrnq/rocketmq:4.8.0) and a dashboard (image apacherocketmq/rocketmq-dashboard:latest).
docker pull rocketmqinc/rocketmq docker run -d -p 9876:9876 -v `pwd`/data/namesrv/logs:/root/logs -v `pwd`/data/namesrv/store:/root/store --name rmqnamesrv rocketmqinc/rocketmq sh mqnamesrv docker run -d -p 10911:10911 -p 10909:10909 -v `pwd`/data/broker/logs:/root/logs -v `pwd`/data/broker/store:/root/store --name rmqbrokerv2 --link rmqnamesrv:namesrv -e "NAMESRV_ADDR=namesrv:9876" dyrnq/rocketmq:4.8.0 sh mqbroker -c ../conf/broker.conf docker exec -it b6b /bin/bashInside the broker container the broker.conf file is edited (installing vim if necessary) and the line brokerIP1=192.168.10.197 is added, where the IP should be the host’s external address. ifconfig | grep "inet" 3. Starting the RocketMQ Dashboard
docker run -d --name rocketmq-dashboard -e "JAVA_OPTS=-Drocketmq.namesrv.addr=172.16.8.62:9876 -Drocketmq.config.isVIPChannel=false" -p 8080:8080 -t apacherocketmq/rocketmq-dashboard:latestAfter the container starts, the dashboard is reachable at http://localhost:8080/. The isVIPChannel=false flag is required to fetch data.
4. Testing message sending
A test message is sent to the test_topic via the dashboard UI, and the message can be verified in the Message list, confirming that the content matches the sent payload.
5. Common issues and solutions
Broker cannot connect to NameServer – Add brokerIP1=192.168.10.197 to broker.conf and start the broker with the -c ../conf/broker.conf option.
Broker fails to start – Usually caused by the NameServer not running; ensure the nameserver container is up before restarting the broker.
By following these steps, RocketMQ can be successfully deployed on a Mac M1 (or any Linux host) using Docker, with a functional dashboard for monitoring and troubleshooting.
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.
Wukong Talks Architecture
Explaining distributed systems and architecture through stories. Author of the "JVM Performance Tuning in Practice" column, open-source author of "Spring Cloud in Practice PassJava", and independently developed a PMP practice quiz mini-program.
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.
