activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Hilgers <Christian.Hilg...@ConSol.de>
Subject ActiveMQ Master/slave with MySQLCluster backend
Date Mon, 30 Jan 2012 16:11:57 GMT
Hi,

I am trying to setup a redundant ActiveMQ environment using
* ActiveMQ 5.5.1
* MySQL Cluster  5.1.47-ndb-7.1.5-cluster-gpl
* on Solaris 10 zones
* Java:
   Java(TM) SE Runtime Environment (build 1.6.0_27-b07)
   Java HotSpot(TM) Server VM (build 20.2-b06, mixed mode)
* An application deployed in a Glassfish is using the AMQ


The application uses failover connect to select the ActiveMQ master.
This is working as expected. For all further tests we disabled one
ActiveMQ. ActiveMQ 1 and MySQL Node 1 are on the same Solaris Zone.
Same is true for ActiveMQ 2 and MySQL Node 2.

To make it more simple this is the setup used for testing MySQL Failover.
ActiveMQ 1--+--  MySQL Node 1 192.168.1.30
             !
             !----MySQL Node 2 192.168.1.31

MySQL Node 1 and Node 2 are setup as Cluster and I made sure the
tables get created with NDBCLUSTER engine.

We connect to the MySQL Nodes as follows:
   <bean id="mysql-ds" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
     <property name="driverClassName" value="com.mysql.jdbc.Driver"/>
     <property name="url" value="jdbc:mysql://192.168.1.30,192.168.1.31/activemq?relaxAutoCommit=true&amp;autoRe
connect=true&amp;failOverReadOnly=false"/>
     <property name="username" value="XXX"/>
     <property name="password" value="YYY"/>
     <property name="initialSize" value="10"/>
     <property name="maxActive" value="50"/>
     <property name="maxIdle" value="15"/>
     <property name="poolPreparedStatements" value="true"/>
   </bean>


 From http://activemq.apache.org/jdbc-master-slave.html I would expect
that AMQ does a failover from Node 1 to Node 2 instead of doing a restart cycle.

What we see is, AMQ chooses a primary database node and as long as we stop/start
the secondary node, nothing happens. If we stop the primary node, with secondary
running the logs show:
2012-01-30 13:08:25,121 | ERROR | Failed to update database lock: com.mysql.jdbc.exceptions.jdbc4.Communication
sException: Communications link failure

The last packet successfully received from the server was 30,005 milliseconds ago.  The last
packet sent succes
sfully to the server was 6 milliseconds ago. | org.apache.activemq.store.jdbc.DefaultDatabaseLocker
| ActiveMQ
Cleanup Timer
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
...
2012-01-30 13:08:25,125 | INFO  | No longer able to keep the exclusive lock so giving up being
a master | org.a
pache.activemq.store.jdbc.JDBCPersistenceAdapter | ActiveMQ Cleanup Timer
(This is from our 5.6-Snapshot test today, Logs from 5.5.1 look similar)

I did test  with AMQ 5.6 Snapshot from today but no change in behaviour was seen.

We tried with jdbc:mysql:loadbalance://192.168.1.30,192.168.1.31/activemq?... same behaviour.
We tried with adding other parameter or changing existing ones like
* setting maxIdle=0 to force a opening a new connection upon each request.
* adding testOnBorrow=true
* adding "validationQuery" value="select 'test' from dual"
No real improvment was visible.

Searching the web and asking in IRC came to
https://issues.apache.org/jira/browse/AMQ-1780
https://issues.apache.org/jira/browse/AMQ-2497
they do indicate it should work,

whereas https://issues.apache.org/jira/browse/AMQ-2414 sounds more like it cannot
work by design.

I can attach the activemq.xml if wanted or needed, I can provide logfiles and
we can test on the environment.

Questions:
1. Is anyone here using such a setup successfully? No Broker restarts but JDBC failover?
2. What should I attach to this thread?

Kind regards

Christian Hilgers
-- 
Christian Hilgers                  |ConSol*
Tel.   +49.2102.994-483            |Consulting&Solutions Software GmbH
Fax    +49.2102.994-411            |Berliner Str. 101, 40880 Ratingen
email: Christian.Hilgers@consol.de |WWW: http://www.consol.de


Mime
View raw message