docker rocketmq
docker pull docker.1panel.live/apache/rocketmq:4.9.2
docker network create rocketmq
# 启动NameServer
docker run -d --name rmqnamesrv -p 9876:9876 --net rocketmq docker.1panel.live/apache/rocketmq:4.9.2 sh mqnamesrv
# 配置 Broker 的 IP 地址
echo "brokerIP1=127.0.0.1" >broker.conf
# 启动 Broker
docker run -d --name rmqbroker --net rocketmq -p 10912:10912 -p 10911:10911 -p 10909:10909 -e "NAMESRV_ADDR=rmqnamesrv:9876" -v ./broker.conf:/home/rocketmq/rocketmq-4.9.2/conf/broker.conf docker.1panel.live/apache/rocketmq:4.9.2 sh mqbroker -c /home/rocketmq/rocketmq-4.9.2/conf/broker.conf
# 验证 Broker 是否启动成功
docker logs rmqbroker
vi /path/to/rocketmq/conf/namesrv.properties
listenPort=9876
vi /path/to/rocketmq/conf/broker.conf
brokerIP1=192.168.31.118
namesrvAddr=192.168.31.118:9876
listenPort=10911
docker restart rmqnamesrv
docker restart rmqbroker
docker exec -it rmqbroker bash
sh tools.sh org.apache.rocketmq.example.quickstart.Producer -n 192.168.31.118:9876 -t TestTopic -m "Hello"
sh tools.sh org.apache.rocketmq.example.quickstart.Consumer -n 192.168.31.118:9876 -t TestTopic
原文地址:https://blog.csdn.net/a309450028a/article/details/144096984
免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!