rocketmq icon indicating copy to clipboard operation
rocketmq copied to clipboard

RocketMQ 2m2s startup problem

Open ltyeamin opened this issue 7 years ago • 25 comments

The issue tracker is ONLY used for bug report(feature request need to follow RIP process). Keep in mind, please check whether there is an existing same report before your raise a new one.

Alternately (especially if your communication is not a bug report), you can send mail to our mailing lists. We welcome any friendly suggestions, bug fixes, collaboration and other improvements.

Please ensure that your bug report is clear and that it is complete. Otherwise, we may be unable to understand it or to reproduce it, either of which would prevent us from fixing the bug. We strongly recommend the report(bug report or feature request) could include some hints as the following:

BUG REPORT

  1. Please describe the issue you observed: 我配置了双主双从同步模式下的master1,默认两个namesrv都已经启动,准备开始启动第一个master broker broker-a.properties配置文件如下: #所属集群名字 brokerClusterName=rocketmq-cluster #broker名字,注意此处不同的配置文件填写的不一样 brokerName=broker-a #0 表示 Master,>0 表示 Slave brokerId=0 #nameServer地址,分号分割 namesrvAddr=192.168.5.100:9876;192.168.5.101:9876 #在发送消息时,自动创建服务器不存在的topic,默认创建的队列数 defaultTopicQueueNums=4 #是否允许 Broker 自动创建Topic,建议线下开启,线上关闭 autoCreateTopicEnable=true #是否允许 Broker 自动创建订阅组,建议线下开启,线上关闭 autoCreateSubscriptionGroup=true #Broker 对外服务的监听端口 listenPort=10911 #删除文件时间点,默认凌晨 4点 deleteWhen=04 #文件保留时间,默认 48 小时 fileReservedTime=120 #commitLog每个文件的大小默认1G mappedFileSizeCommitLog=1073741824 #ConsumeQueue每个文件默认存30W条,根据业务情况调整 #mapedFileSizeConsumeQueue=300000 mappedFileSizeConsumeQueue=6000000 destroyMapedFileIntervalForcibly=120000 #redeleteHangedFileInterval=120000 #检测物理文件磁盘空间 diskMaxUsedSpaceRatio=88 #存储路径 storePathRootDir=/usr/local/bin/rocketmq-all-4.5.2-bin-release/store #commitLog 存储路径 storePathCommitLog=/usr/local/bin/rocketmq-all-4.5.2-bin-release/store/commitlog #消费队列存储路径存储路径 storePathConsumeQueue=/usr/local/bin/rocketmq-all-4.5.2-bin-release/store/consumequeue #消息索引存储路径 storePathIndex=/usr/local/bin/rocketmq-all-4.5.2-bin-release/store/index #checkpoint 文件存储路径 storeCheckpoint=/usr/local/bin/rocketmq-all-4.5.2-bin-release/store/checkpoint #abort 文件存储路径 abortFile=/usr/local/bin/rocketmq-all-4.5.2-bin-release/store/abort #限制的消息大小 maxMessageSize=65536 #flushCommitLogLeastPages=4 #flushConsumeQueueLeastPages=2 #flushCommitLogThoroughInterval=10000 #flushConsumeQueueThoroughInterval=60000 #Broker 的角色 #- ASYNC_MASTER 异步复制Master #- SYNC_MASTER 同步双写Master #- SLAVE brokerRole=SYNC_MASTER #刷盘方式 #- ASYNC_FLUSH 异步刷盘 #- SYNC_FLUSH 同步刷盘 flushDiskType=SYNC_FLUSH #checkTransactionMessageEnable=false #发消息线程池数量 #sendMessageThreadPoolNums=128 #拉消息线程池数量 #pullMessageThreadPoolNums=128

开始启动: nohup sh mqbroker -c /usr/local/bin/rocketmq-all-4.5.2-bin-release/conf/2m-2s-sync/broker-a.properties &

执行上述命令后,无法启动broker-a:

找到日志: 2019-11-24 01:19:42 INFO main - warmMapedFileEnable=false 2019-11-24 01:19:42 INFO main - offsetCheckInSlave=false 2019-11-24 01:19:42 INFO main - debugLockEnable=false 2019-11-24 01:19:42 INFO main - duplicationEnable=false 2019-11-24 01:19:42 INFO main - diskFallRecorded=true 2019-11-24 01:19:42 INFO main - osPageCacheBusyTimeOutMills=1000 2019-11-24 01:19:42 INFO main - defaultQueryMaxNum=32 2019-11-24 01:19:42 INFO main - transientStorePoolEnable=false 2019-11-24 01:19:42 INFO main - transientStorePoolSize=5 2019-11-24 01:19:42 INFO main - fastFailIfNoBufferInStorePool=false 2019-11-24 01:19:42 INFO main - enableDLegerCommitLog=false 2019-11-24 01:19:42 INFO main - dLegerGroup= 2019-11-24 01:19:42 INFO main - dLegerPeers= 2019-11-24 01:19:42 INFO main - dLegerSelfId= 2019-11-24 01:19:42 INFO main - load /usr/local/bin/rocketmq-all-4.5.2-bin-release/store/config/consumerOffset.json OK 2019-11-24 01:19:42 INFO main - load /usr/local/bin/rocketmq-all-4.5.2-bin-release/store/config/consumerFilter.json OK 2019-11-24 01:19:42 INFO main - Try to start service thread:AllocateMappedFileService started:false lastThread:null 2019-11-24 01:19:42 INFO main - Try to shutdown service thread:AllocateMappedFileService started:true lastThread:Thread[AllocateMappedFileService,5,main] 2019-11-24 01:19:42 INFO main - shutdown thread AllocateMappedFileService interrupt true 2019-11-24 01:19:42 INFO main - join thread AllocateMappedFileService elapsed time(ms) 1 90000 2019-11-24 01:19:42 INFO main - Try to shutdown service thread:PullRequestHoldService started:false lastThread:null

最后的日志感觉由点问题,找了好多资料,没把这个问题解决掉,请问我是哪里配置不对吗? 2. Please tell us about your environment:

RocketMQ 4.5.2 Release版 + JDK8

  1. Other information (e.g. detailed explanation, logs, related issues, suggestions how to fix, etc):

FEATURE REQUEST

  1. Please describe the feature you are requesting.

  2. Provide any additional detail on your proposed use case for this feature.

  3. Indicate the importance of this issue to you (blocker, must-have, should-have, nice-to-have). Are you currently using any workarounds to address this issue?

  4. If there are some sub-tasks using -[] for each subtask and create a corresponding issue to map to the sub task:

ltyeamin avatar Nov 23 '19 09:11 ltyeamin

conf/2m-2s-sync/broker-a.properties

ltyeamin avatar Nov 23 '19 09:11 ltyeamin

主要是刚启动起来,然后就自动退出

ltyeamin avatar Nov 23 '19 12:11 ltyeamin

@ltyeamin 启动命令可以发一下吗?有没有其他的一些core 文件,一起看下。

duhenglucky avatar Nov 25 '19 01:11 duhenglucky

解决了吗? 和你一样的问题

yuxiaok avatar Jan 11 '20 09:01 yuxiaok

I found this problem too.And I know how about it. I copy the broker-a.properties from web community. My rocketmq version is 4.7.0.And if I add the custom store dir in broker-a.properties .The broker can't start well.It will have the same problem . So I delete the custom store dir ,It can start well. I will debug how the broker start for knowing the real reason which focus broker start fail.

GongZhengMe avatar Apr 09 '20 03:04 GongZhengMe

Please turn off the firewall of the primary and secondary nodes

yuxiaok avatar Apr 09 '20 03:04 yuxiaok

Please turn off the firewall of the primary and secondary nodes

I am really sure I turn off the firewall at my linux machines of rocketMQ.And if I config the custom rocketmq store ,broker can't start.

GongZhengMe avatar Apr 09 '20 07:04 GongZhengMe

Please turn off the firewall of the primary and secondary nodes

I am really sure I turn off the firewall at my linux machines of rocketMQ.And if I config the custom rocketmq store ,broker can't start.

Check the properties configuration file to see if there is any extra space after value

yuxiaok avatar Apr 10 '20 06:04 yuxiaok

I found this problem too.And I know how about it. I copy the broker-a.properties from web community. My rocketmq version is 4.7.0.And if I add the custom store dir in broker-a.properties .The broker can't start well.It will have the same problem . So I delete the custom store dir ,It can start well. I will debug how the broker start for knowing the real reason which focus broker start fail.

I also encountered the same problem as you. After deleting the storage path, the whole cluster can be used normally, but this is not what I want. After adding the storage directory, do you have any good ways

huoshenyingmu avatar Jul 30 '20 09:07 huoshenyingmu

I found this problem too.And I know how about it. I copy the broker-a.properties from web community. My rocketmq version is 4.7.0.And if I add the custom store dir in broker-a.properties .The broker can't start well.It will have the same problem . So I delete the custom store dir ,It can start well. I will debug how the broker start for knowing the real reason which focus broker start fail.

I also encountered the same problem as you. I use the version 4.7.1(mq) and version 1.8(jdk). After comment the storage path, the whold cluster can be used normally. I will try other mq version.

GenshinImpactRailgun avatar Aug 13 '20 01:08 GenshinImpactRailgun

why this issue closed, we meet the same problem. Can anyone help us?

wz2cool avatar Nov 27 '20 03:11 wz2cool

@wz2cool ping

duhenglucky avatar Nov 30 '20 16:11 duhenglucky

@wz2cool ping

We reinstall it, everything works well...

wz2cool avatar Dec 01 '20 05:12 wz2cool

@wz2cool ping

We reinstall it, everything works well...

could you provide more information about your resolve method,maybe more users also faced this issue,and we also want to know more details about this issue, thanks :)

duhenglucky avatar Dec 04 '20 01:12 duhenglucky

@wz2cool ping

We reinstall it, everything works well...

could you provide more information about your resolve method,maybe more users also faced this issue,and we also want to know more details about this issue, thanks :)

Sadly, we couldn't provide more info because we got same log. Could you log more detail if something is wrong, Cannot find any error detail but find "shutdown service" info. image

wz2cool avatar Dec 06 '20 01:12 wz2cool

一模一样的问题。4.8.0也是。主要是上次关闭broker时无法正常关闭导致的。 可以查看store.log日志,大概率是启动时加载日志文件异常了。目前也没找到解决办法,除非删除这个问题。哎。。。

2021-02-23 12:48:53 ERROR AllocateMappedFileService - Failed to map file /app/rocketmq/store/commitlog-am/00000000001073741824 java.io.IOException: Map failed at sun.nio.ch.FileChannelImpl.map(FileChannelImpl.java:940) ~[na:1.8.0_162] at org.apache.rocketmq.store.MappedFile.init(MappedFile.java:162) [rocketmq-store-4.8.0.jar:4.8.0] at org.apache.rocketmq.store.MappedFile.<init>(MappedFile.java:72) [rocketmq-store-4.8.0.jar:4.8.0] at org.apache.rocketmq.store.AllocateMappedFileService.mmapOperation(AllocateMappedFileService.java:176) [rocketmq-store-4.8.0.jar:4.8.0] at org.apache.rocketmq.store.AllocateMappedFileService.run(AllocateMappedFileService.java:137) [rocketmq-store-4.8.0.jar:4.8.0] at java.lang.Thread.run(Thread.java:748) [na:1.8.0_162] Caused by: java.lang.OutOfMemoryError: Map failed at sun.nio.ch.FileChannelImpl.map0(Native Method) ~[na:1.8.0_162] at sun.nio.ch.FileChannelImpl.map(FileChannelImpl.java:937) ~[na:1.8.0_162] ... 5 common frames omitted

eoc2015 avatar Feb 23 '21 04:02 eoc2015

问题解决了吗 同样的问题,一直找不到原因,一点报错都没提示

wuxingwang1997 avatar May 26 '21 09:05 wuxingwang1997

一模一样的问题。4.8.0也是。主要是上次关闭broker时无法正常关闭导致的。 可以查看store.log日志,大概率是启动时加载日志文件异常了。目前也没找到解决办法,除非删除这个问题。哎。。。

2021-02-23 12:48:53 ERROR AllocateMappedFileService - Failed to map file /app/rocketmq/store/commitlog-am/00000000001073741824 java.io.IOException: Map failed at sun.nio.ch.FileChannelImpl.map(FileChannelImpl.java:940) ~[na:1.8.0_162] at org.apache.rocketmq.store.MappedFile.init(MappedFile.java:162) [rocketmq-store-4.8.0.jar:4.8.0] at org.apache.rocketmq.store.MappedFile.<init>(MappedFile.java:72) [rocketmq-store-4.8.0.jar:4.8.0] at org.apache.rocketmq.store.AllocateMappedFileService.mmapOperation(AllocateMappedFileService.java:176) [rocketmq-store-4.8.0.jar:4.8.0] at org.apache.rocketmq.store.AllocateMappedFileService.run(AllocateMappedFileService.java:137) [rocketmq-store-4.8.0.jar:4.8.0] at java.lang.Thread.run(Thread.java:748) [na:1.8.0_162] Caused by: java.lang.OutOfMemoryError: Map failed at sun.nio.ch.FileChannelImpl.map0(Native Method) ~[na:1.8.0_162] at sun.nio.ch.FileChannelImpl.map(FileChannelImpl.java:937) ~[na:1.8.0_162] ... 5 common frames omitted

先执行下bin 下面的os.sh 文件,然后重新加载试下,启动的时候在日志里面搜一下abnormal 启动还是nornal 启动,另外看下ulimit -v 的设置

duhenglucky avatar Jun 06 '21 00:06 duhenglucky

问题解决了吗 同样的问题,一直找不到原因,一点报错都没提示

你的 store 目录下的 commitlog 大约有多少个?

duhenglucky avatar Jun 06 '21 00:06 duhenglucky

首先看下是不是内存配置过大了,其次有可能 abort、checkpoint是文件来的,但创建成了目录,导致一直启动失败,这2个文件系统会自动创建。

commitlog、consumequeue、index是目录,config是目录,但config自动创建的

caoyaxing221 avatar Jul 01 '21 09:07 caoyaxing221