Pure Master SlaveThis feature has been deprecated and will be removed in version 5.8 This feature will be removed in 5.8 as it has not evolved to be production ready. A Pure Master Slave configuration provides a basic shared nothing, fully replicated topology which does not depend on a shared file system or shared database. How Pure Master Slave works
failover://(tcp://masterhost:61616,tcp://slavehost:61616)?randomize=false The randomize property just disables randomness so that the transport will always try the master first, then the slave if it can't connect to that. Note that the slave does not accept connections until it becomes the master Limitations of Pure Master Slave
Recovering a Pure Master Slave topologyThis is a manual process - once a master has failed, the only sure way to ensure that the toplogy is synchronized again is manually:
Configuring Pure Master SlaveYou should not configure a connection between the master and a slave. The connection is automatically established with the slave's configuration. If you explicitly configure a network connection, you may encounter race conditions when the master broker is under heavy load. A master broker doesn't need any special configuration - it's a normal broker until a slave broker attaches itself.
<broker masterConnectorURI="tcp://masterhost:62001" shutdownOnMasterFailure="false">
<persistenceAdapter>
<journaledJDBC journalLogFiles="5" dataDirectory="${activemq.base}/data/broker2" />
</persistenceAdapter>
<transportConnectors>
<transportConnector uri="tcp://slavehost:61616"/>
</transportConnectors>
</broker>
Configuring the authentication of the SlaveIn ActiveMQ 4.1 or later you can use a <masterConnector/> element as an alternative XML configuration mechanism as shown in the following example to configure the user and password that the slave will use to connect to the master
<broker brokerName="slave" useJmx="false" deleteAllMessagesOnStartup="true" xmlns="http://activemq.apache.org/schema/core">
<services>
<masterConnector remoteURI= "tcp://localhost:62001" userName="James" password="Cheese"/>
</services>
<transportConnectors>
<transportConnector uri="tcp://localhost:62002"/>
</transportConnectors>
</broker>
|