gpt4 book ai didi

mysql - 如何解决activeMQ msyql cluster get Attempting to acquire the Exclusive Lock错误?

转载 作者:行者123 更新时间:2023-11-29 20:15:46 24 4
gpt4 key购买 nike

我想通过msyql配置activeMQ主/从集群。我做什么 :首先创建两个实例配置。

activemq create instanceA
activemq create instanceC

然后修改端口和mysql适配器,instanceA有:

 //conf  
<persistenceAdapter >
<!-- <kahaDB directory="${activemq.data}/kahadb"/> -->
<jdbcPersistenceAdapter dataDirectory="${activemq.data}/kahadb" dataSource="#mysql-ds"/>
</persistenceAdapter>

<transportConnectors>
<!-- DOS protection, limit concurrent connections to 1000 and frame size to 100MB -->
<transportConnector name="openwire" uri="tcp://0.0.0.0:61617?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
<transportConnector name="amqp" uri="amqp://0.0.0.0:5672?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
<transportConnector name="stomp" uri="stomp://0.0.0.0:61613?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
<transportConnector name="mqtt" uri="mqtt://0.0.0.0:1883?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
<transportConnector name="ws" uri="ws://0.0.0.0:61614?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
</transportConnectors>

<bean id="mysql-ds" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
---
</bean>

实例C有:

  --conf
<persistenceAdapter >
<!-- <kahaDB directory="${activemq.data}/kahadb"/> -->
<jdbcPersistenceAdapter dataDirectory="${activemq.data}/kahadb" dataSource="#mysql-ds"/>
</persistenceAdapter>
<transportConnectors>
<!-- DOS protection, limit concurrent connections to 1000 and frame size to 100MB -->
<transportConnector name="openwire" uri="tcp://0.0.0.0:61619?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
<transportConnector name="amqp" uri="amqp://0.0.0.0:5673?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
<transportConnector name="stomp" uri="stomp://0.0.0.0:61615?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
<transportConnector name="mqtt" uri="mqtt://0.0.0.0:1884?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
<transportConnector name="ws" uri="ws://0.0.0.0:61600?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
</transportConnectors>

<bean id="mysql-ds" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
---
</bean>

最后,我启动了instanceC ./instanceC start,工作正常。我启动instanceA ./instanceA start,得到错误:

2016-09-30 18:11:42,612 | INFO  | Attempting to acquire the exclusive lock to become the Master broker | org.apache.activemq.store.jdbc.DefaultDatabaseLocker | main
2016-09-30 18:12:33,760 | INFO | Failed to acquire lock. Sleeping for 10000 milli(s) before trying again... | org.apache.activemq.store.jdbc.DefaultDatabaseLocker | main

如何解决这个问题?

最佳答案

您已完成 =) 该消息意味着实例A 正在正确轮询数据存储上的排他锁。如果关闭实例 C,您将看到实例 A 接管为主实例。

关于mysql - 如何解决activeMQ msyql cluster get Attempting to acquire the Exclusive Lock错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39789265/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com