单机部署
下载
shell
cd /opt/soft/archive
wget https://archive.apache.org/dist/rocketmq/4.9.4/rocketmq-all-4.9.4-bin-release.zip
unzip -d ../ rocketmq-all-4.9.4-bin-release.zip
配置 broker.conf 的brokerIP1 为公网ip
启动命令:
shell
nohup sh bin/mqnamesrv &
nohup sh bin/mqbroker -n localhost:9876 -c conf/broker.conf &
集群部署
shell
nohup sh bin/mqbroker -n '60.205.177.105:9876;60.205.204.171:9876;59.110.152.150:9876;60.205.203.101:9876;' -c /opt/rocketmq-4.9.3/conf/2m-2s-async/broker-a.properties &
nohup sh bin/mqbroker -n '60.205.177.105:9876;60.205.204.171:9876;59.110.152.150:9876;60.205.203.101:9876;' -c /opt/rocketmq-4.9.3/conf/2m-2s-async/broker-a-s.properties &
nohup sh bin/mqbroker -n '60.205.177.105:9876;60.205.204.171:9876;59.110.152.150:9876;60.205.203.101:9876;' -c /opt/rocketmq-4.9.3/conf/2m-2s-async/broker-b.properties &
nohup sh bin/mqbroker -n '60.205.177.105:9876;60.205.204.171:9876;59.110.152.150:9876;60.205.203.101:9876;' -c /opt/rocketmq-4.9.3/conf/2m-2s-async/broker-b-s.properties &
查看集群状态
shell
sh mqadmin clusterList -n localhost:9876
基准测试
benchmark目录下
shell
sh producer.sh -t xxx -n localhost:9876
sh consumer.sh -t xxx -n localhost:9876