rocketmq问题

问题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 &

 

参考文档:

https://rocketmq.apache.org/docs/quick-start/

https://www.jianshu.com/p/d8a21ab2c2d3

https://github.com/apache/rocketmq/tree/release-4.7.0/docs/cn

https://liangyuanpeng.github.io/post/2018-11-27-rocketmq%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/

 

posted @ 2020-05-28 17:27  遥远2  阅读(324)  评论(0编辑  收藏  举报