You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by slam <st...@memorylane.com> on 2013/07/19 00:49:05 UTC

Re: ActiveMQ Master/slave with MySQLCluster backend

Hi Christian,

In your multi master MySql setup, did you replicate the data?  If not, will
you lose messages if one of the MySql servers that contains messages
failed/shut down?  





--
View this message in context: http://activemq.2283324.n4.nabble.com/ActiveMQ-Master-slave-with-MySQLCluster-backend-tp4341454p4669488.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: ActiveMQ Master/slave with MySQLCluster backend

Posted by slam <st...@memorylane.com>.
Thanks for the reply.  We've tested both settings and we have the following
concerns.  We would like to have a HA setting using master/slave and we want
to find out how to setup HA mysql database correctly.  Please advise.

1) For Federated network of brokers, only one broker will persist messages
when a client is connected to it.  We tested the forward and replay
scenarios and everything works fine.  The only concern is this approach is
not HA because the messages will not be available while the broker is
unavaliable.    According to the documentation on the Activemq site, this
approach is not HA.

2) For master/slave setting, ActiveMQ will not be HA if the shared mysql
database is down.  So, we are trying to setup a master/slave mysql database
environment and connect ActiveMQ similar to Christian's post listed above. 
We've configured mysql database to replicate from master to slave to
guarantee no messages will be lost if mysql master is offline.  However, we
encountered database exceptions when consumers sending acknowledgements to
the broker if we failover from one broker to another.

Caused by: java.io.IOException: Duplicate entry '241' for key 'PRIMARY'
	at
org.apache.activemq.util.IOExceptionSupport.create(IOExceptionSupport.java:45)
	at
org.apache.activemq.store.jdbc.TransactionContext.commit(TransactionContext.java:178)
	at
org.apache.activemq.store.jdbc.JDBCPersistenceAdapter.commitTransaction(JDBCPersistenceAdapter.java:497)
	at
org.apache.activemq.store.memory.MemoryTransactionStore$Tx.commit(MemoryTransactionStore.java:110)
	at
org.apache.activemq.store.memory.MemoryTransactionStore.commit(MemoryTransactionStore.java:259)
	at
org.apache.activemq.transaction.LocalTransaction.commit(LocalTransaction.java:72)
	... 13 more




--
View this message in context: http://activemq.2283324.n4.nabble.com/ActiveMQ-Master-slave-with-MySQLCluster-backend-tp4341454p4669520.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: ActiveMQ Master/slave with MySQLCluster backend

Posted by Christian Posta <ch...@gmail.com>.
You can do federated network of brokers, but in that case you rely on
brokers to share messages between each other in a store-and-forward manner.
With a master/slave set up where you have a broker elected master, and a
slave sitting standby, they end up sharing a mysql database, thus when the
master goes away, the slave takes over from where the master left off.

With version 5.9, however, you can set up the leveldb store to replicate
itself among the participating slaves.

In both cases, you should not lose messages that the broker has ack'd that
it received.




On Thu, Jul 18, 2013 at 6:49 PM, slam <st...@memorylane.com> wrote:

> Hi Christian,
>
> In your multi master MySql setup, did you replicate the data?  If not, will
> you lose messages if one of the MySql servers that contains messages
> failed/shut down?
>
>
>
>
>
> --
> View this message in context:
> http://activemq.2283324.n4.nabble.com/ActiveMQ-Master-slave-with-MySQLCluster-backend-tp4341454p4669488.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>



-- 
*Christian Posta*
http://www.christianposta.com/blog
twitter: @christianposta

Re: ActiveMQ Master/slave with MySQLCluster backend

Posted by Christian Hilgers <Ch...@consol.de>.
Am 19.07.2013 00:49, schrieb slam:
> Hi Christian,
>
> In your multi master MySql setup, did you replicate the data?  If not, will
> you lose messages if one of the MySql servers that contains messages
> failed/shut down?

assuming you did refer to me.

I do not run MySQL replication, like Master-Master or Master-Slave replication
but a MySQL Cluster which is a different thing.

We did not loose messages, we still have strange behaviour but no data loss.

Kind regards

Christian
-- 
Christian Hilgers                  |ConSol*
Tel.   +49-211-339903-83           |Consulting&Solutions Software GmbH
Fax    +49-211-339903-11           |Kanzlerstr. 8, 40472 Duesseldorf
email: Christian.Hilgers@consol.de |WWW: http://www.consol.de