问题1:使用源码包编译,启动namesvr,无法启动。解决:改成下载其rocketmq-all-4.7.0-bin-release.zip解压后执行启动命令即可。
问题2:启动broker,[root@cent7-zuoys bin]# sh mqbroker -n localhost:9876 &时,报错:
/usr/local/rocketmq-all-4.7.0-bin-release/bin/runbroker.sh: 行 90: 9898 已杀死 $JAVA ${JAVA_OPT} $@
解决:
将runbroker.sh的第一个JAVA_OPT改成JAVA_OPT="${JAVA_OPT} -server -Xms256m -Xmx256m -Xmn128m" 将runserver.sh的第一个JAVA_OPT改成JAVA_OPT="${JAVA_OPT} -server -Xms128m -Xmx256m -Xmn256m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=320m"
修改原因:默认配置文件初始内存设置的太大了,导致内存居高不下,修改后重新启动namesrv和broker即可,此时系统内存占有率正常。
问题3:安装 rocket mq 后,启动namesrver, broker 后,使用官方给出的例子,运行报错
Exception in thread "main" org.apache.rocketmq.remoting.exception.RemotingTooMuchRequestException: sendDefaultImpl call timeout at org.apache.rocketmq.client.impl.producer.DefaultMQProducerImpl.sendDefaultImpl(DefaultMQProducerImpl.java:666) at org.apache.rocketmq.client.impl.producer.DefaultMQProducerImpl.send(DefaultMQProducerImpl.java:1342) at org.apache.rocketmq.client.impl.producer.DefaultMQProducerImpl.send(DefaultMQProducerImpl.java:1288) at org.apache.rocketmq.client.producer.DefaultMQProducer.send(DefaultMQProducer.java:324) at com.ebc.SyncProducer.main(SyncProducer.java:28)
解决:
1)、vim conf/broker.conf
brokerClusterName = DefaultCluster brokerName = broker-a brokerId = 0 deleteWhen = 04 fileReservedTime = 48 brokerRole = ASYNC_MASTER flushDiskType = ASYNC_FLUSH --新增 brokerIP1=192.168.163.131
2)、启动
nohup sh bin/mqnamesrv -n "192.168.163.131:9876" & nohup sh bin/mqbroker -n localhost:9876 -c conf/broker.conf autoCreateTopicEnable=true &