The process of installing RocketMQ in Docker is as follows:
Create a Docker network:
Execute the following command in the terminal to create a Docker network for communication between containers:
docker network create rocketmq-network
Download the RocketMQ image:
Execute the following command in the terminal to download the RocketMQ Docker image:
docker pull rocketmqinc/rocketmq
Start the Name Server container:
Execute the following command in the terminal to start the Name Server container:
docker run -d --name rmqnamesrv --net rocketmq-network -p 9876:9876 rocketmqinc/rocketmq:latest sh mqnamesrv
Start the Broker container:
Execute the following command in the terminal to start the Broker container:
docker run -d --name rmqbroker --net rocketmq-network -p 10909:10909 -p 10911:10911 -e "NAMESRV_ADDR=rmqnamesrv:9876" -e "ROCKETMQ_BROKER=broker-a" rocketmqinc/rocketmq:latest sh mqbroker -c ../conf/broker.conf
Verify RocketMQ installation:
Use the following command to enter the Broker container’s shell:
docker exec -it rmqbroker sh
Inside the container, execute the following command to verify the RocketMQ installation:
cd /opt/rocketmq/bin/sh mqadmin topicList -n rmqnamesrv:9876
By following the above steps, you can successfully install and deploy RocketMQ in Docker. Please note that the above commands only provide a basic installation and configuration process, and the specific configuration and usage can be further adjusted according to your needs. Make sure you have installed and configured the Docker environment before executing the command.
The above is the detailed content of Common environment deployment—Docker installation RocketMQ tutorial!. For more information, please follow other related articles on the PHP Chinese website!