1、centos7,2核8G
2、已安装jdk8,未安装参考:【CentOS7】安装使用jdk8
https://mirrors.tuna.tsinghua.edu.cn/apache/rocketmq/4.8.0/
unzip rocketmq-all-4.8.0-bin-release.zip
mv rocketmq-all-4.8.0-bin-release rocketmq
vim /etc/profile
添加:
export NAMESRV_ADDR=127.0.0.1:9876
vim /etc/profile
添加:
export ROCKETMQ_HOME=/usr/local/rocketmq
export PATH=$JAVA_HOME/bin:$ROCKETMQ_HOME/bin:$PATH
#使rocketmq的配置生效
source /etc/profile
5、启动namesrv服务
cd /usr/local/rocketmq/bin/
nohup sh mqnamesrv &
#查看日志
tail -f ~/logs/rocketmqlogs/namesrv.log
nohup sh mqbroker -n localhost:9876 &
#查看日志
tail -f ~/logs/rocketmqlogs/broker.log
#报错
file doesn't exist on this path: /root/store/commitlog
file doesn't exist on this path: /root/store/consumequeue
对应创建即可:
touch /root/store/commitlog
touch /root/store/consumequeue
cd /usr/local/rocketmq
sh bin/mqshutdown broker //停止 broker
sh bin/mqshutdown namesrv //停止 nameserver
#拉取镜像
docker pull pangliang/rocketmq-console-ng
#启动新容器
docker run -d -e "JAVA_OPTS=-Drocketmq.namesrv.addr=192.168.16.23:9876 -Dcom.rocketmq.sendMessageWithVIPChannel=false" -p 8088:8080 -t pangliang/rocketmq-console-ng
http://192.168.16.23:8088/#/