一起学习rocketmq安装:
Linux下RocketMQ单机安装
1、优化
主机名、防火墙关闭、tcp优化等
2、jdk安装(1.8)
wget ftp://10.249.100.249/pub/jdk/jdk8/*
3、Maven 3.0.5
打包过程省了,开发给我打包好
4、下载rocketmq
wget https://github.com/apache/rocketmq/archive/rocketmq-all-4.2.0.tar.gz
5、环境变量
vi /etc/profile
export rocketmq=/usr/local/rocketmq-4-3-0
export PATH=$PATH:$rocketmq/bin
source /etc/profile
6、启动mqnameserver
配置内存
/usr/local/rocketmq-4-3-0/bin
runserver.sh
runbroker.sh
测试环境给1g即可
/usr/local/rocketmq-4-3-0/usr/local/rocketmq-4-3-0/bin目录下
cd /var/log/
touch rocketmq.log
nohup sh mqnamesrv > /var/log/rocketmq.log 2>&1 &
nohup: ignoring input
Java HotSpot(TM) 64-Bit Server VM warning: Using the DefNew young collector with the CMS collector is deprecated and will likely be removed in a future release
Java HotSpot(TM) 64-Bit Server VM warning: UseCMSCompactAtFullCollection is deprecated and will likely be removed in a future release.
The Name Server boot success. serializeType=JSON
7、启动mqbroker
启动mqbroker(/usr/local/rocketmq-4-3-0/bin目录下)
nohup sh mqbroker -n localhost:9876 autoCreateTopicEnable=true > /var/log/rocketmq-broker.log 2>&1 &
注意:localhost可以换成你刚才启动mqnamesrv的ip
[root@ip-10-101-200-47 bin]# jps
25105 BrokerStartup
25045 NamesrvStartup
25158 Jps
8、维护
关闭服务器与启动服务的顺序是相反的
停止broker
sh mqshutdown broker
停止namerserver
sh mqshutdown namesrv
[root@ip-10-101-200-47 bin]# sh mqshutdown broker
The mqbroker(25105) is running...
Send shutdown request to mqbroker(25105) OK
[root@ip-10-101-200-47 bin]# sh mqshutdown namesrv
The mqnamesrv(25045) is running...
Send shutdown request to mqnamesrv(25045) OK
[2] Exit 143 nohup sh mqbroker -n localhost:9876 autoCreateTopicEnable=true > /var/log/rocketmq-broker.log 2>&1
9、图形界面上传启动
nohup java -jar rocketmq-console-ng-1.0.0.jar > /var/log/rocketmq-console-ng 2>&1 &
http://10.101.200.47:8080/#/
10、监控上传启动
nohup java -jar zipkin.jar > /var/log/zipkin.log 2>&1 &
http://10.101.200.47:9411/zipkin/
================================
常用命令参考文档https://blog.csdn.net/varyall/article/details/79630037
首先进入 RocketMQ 工程,进入/RocketMQ/bin 在该目录下有个 mqadmin 脚本 .
查看帮助: 在 mqadmin 下可以查看有哪些命令
查看具体命令的使用
sh mqadmin
命令名称
sh mqadmin help
查看 updateTopic 的使用
sh mqadmin help updateTopic
关闭nameserver和所有的broker:
进入到bin下:
sh mqshutdown namesrv
sh mqshutdown broker
查看所有消费组group:
sh mqadmin consumerProgress -n 10.101.200.47:9876
查看指定消费组下的所有topic数据堆积情况:
sh mqadmin consumerProgress -n 10.101.200.47:9876 -g warning-group
查看所有topic :
sh mqadmin topicList -n 10.101.200.47:9876
查看topic信息列表详情统计
sh mqadmin topicstatus -n 10.101.200.47:9876 -t topicWarning
新增topic
sh mqadmin updateTopic –n 10.101.200.47:9876 –c DefaultCluster –t topicWarning
删除topic
sh mqadmin deleteTopic –n 10.101.200.47:9876 –c DefaultCluster –t topicWarning
查询集群消息
sh mqadmin clusterList -n 10.101.200.47:9876
====================================
Copyright © 2024 妖气游戏网 www.17u1u.com All Rights Reserved