You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by An...@attensity.com on 2010/06/14 17:22:07 UTC

Pure Master / Slave - start order

Hi,

in a cluster szenario we run a distributed application containing
ActiveMQ. We configure a pure master/slave, with one cluster host as
ActiveMQ master (waitForSlave="true") and another one as slave. All
cluster nodes are started simultaneous (more or less, not really
predictable).

Now, when slave node starts before master node, slave node (activemq)
gives an error that it can't connect to master. ("MasterConnector:
Failed to start network bridge...")
Even if master starts just a few seconds after the slave, this error
occurs.

This also causes the master to hang up, because it waits for the slave.
(We have to set waitForSlave="true" to assure consistency.)

So, is there any way to avoid that the slave node has to be started
first, and the master node has to wait until the slave node comes up? 

My expectation would have been, that the slave is polling for the
master, with retrying that again, if connection fails in the first
attempt (?)

Any ideas?

Best Regards,
 Andreas






AW: Pure Master / Slave - start order

Posted by An...@attensity.com.
Hi Bruce/Joe,

thanks for the information.

Damned, I was so glad to see the start order problem being gone by using
the failover protocol in the masterConnectorURI. 
But unfortunately issue
(https://issues.apache.org/activemq/browse/AMQ-2743) is right, failover
to slave does not work any more after master crash.

I also tried to use the connectionTimeout parameter (without failover
protocol): 
 <broker ...
masterConnectorURI="tcp://master:61616?connectionTimeout=0">

I thought that this could help to let the slave wait until being able to
establish the connection to the master. But same Connection error as
seen in my first posting was thrown immediately on startup.

Any more suggestions about a workaround or a patch?

 Andreas


> On Mon, Jun 14, 2010 at 10:01 AM, Joe Fernandez
> <jo...@ttmsolutions.com> wrote:
> >
> > Well, I just gave it a try myself and it didn't quite do the trick.
With the
> > failover, the slave does wait for the master, and when the master
does
> > start, the two appear to connect okay. However, if you bring down
the
> > master, the slave fails to open up it transports.
> 
> There are a couple of open issues regarding this:
> 
> https://issues.apache.org/activemq/browse/AMQ-2743
> 
> https://issues.apache.org/activemq/browse/AMQ-2765
> 


Re: Pure Master / Slave - start order

Posted by Bruce Snyder <br...@gmail.com>.
On Mon, Jun 14, 2010 at 10:01 AM, Joe Fernandez
<jo...@ttmsolutions.com> wrote:
>
> Well, I just gave it a try myself and it didn't quite do the trick. With the
> failover, the slave does wait for the master, and when the master does
> start, the two appear to connect okay. However, if you bring down the
> master, the slave fails to open up it transports.

There are a couple of open issues regarding this:

https://issues.apache.org/activemq/browse/AMQ-2743

https://issues.apache.org/activemq/browse/AMQ-2765

Bruce
-- 
perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'

ActiveMQ in Action: http://bit.ly/2je6cQ
Blog: http://bruceblog.org/
Twitter: http://twitter.com/brucesnyder

Re: Pure Master / Slave - start order

Posted by Joe Fernandez <jo...@ttmsolutions.com>.
Well, I just gave it a try myself and it didn't quite do the trick. With the
failover, the slave does wait for the master, and when the master does
start, the two appear to connect okay. However, if you bring down the
master, the slave fails to open up it transports. 

Joe


Joe Fernandez wrote:
> 
> Try using a failover connector like this. 
> 
> <broker ... masterConnectorURI="failover://(tcp://master:61616)">
> 
> Joe
> http://www.ttmsolutions.com
> 
> 
> 
> 
> Andreas.Weber wrote:
>> 
>> Hi,
>> 
>> in a cluster szenario we run a distributed application containing
>> ActiveMQ. We configure a pure master/slave, with one cluster host as
>> ActiveMQ master (waitForSlave="true") and another one as slave. All
>> cluster nodes are started simultaneous (more or less, not really
>> predictable).
>> 
>> Now, when slave node starts before master node, slave node (activemq)
>> gives an error that it can't connect to master. ("MasterConnector:
>> Failed to start network bridge...")
>> Even if master starts just a few seconds after the slave, this error
>> occurs.
>> 
>> This also causes the master to hang up, because it waits for the slave.
>> (We have to set waitForSlave="true" to assure consistency.)
>> 
>> So, is there any way to avoid that the slave node has to be started
>> first, and the master node has to wait until the slave node comes up? 
>> 
>> My expectation would have been, that the slave is polling for the
>> master, with retrying that again, if connection fails in the first
>> attempt (?)
>> 
>> Any ideas?
>> 
>> Best Regards,
>>  Andreas
>> 
>> 
>> 
>> 
>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Pure-Master---Slave---start-order-tp28880946p28881460.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Pure Master / Slave - start order

Posted by Joe Fernandez <jo...@ttmsolutions.com>.
Try using a failover connector like this. 

<broker ... masterConnectorURI="failover://(tcp://master:61616)">

Joe
http://www.ttmsolutions.com




Andreas.Weber wrote:
> 
> Hi,
> 
> in a cluster szenario we run a distributed application containing
> ActiveMQ. We configure a pure master/slave, with one cluster host as
> ActiveMQ master (waitForSlave="true") and another one as slave. All
> cluster nodes are started simultaneous (more or less, not really
> predictable).
> 
> Now, when slave node starts before master node, slave node (activemq)
> gives an error that it can't connect to master. ("MasterConnector:
> Failed to start network bridge...")
> Even if master starts just a few seconds after the slave, this error
> occurs.
> 
> This also causes the master to hang up, because it waits for the slave.
> (We have to set waitForSlave="true" to assure consistency.)
> 
> So, is there any way to avoid that the slave node has to be started
> first, and the master node has to wait until the slave node comes up? 
> 
> My expectation would have been, that the slave is polling for the
> master, with retrying that again, if connection fails in the first
> attempt (?)
> 
> Any ideas?
> 
> Best Regards,
>  Andreas
> 
> 
> 
> 
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Pure-Master---Slave---start-order-tp28880946p28881152.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.