云环境安装使用rocketmq遇到的问题集

原创
2018/04/05 19:51
阅读数 1K

1.启动mqnamesrv和mqbroker报 jvm无法启动

解决:我用的是jdk9,不知道是不是没有很好兼容jdk9的原因,吧jdk换成jdk8就ok了。

 

2.启动后 broker 无法正常启动,报以下下错误

  Java HotSpot(TM) 64-Bit Server VM warning: INFO: os::commit_memory(0x00007f85b2000000, 33554432, 0) failed; error=‘Cannot allocate memory‘ (errno=12)

    There is insufficient memory for the Java Runtime Environment to continue. Native memory allocation (mmap) failed to map 33554432 bytes for committing reserved memory.

解决:修改 bin文件下的runserver.sh和 runbroker.sh 

JAVA_OPT="${JAVA_OPT} -server -Xms1g -Xmx1g -Xmn521m"  

两个文件最大启动内存相加不要超过 机器的内存,否则mqbroker会一直无法正常启动

 

3.本地报错显示Caused by: org.apache.rocketmq.remoting.exception.RemotingConnectException: connect to <10.19.73.64:10911> failed

官网解决方案:

第一步 进去 bin文件目录下, 生成broker配置模板文件

sh mqbroker -m > broker.p

第二步 修改生成broker.p配置文件,我的修改如下

namesrvAddr=18.25.42.53:9876
brokerIP1=18.25.42.53
brokerName=localhost
brokerClusterName=DefaultCluster
brokerId=0
autoCreateTopicEnable=true
autoCreateSubscriptionGroup=true
rejectTransactionMessage=false
fetchNamesrvAddrByAddressServer=false
storePathRootDir=/root/store
storePathCommitLog=/root/store/commitlog
flushIntervalCommitLog=1000
flushCommitLogTimed=false
deleteWhen=04
fileReservedTime=72
maxTransferBytesOnMessageInMemory=262144
maxTransferCountOnMessageInMemory=32
maxTransferBytesOnMessageInDisk=65536
maxTransferCountOnMessageInDisk=8
accessMessageInMemoryMaxRatio=40
messageIndexEnable=true
messageIndexSafe=false
haMasterAddress=
brokerRole=ASYNC_MASTER
flushDiskType=ASYNC_FLUSH
cleanFileForciblyEnable=true

第三步 加载修改过的配置文件

nohup sh mqbroker -n 118.25.42.52:9876 -c broker.p  > /usr/local/apache-rocketmq/logs/runbroker.log 2>&1 &

ok、

问题4 RocketMQ报No route info of this topic:异常

 nohup sh mqbroker -n 192.168.180.133:9876 autoCreateTopicEnable=true > ~/logs/rocketmqlogs/broker.log 2>&1 &

如果按照问题3步骤来基本不会出现这个问题, 如果还出现可能是broker没有正常启动

查看broker有没有正常启动  cd到rocket 的 bin文件夹下执行

sh mqadmin clusterList -n 18.25.42.53:9876

出现,则表示正常启动

[root@VM_0_5_centos bin]# sh mqadmin clusterList -n 18.25.42.53:9876
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option PermSize=128m; support was removed in 8.0
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=128m; support was removed in 8.0
#Cluster Name     #Broker Name            #BID  #Addr                  #Version                #InTPS(LOAD)       #OutTPS(LOAD) #PCWait(ms) #Hour #SPACE
DefaultCluster    localhost               0     18.25.42.53:10911     V4_1_0_SNAPSHOT          0.00(0,0ms)         0.00(0,0ms)          0 423034.25 -1.0000

 

展开阅读全文
加载中
点击引领话题📣 发布并加入讨论🔥
0 评论
0 收藏
0
分享
返回顶部
顶部