Nicky-
The two instances are sharing a data folder, and ActiveMQ is treating the first
broker that obtains the lock as the primary and the second as the failover (aka
slave).
You’ll need to configure the <broker … dataDirectory="${activemq.data}”
settings to be different directories.
-Matt
> On Mar 20, 2020, at 4:29 AM, nicky romina <[email protected]> wrote:
>
> I have 2 amq brokers as amq1 and amq2. I have configured amq1 as with below
> configurations;
>
>
> <networkConnectors>
> <networkConnector uri="static:(failover:(tcp://localhost:61616))"
> dynamicOnly="true"
> networkTTL="2"
> duplex="true" />
> </networkConnectors>
>
> and the transport connector as;
>
> <transportConnector name="openwire" rebalanceClusterClients="true"
> updateClusterClients="true" updateClusterClientsOnRemove="true"
> uri="tcp://0.0.0.0:61626?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/>
>
>
> In am2 I have add the following configuration;
> <networkConnectors>
> <networkConnector uri="static:(failover:(tcp://localhost:61626))"
> dynamicOnly="true"
> networkTTL="2"
> duplex="true" />
> </networkConnectors>
>
>
> But still when I start the two servers one after other, the first starting
> broker starts and returns an error as *Failed to connect to
> [tcp://localhost:61626] after: 20 attempt(s) continuing to retry*.
>
> The second starting server returns When I start the server one after the
> other, second broker returns *Database /tmp/mq/kahadb/lock is locked by
> another server. This broker is now in slave mode waiting a lock to be
> acquired*
>
> How to fix this issue? or is there anything I have missed or incorrect
> configuration in my code?
>
> see the link I have posted on stakoverflow:
> https://stackoverflow.com/questions/60769034/connection-failed-between-activemq-brokers
> <https://stackoverflow.com/questions/60769034/connection-failed-between-activemq-brokers>
>
>
>
>
>
> --
> Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html