You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Pippo <sh...@optier.com> on 2012/06/22 13:18:12 UTC

Adding nodes to Cluster without restarting

List,

I have a network of brokers, consisting of two nodes.
The Connectors elements were defined like this (on both nodes):

/<networkConnectors>
  <networkConnector name="nc-failover"
      uri="static:(tcp://amq1:61616,tcp://amq2:61616)"
      decreaseNetworkConsumerPriority="true"
      networkTTL="1" />
</networkConnectors>
:
<transportConnectors>
  <transportConnector name="openwire"
      uri="tcp://0.0.0.0:61616"
      updateClusterClients="true"
      rebalanceClusterClients="true"
      updateClusterClientsOnRemove=”true”/>
</transportConnectors>/

This configuration allows me to stop/start one of the brokers in the
cluster, and all clients are aware of the change.
But now I want to add a third broker to the cluster WITHOUT having to
restart the other nodes.
Is it possible?
How should I configure the networkConnectors on the third broker to allow
this?
Remember – NO RESTARTS of other brokers are allowed.

Thanks in advance!


--
View this message in context: http://activemq.2283324.n4.nabble.com/Adding-nodes-to-Cluster-without-restarting-tp4653478.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Adding nodes to Cluster without restarting

Posted by Gary Tully <ga...@gmail.com>.
It is a junit test case. Have a look at the code to see how it sets up
brokers and
validates connection/reconnection and rebalance.

if you download the activemq trunk source[1] you can modify it at will
and run it with:

mvn clean install -Dtest=FailoverComplexClusterTest

[1] http://activemq.apache.org/source.html

On 26 June 2012 10:49, Pippo <sh...@optier.com> wrote:
> Hi,
>
> I am indeed using ActiveMQ 5.6 with randomize=true on my connection string.
> But not sure if it's the same issue.
>
> What exactly is that test case and how do I use it?
>
> Thanks.
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/Adding-nodes-to-Cluster-without-restarting-tp4653478p4653568.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.



-- 
http://fusesource.com
http://blog.garytully.com

Re: Adding nodes to Cluster without restarting

Posted by Pippo <sh...@optier.com>.
Hi,

I am indeed using ActiveMQ 5.6 with randomize=true on my connection string.
But not sure if it's the same issue.

What exactly is that test case and how do I use it?

Thanks.

--
View this message in context: http://activemq.2283324.n4.nabble.com/Adding-nodes-to-Cluster-without-restarting-tp4653478p4653568.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Adding nodes to Cluster without restarting

Posted by Gary Tully <ga...@gmail.com>.
Are you using 5.6, this looks a bit like
https://issues.apache.org/jira/browse/AMQ-3706

The test case attached to that jira may provide a good starting point
for a junit test case for your scenario, that could help reproduce

http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/failover/FailoverComplexClusterTest.java?view=markup


On 22 June 2012 16:32, Pippo <sh...@optier.com> wrote:
> Okay,
>
> So I was able to achieve that by configuring the third broker like this:
>
> /<networkConnectors>
>  <networkConnector name="nc-failover"
>      uri="static:(tcp://amq1:61616,tcp://amq2:61616,tcp://amq3:61616)"
>      decreaseNetworkConsumerPriority="true"
>      networkTTL="1"
>      <b>duplex="true" />*
> </networkConnectors>
> :
> <transportConnectors>
>  <transportConnector name="openwire"
>      uri="tcp://0.0.0.0:61616"
>      updateClusterClients="true"
>      rebalanceClusterClients="true"
>      updateClusterClientsOnRemove="true" />
> </transportConnectors>/
>
> When I bring up the third broker, the clients rebalance themselves among the
> several nodes.
> Now, I want to update the configuration of the first two brokers. So I take
> down one of them and there are times when I see that some of the clients
> reports on a transport error and doesn't reconnect to the remaining brokers.
>
> Does this sound like a bug in ActiveMQ?
>
> Thanks.
>
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/Adding-nodes-to-Cluster-without-restarting-tp4653478p4653491.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.



-- 
http://fusesource.com
http://blog.garytully.com

Re: Adding nodes to Cluster without restarting

Posted by Pippo <sh...@optier.com>.
Okay,

So I was able to achieve that by configuring the third broker like this:

/<networkConnectors>
  <networkConnector name="nc-failover"
      uri="static:(tcp://amq1:61616,tcp://amq2:61616,tcp://amq3:61616)"
      decreaseNetworkConsumerPriority="true"
      networkTTL="1"
      <b>duplex="true" />*
</networkConnectors>
:
<transportConnectors>
  <transportConnector name="openwire"
      uri="tcp://0.0.0.0:61616"
      updateClusterClients="true"
      rebalanceClusterClients="true"
      updateClusterClientsOnRemove="true" />
</transportConnectors>/

When I bring up the third broker, the clients rebalance themselves among the
several nodes.
Now, I want to update the configuration of the first two brokers. So I take
down one of them and there are times when I see that some of the clients
reports on a transport error and doesn't reconnect to the remaining brokers.

Does this sound like a bug in ActiveMQ?

Thanks.


--
View this message in context: http://activemq.2283324.n4.nabble.com/Adding-nodes-to-Cluster-without-restarting-tp4653478p4653491.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.