启动时报错Could not find or load main class org.apache.rocketmq.namesrv.NamesrvStartup
失败原因,应该进入到编译后的bin目录上一层执行命令
nohup sh mqnamesrv &
nohup sh mqbroker -n localhost:9876 &
我本地编译后的目录为:
/usr/local/rocketmq-rocketmq-all-4.7.1/distribution/target/rocketmq-4.7.1/rocketmq-4.7.1
而不是/usr/local/rocketmq-rocketmq-all-4.7.1/distribution
查看进程
jps -m
关闭服务:
sh mqshutdown namesrv
sh mqshutdown broker
FAQ:
1.启动broker时会卡顿,因为虚拟机内存和broker配置内存跟不上。
(1)修改内存:vim bin/runbroker.sh
(2)修改内存:vim bin/runServer.sh