启动RocketMQ集群后报错:
java.lang.RuntimeException: Lock failed,MQ already started at org.apache.rocketmq.store.DefaultMessageStore.start(DefaultMessageStore.java:214) at org.apache.rocketmq.broker.BrokerController.start(BrokerController.java:827) at org.apache.rocketmq.broker.BrokerStartup.start(BrokerStartup.java:64) at org.apache.rocketmq.broker.BrokerStartup.main(BrokerStartup.java:58)
原因:
学习阶段,我们将Master和Slave共同部署在一台机器上,同时配置的storePath又相同,没有进行区分。
解决:
为从节点创建存储文件
mkdir /usr/local/rocketmq/store-s mkdir /usr/local/rocketmq/store-s/commitlog mkdir /usr/local/rocketmq/store-s/consumequeue mkdir /usr/local/rocketmq/store-s/index
store-s与Master节点用的目录store区分开。
对Slave配置文件进行修改:
#===================storePath主从节点必须分开==================== #存储路径 storePathRootDir=/usr/local/rocketmq/store-s #commitLog 存储路径 storePathCommitLog=/usr/local/rocketmq/store-s/commitlog #消费队列存储路径存储路径 storePathConsumeQueue=/usr/local/rocketmq/store-s/consumequeue #消息索引存储路径 storePathIndex=/usr/local/rocketmq/store-s/index #checkpoint 文件存储路径 storeCheckpoint=/usr/local/rocketmq/store-s/checkpoint #abort 文件存储路径 abortFile=/usr/local/rocketmq/store-s/abort #===================storePath主从节点必须分开====================
以上问题解决。
本文仅供个人学习使用,如有不足或错误欢迎指正!
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)