Linux系统下安装rocketmq

//下载最新的rocketmq
wget http://apache-mirror.8birdsvideo.com/rocketmq/4.6.0/rocketmq-all-4.6.0-bin-release.zip
//解压
unzip rocketmq-all-4.6.0-bin-release.zip
//切换到mq目录
cd /usr/local/rocketmq-all-4.6.0-source-release/distribution/target/rocketmq-4.6.0/rocketmq-4.6.0
vim bin/runserver.sh
vim bin/runbroker.sh
//启动Nameserver
nohup sh bin/mqnamesrv &
//查看日志
tail -f ~/logs/rocketmqlogs/namesrv.log
//启动Broker
nohup sh bin/mqbroker -n localhost:9876 &
//查看日志
tail -f ~/logs/rocketmqlogs/broker.log
//关闭Nameserver
sh bin/mqshutdown namesrv
//关闭Broker
sh bin/mqshutdown broker
//jps查看进程号
先cd / 回到根目录下
再输入命令:jps
关闭jar(强制杀死进程):kill -9 进程号
//发送与接受消息测试(linux端)
//发送消息(bin目录下)
export NAMESRV_ADDR=localhost:9876
sh bin/tools.sh org.apache.rocketmq.example.quickstart.Producer
//接收消息(bin目录下)
export NAMESRV_ADDR=localhost:9876
sh bin/tools.sh org.apache.rocketmq.example.quickstart.Consumer


RocketMq可视化监控平台搭建
https://github.com/apache/rocketmq-dashboard
或者直接下载zip然后上传到服务器,我这里还是放到/usr/local下
//解压
unzip rocketmq-externals-master.zip
然后进入cd /rocketmq-externals-master/rocketmq-console
注意:打包前在rocketmq-console中/src/main/resources/application.properties配置namesrv集群地址:
#这里将默认的8080改成19876了
server.port=19876
#这里是指定Nameserv,也可以不指定,在前端控制台进行指定
rocketmq.config.namesrvAddr=服务器1IP:9876;服务器2IP:9876
#这里设置为true,配合users.properties使用,设置登陆账号密码
rocketmq.config.loginRequired=true
# 切换到控制台目录
cd rocketmq-console
//然后编译打包(跳过测试打包)
mvn clean package -Dmaven.test.skip=true
然后 cd target/ 执行运行jar( 端口默认8080) nohup java -jar rocketmq-console-ng-1.0.0.jar --server.port=19876 &
进入cd /usr/local/rocketmq-externals-master/rocketmq-dashboard-master
然后 cd target/ 执行运行jar( 端口默认8080) nohup java -jar rocketmq-dashboard-2.0.0.jar --server.port=19876 &
关闭jar(强制杀死进程):kill -9 进程号

 

端口开启防火墙
netstat -an|grep 8080
firewall-cmd --zone=public --list-ports
firewall-cmd --zone=public --add-port=8081/tcp --permanent
firewall-cmd --reload

 

上一篇:RocketMQ 原理:消息存储、高可用、消息重试、消息幂等性


下一篇:ERROR in ch.qos.logback.core.joran.spi.Interpreter@73:41 - no applicable action for [AppenderRef], c