Docker 部署RocketMQ
半夏のblog 人气:0拉取镜像
docker search rocketmq docker pull foxiswho/rocketmq:4.8.0
启动NameServer
docker run -d --name rmqnamesrver -e "JAVA_OPT_EXT=-Xms512M -Xmx512M -Xmn128m" -p 9876:9876 foxiswho/rocketmq:4.8.0 sh mqnamesrv
启动Broker
创建挂在目录
mkdir -p /data/docker/rocketmq/logs mkdir -p /data/docker/rocketmq/store chmod -R 777 /data
启动broker
docker run -d -v /data/docker/rocketmq/logs:/home/rocketmq/logs -v /data/docker/rocketmq/store:/home/rocketmq/store --name rmqbroker -e "NAMESRV_ADDR=[namserver ip地址]:9876" -e ”JAVA_OPT_EXT=-Xms512M -Xmx512M -Xmn128m" -p 10911:10911 foxiswho/rocketmq:4.8.0 sh mqbroker -c /home/rocketmq/rocketmq-4.8.0/conf/broker.conf
需要注意:sh mqbroker -c 后的路径是否正确,当启动后要进入容器在broker.conf中配置上NameServer的ip信息。将broker注册进Nameserver。
启动Rocketmq-console控制台
docker search rocketmq-console-ng docker pull rocketmq-console-ng
docker run --name rmqconsole -e "JAVA_OPTS=-Drocketmq.namesrv.addr=[namserver ip]:9876 -Dcom.rocketmq.sendMessageWithVIPChannel=false" -p 8180:8080 -t styletang/rocketmq-console-ng
开放端口 fire-cmd --zone=public --add-port=8180/tcp --permanent
浏览器访问:ip地址:8180
加载全部内容