6 Replies Latest reply on Dec 13, 2009 8:09 PM by eddy_eddwu

    Configuring master/slave with a shared file system.

    eddy_eddwu

      I'm using activeMQ 5.2 and trying to configure the master/slave configuration using the shared file system.  I have made the following change to the activemq.xml file:

       

       

       

      When I start two different activemq servers running on two different virtual machines, the activemq.log files both show they are becoming master and not having one of them become a slave.  The shared file system is NFS v4 to avoid the locking issue with NFS v3.

       

      Is there a step I'm missing?

        • 1. Re: Configuring master/slave with a shared file system.
          mielket

          First of all I suggest you try the latest version 5.3.0.5-fuse of Fuse Message Broker, which you can download from here.

          If the problem still persists, then pls start both brokers with full debug logging and attach both of the log files here.

          • 2. Re: Configuring master/slave with a shared file system.
            eddy_eddwu

            I tried with Fuse Message Broker 5.3.0.5 and the logs show in both of the activeMQ servers show that they are becoming the master.  I have included the two log files with the debug level set to debug.  I have also comment the networkConnector settings  in the activemq.xml.

            • 3. Re: Configuring master/slave with a shared file system.
              joe.luo

              It looks like you were using embedded derby DB as datasource and that can explain why both brokers became masters. Because both of them were using a embedded derby DB as datasource of their own.

               

              If you would like to use derby DB as datasource for master/slave configuration, then you will need to configure your derby DB as a service running somewhere and both brokers to connect to the same derby DB service through JDBC persistent adaptor. Default embedded derby DB will not work in master/slave configuration by the way.

               

              Or alternatively, you could use default AMQPersistentAdaptor:

              <persistenceAdapter>
                  <amqPersistenceAdapter syncOnWrite="false" directory="${activemq.base}/data" maxFileLength="20 mb"></amqPersistenceAdapter>
              </persistenceAdapter>
              

              and write the data to the same directory on NFS drive for your test.

               

              /Joe

               

              Edited by: joeluo on Nov 25, 2009 11:21 AM

              • 4. Re: Configuring master/slave with a shared file system.
                eddy_eddwu

                Joe,

                 

                I tried to use the amqPersistenceAdapter to point to the shared file system, but both activeMQ servers seem to become active and I am able to send events with my test application to both of them.  I have attached the activemq.log files from both servers.

                • 5. Re: Configuring master/slave with a shared file system.
                  mbunn

                  I'm having a very similar problem with NAS NFS acting as the the shared filesystem. I'm on FUSE MB 5.3.0.5 - Solaris. Did you find a resolution for this?

                   

                  I actually find when i start broker1 first broker2 waits, but if i start broker2 first broker1 starts also..

                   

                  I have tried the ActiveMQ forum - here's the details:

                  http://old.nabble.com/Master---slave-not-working-td26729676.html

                  • 6. Re: Configuring master/slave with a shared file system.
                    eddy_eddwu

                    I found that when running my two activeMQ servers on two VMs on VM ESX there is an issue.  If I have one instance of activeMQ running in a VM and another on a physical server then the lock is aquired correctly.  Still looking into why two instances on two different VMs do not work.