雲環境安裝使用rocketmq遇到的問題集

1.啓動mqnamesrv和mqbroker報 jvm沒法啓動apache

解決:我用的是jdk9,不知道是否是沒有很好兼容jdk9的緣由,吧jdk換成jdk8就ok了。centos

 

2.啓動後 broker 沒法正常啓動,報如下下錯誤bash

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

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

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

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

兩個文件最大啓動內存相加不要超過 機器的內存,不然mqbroker會一直沒法正常啓動server

 

3.本地報錯顯示Caused by: org.apache.rocketmq.remoting.exception.RemotingConnectException: connect to <10.19.73.64:10911> failedip

官網解決方案:內存

第一步 進去 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
相關文章
相關標籤/搜索