2 Replies Latest reply on Aug 9, 2011 10:01 PM by Ed Barwani

    MySQL/JDBC MasterSlave Configuration

    Ed Barwani Newbie

      Background: Evaluate a MasterSlave system and test failover with persistent messages.


      Using apache-activemq-5.5.0-fuse-00-27/conf/activemq-demo.xml as a base and using MySQL as Datastore, both the Master Broker & Slave Broker seem to start. The slave waits for the master to release the table lock before it takes over.


      Test 1:


      • Start both Master/Slave brokers


      • Create a producer adding persistent messages to a queue


      • Create a consumer dequeuing the messages


      • Issue  'activemq stop' command


      Test 2:


      • Same as Test 1 but instead pull out a network cable simulating a catastrophic failure.


      While Test 1 produces a clean failover, Test 2 doesn't.


      In Test 2, the Slave Broker keeps attempting to get a lock on the table, but continuously fail. The reason it fails, is because MySQL server doesn't know that the Master has died. And will wait for WAIT_TIMEOUT before closing the connection and releasing the lock. By default, this is 8 Hours.


      How do you achieve a more reliable failover without manipulating the WAIT_TIMEOUT? Do other databases suffer from this same problem? If I am doing any thing wrong, what would it be?



      PS: I did not post my configuration files because they just commented/uncommented blocks form activemq-demo.xml