You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Jodi Moran <Jo...@betfair.com> on 2007/10/29 17:31:18 UTC

Configuring a network of master/slave pairs

Hi all,

I am trying to set up a simple network of two logical brokers, say A and
B, in which each logical broker is a (JDBC) master/slave pair, say A1 &
A2 and B1 & B2. I need to send messages only from A to B (and not B to
A): producers are connected to A and consumers are connected to B. I
want to use "static:" discovery for the network, since A and B will be
in separate data centres.

Originally I tried the following configuration for the network connector
in A1 & A2:
        <networkConnectors>
            <networkConnector name="bridge"
 
uri="static:failover://(tcp://B1_host:B1_port,tcp://B2_host:B2_port)"/>
        </networkConnectors>
This worked correctly at first: the A master connected to the B master,
and messages were delivered from the producers on A to the consumers on
B. When I killed the B master to cause a failover, the B slave became
the new master, the consumers reconnected to the new B master, and a
connection was established between the A master and the new B master.
However, messages were no longer delivered from A to B over the network
connector. 

Noting that this issue:
https://issues.apache.org/activemq/browse/AMQ-734
seems to indicate that the "failover:" transport shouldn't be used with
a network connector, I also tried the following configuration for the
network connector:
        <networkConnectors>
            <networkConnector name="bridge"
 
uri="static://(tcp://B1_host:B1_port,tcp://B2_host:B2_port)"/>
        </networkConnectors>
This configuration works correctly on first boot and also after a
failover (consumers continue to receive messages), except that there
seem to be duplicate messages delivered to some consumers after a
failover. Also, since B1 and B2 are never simultaneously available
(being a master-slave pair), and since this configuration causes the A
master to continuously attempt to connect to both B1 and B2, the A
master's logs are filled with exceptions -- so this would also seem not
to be the correct configuration for my scenario. 

Does anyone know the recommended configuration for creating a network of
master/slave pairs using static discovery? It should be possible
according to these threads:
http://www.nabble.com/Network-of-brokers-tf2546736s2354.html#a8006018
http://www.nabble.com/Master-Slave-and-Network-of-Brokers-tf1790842s2354
.html#a4879091

Many thanks,

-- 
Jodi Moran
Distributed Systems Engineer
Frameworks Team 

Betfair. A Different Kind of Betting Company.
Please consider the environment before printing
Betfair Limited | Winslow Road | Hammersmith Embankment | London | W6
9HP
Registered in England and Wales under company number 5140986

The information in this e-mail and any attachment is confidential and is
intended only for the named recipient(s). The e-mail may not be
disclosed or used by any person other than the addressee, nor may it be
copied in any way. If you are not a named recipient please notify the
sender immediately and delete any copies of this message. Any
unauthorized copying, disclosure or distribution of the material in this
e-mail is strictly forbidden. Any view or opinions presented are solely
those of the author and do not necessarily represent those of the
company. Betfair (r) and the BETFAIR LOGO are registered trade marks of
The Sporting Exchange Limited.




________________________________________________________________________
In order to protect our email recipients, Betfair Group use SkyScan from 
MessageLabs to scan all Incoming and Outgoing mail for viruses.

________________________________________________________________________

RE: Configuring a network of master/slave pairs

Posted by Jodi Moran <Jo...@betfair.com>.
Hi Joe,

> The static:// scheme for the brokers should be the right approach. You
can
> disable the 'WARN' reconnect messages  by changing the severity level,
in
> the log4j.properties file, from INFO to ERROR like this.
> 
> log4j.rootLogger=ERROR, stdout, out

Thanks for your reply. I know how to switch logging levels to hide
errors (the configuration I described produces log messages at ERROR
level, not just at WARN). I am more concerned that the ERROR message may
indicate that the network connector is not intended to work with a pair
of master/slave brokers, and thus that I may see further problems after
more extensive tests.

> Not sure what could be happening w/those dup's. Are you by any chance
using
> durable subscriptions?

I am using queues at the moment, not topics.

Have you been using a network connector with master/slave pairs in a
production scenario? Have you found any problems with this?

Thanks,

	Jodi



________________________________________________________________________
In order to protect our email recipients, Betfair Group use SkyScan from 
MessageLabs to scan all Incoming and Outgoing mail for viruses.

________________________________________________________________________

Re: Configuring a network of master/slave pairs

Posted by ttmdev <jo...@ttmsolutions.com>.
Yup, the failover:// scheme is used for clients. You may want to consider
setting 'randomize' to false because you always want your clients to try and
connect to the master first. For example,

failover:(tcp://masterhost:61616,tcp://slavehost:61616)?randomize=false

The static:// scheme for the brokers should be the right approach. You can
disable the 'WARN' reconnect messages  by changing the severity level, in
the log4j.properties file, from INFO to ERROR like this. 

log4j.rootLogger=ERROR, stdout, out

Not sure what could be happening w/those dup's. Are you by any chance using
durable subscriptions? 

Hope this helps,
Joe


Jodi Moran wrote:
> 
> Hi all,
> 
> I am trying to set up a simple network of two logical brokers, say A and
> B, in which each logical broker is a (JDBC) master/slave pair, say A1 &
> A2 and B1 & B2. I need to send messages only from A to B (and not B to
> A): producers are connected to A and consumers are connected to B. I
> want to use "static:" discovery for the network, since A and B will be
> in separate data centres.
> 
> Originally I tried the following configuration for the network connector
> in A1 & A2:
>         <networkConnectors>
>             <networkConnector name="bridge"
>  
> uri="static:failover://(tcp://B1_host:B1_port,tcp://B2_host:B2_port)"/>
>         </networkConnectors>
> This worked correctly at first: the A master connected to the B master,
> and messages were delivered from the producers on A to the consumers on
> B. When I killed the B master to cause a failover, the B slave became
> the new master, the consumers reconnected to the new B master, and a
> connection was established between the A master and the new B master.
> However, messages were no longer delivered from A to B over the network
> connector. 
> 
> Noting that this issue:
> https://issues.apache.org/activemq/browse/AMQ-734
> seems to indicate that the "failover:" transport shouldn't be used with
> a network connector, I also tried the following configuration for the
> network connector:
>         <networkConnectors>
>             <networkConnector name="bridge"
>  
> uri="static://(tcp://B1_host:B1_port,tcp://B2_host:B2_port)"/>
>         </networkConnectors>
> This configuration works correctly on first boot and also after a
> failover (consumers continue to receive messages), except that there
> seem to be duplicate messages delivered to some consumers after a
> failover. Also, since B1 and B2 are never simultaneously available
> (being a master-slave pair), and since this configuration causes the A
> master to continuously attempt to connect to both B1 and B2, the A
> master's logs are filled with exceptions -- so this would also seem not
> to be the correct configuration for my scenario. 
> 
> Does anyone know the recommended configuration for creating a network of
> master/slave pairs using static discovery? It should be possible
> according to these threads:
> http://www.nabble.com/Network-of-brokers-tf2546736s2354.html#a8006018
> http://www.nabble.com/Master-Slave-and-Network-of-Brokers-tf1790842s2354
> .html#a4879091
> 
> Many thanks,
> 
> -- 
> Jodi Moran
> Distributed Systems Engineer
> Frameworks Team 
> 
> Betfair. A Different Kind of Betting Company.
> Please consider the environment before printing
> Betfair Limited | Winslow Road | Hammersmith Embankment | London | W6
> 9HP
> Registered in England and Wales under company number 5140986
> 
> The information in this e-mail and any attachment is confidential and is
> intended only for the named recipient(s). The e-mail may not be
> disclosed or used by any person other than the addressee, nor may it be
> copied in any way. If you are not a named recipient please notify the
> sender immediately and delete any copies of this message. Any
> unauthorized copying, disclosure or distribution of the material in this
> e-mail is strictly forbidden. Any view or opinions presented are solely
> those of the author and do not necessarily represent those of the
> company. Betfair (r) and the BETFAIR LOGO are registered trade marks of
> The Sporting Exchange Limited.
> 
> 
> 
> 
> ________________________________________________________________________
> In order to protect our email recipients, Betfair Group use SkyScan from 
> MessageLabs to scan all Incoming and Outgoing mail for viruses.
> 
> ________________________________________________________________________
> 
> 

-- 
View this message in context: http://www.nabble.com/Configuring-a-network-of-master-slave-pairs-tf4712893s2354.html#a13473778
Sent from the ActiveMQ - User mailing list archive at Nabble.com.