JDBC Master Slave

classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|

JDBC Master Slave

Anthrope
Hello,
    I'm using version 4.1 and am trying to get a fairly straightforward jdbc master-slave setup going. I'm using a minimal configuration, with the default JDBC persistence adaptor, as specified in this example: http://www.activemq.org/site/jdbc-master-slave.html .  I start the master instance first, and attempt to start the slave with the *same* configuration file. The slave fails to start, because it attempts to create the derby database as well.

     Now, the documentation states this: in regard to JDBC master slave configuration: "By default if you use the <jdbcPersistenceAdapter/> to avoid the high performance journal you will be using JDBC Master Slave by default. You just need to run more than one broker and point the client side URIs to them to get master/slave."

     The behaviour I see is not quite consistent with this. I am not able to start more than one broker, which is the master. Am I missing something here? And, has anyone got this to work? I am attaching the broker configuration file, which is a verbatim cut and paste of the xml configuration file in the JDBC master slave example.

m.xml 

Regards,
Prashanth
Reply | Threaded
Open this post in threaded view
|

Re: JDBC Master Slave

Marlon Santos
Hi,

The problem was you were not using a  jdbc database in your xml config.
Try changing

     <jdbcPersistenceAdapter dataDirectory="${activemq.base}/activemq-data"/> 

with

     <jdbcPersistenceAdapter dataDirectory="activemq-data" dataSource="#postgres-ds"/>

If your using other data source rather than postgres-sql, just change the dataSource with the database you are using, such as mysql. then uncomment this part.
( this example is for postgres-sql.)



then create the necessary tables and database needed.

Regards...

Anthrope wrote
Hello,
    I'm using version 4.1 and am trying to get a fairly straightforward jdbc master-slave setup going. I'm using a minimal configuration, with the default JDBC persistence adaptor, as specified in this example: http://www.activemq.org/site/jdbc-master-slave.html .  I start the master instance first, and attempt to start the slave with the *same* configuration file. The slave fails to start, because it attempts to create the derby database as well.

     Now, the documentation states this: in regard to JDBC master slave configuration: "By default if you use the <jdbcPersistenceAdapter/> to avoid the high performance journal you will be using JDBC Master Slave by default. You just need to run more than one broker and point the client side URIs to them to get master/slave."

     The behaviour I see is not quite consistent with this. I am not able to start more than one broker, which is the master. Am I missing something here? And, has anyone got this to work? I am attaching the broker configuration file, which is a verbatim cut and paste of the xml configuration file in the JDBC master slave example.

m.xml 

Regards,
Prashanth
Reply | Threaded
Open this post in threaded view
|

Re: JDBC Master Slave

Anthrope
Hello Marlon,
      Thanks for the response. I tried your suggestion by changing the jdbcPersistence tag to:

<jdbcPersistenceAdapter dataDirectory="activemq-data" dataSource="#derby-ds"/>

and declaring a derby-ds bean (basically uncommenting the derby-ds specification in the example). I still see the same problem, with the slave failing because it is also attempting to create the database. I can get the slave to start if I specify a different location for its own database, but that doesn't quite make it any different from the Pure Master Slave.

     I will attempt this with MySQL and see whether this works as advertised. From your message, it appears that you have been able to gte this JDBC Master Slave configuration working with Postgres. Is that correct?

Thanks much,
Prashanth

Marlon Santos wrote
Hi,

The problem was you were not using a  jdbc database in your xml config.
Try changing

     <jdbcPersistenceAdapter dataDirectory="${activemq.base}/activemq-data"/> 

with

     <jdbcPersistenceAdapter dataDirectory="activemq-data" dataSource="#postgres-ds"/>

If your using other data source rather than postgres-sql, just change the dataSource with the database you are using, such as mysql. then uncomment this part.
( this example is for postgres-sql.)



then create the necessary tables and database needed.

Regards...

Anthrope wrote
Hello,
    I'm using version 4.1 and am trying to get a fairly straightforward jdbc master-slave setup going. I'm using a minimal configuration, with the default JDBC persistence adaptor, as specified in this example: http://www.activemq.org/site/jdbc-master-slave.html .  I start the master instance first, and attempt to start the slave with the *same* configuration file. The slave fails to start, because it attempts to create the derby database as well.

     Now, the documentation states this: in regard to JDBC master slave configuration: "By default if you use the <jdbcPersistenceAdapter/> to avoid the high performance journal you will be using JDBC Master Slave by default. You just need to run more than one broker and point the client side URIs to them to get master/slave."

     The behaviour I see is not quite consistent with this. I am not able to start more than one broker, which is the master. Am I missing something here? And, has anyone got this to work? I am attaching the broker configuration file, which is a verbatim cut and paste of the xml configuration file in the JDBC master slave example.

m.xml 

Regards,
Prashanth
Reply | Threaded
Open this post in threaded view
|

Re: JDBC Master Slave

Marlon Santos
Actually, i was able to make it work with the MySql config... So, you may try using it using mysql...

Regards...


Anthrope wrote
Hello Marlon,
      Thanks for the response. I tried your suggestion by changing the jdbcPersistence tag to:

<jdbcPersistenceAdapter dataDirectory="activemq-data" dataSource="#derby-ds"/>

and declaring a derby-ds bean (basically uncommenting the derby-ds specification in the example). I still see the same problem, with the slave failing because it is also attempting to create the database. I can get the slave to start if I specify a different location for its own database, but that doesn't quite make it any different from the Pure Master Slave.

     I will attempt this with MySQL and see whether this works as advertised. From your message, it appears that you have been able to gte this JDBC Master Slave configuration working with Postgres. Is that correct?

Thanks much,
Prashanth

Marlon Santos wrote
Hi,

The problem was you were not using a  jdbc database in your xml config.
Try changing

     <jdbcPersistenceAdapter dataDirectory="${activemq.base}/activemq-data"/> 

with

     <jdbcPersistenceAdapter dataDirectory="activemq-data" dataSource="#postgres-ds"/>

If your using other data source rather than postgres-sql, just change the dataSource with the database you are using, such as mysql. then uncomment this part.
( this example is for postgres-sql.)



then create the necessary tables and database needed.

Regards...

Anthrope wrote
Hello,
    I'm using version 4.1 and am trying to get a fairly straightforward jdbc master-slave setup going. I'm using a minimal configuration, with the default JDBC persistence adaptor, as specified in this example: http://www.activemq.org/site/jdbc-master-slave.html .  I start the master instance first, and attempt to start the slave with the *same* configuration file. The slave fails to start, because it attempts to create the derby database as well.

     Now, the documentation states this: in regard to JDBC master slave configuration: "By default if you use the <jdbcPersistenceAdapter/> to avoid the high performance journal you will be using JDBC Master Slave by default. You just need to run more than one broker and point the client side URIs to them to get master/slave."

     The behaviour I see is not quite consistent with this. I am not able to start more than one broker, which is the master. Am I missing something here? And, has anyone got this to work? I am attaching the broker configuration file, which is a verbatim cut and paste of the xml configuration file in the JDBC master slave example.

m.xml 

Regards,
Prashanth
Reply | Threaded
Open this post in threaded view
|

Re: JDBC Master Slave

Marlon Santos
In reply to this post by Anthrope
I tried it with postgresql and it works too.

Regards...


Anthrope wrote
Hello Marlon,
      Thanks for the response. I tried your suggestion by changing the jdbcPersistence tag to:

<jdbcPersistenceAdapter dataDirectory="activemq-data" dataSource="#derby-ds"/>

and declaring a derby-ds bean (basically uncommenting the derby-ds specification in the example). I still see the same problem, with the slave failing because it is also attempting to create the database. I can get the slave to start if I specify a different location for its own database, but that doesn't quite make it any different from the Pure Master Slave.

     I will attempt this with MySQL and see whether this works as advertised. From your message, it appears that you have been able to gte this JDBC Master Slave configuration working with Postgres. Is that correct?

Thanks much,
Prashanth

Marlon Santos wrote
Hi,

The problem was you were not using a  jdbc database in your xml config.
Try changing

     <jdbcPersistenceAdapter dataDirectory="${activemq.base}/activemq-data"/> 

with

     <jdbcPersistenceAdapter dataDirectory="activemq-data" dataSource="#postgres-ds"/>

If your using other data source rather than postgres-sql, just change the dataSource with the database you are using, such as mysql. then uncomment this part.
( this example is for postgres-sql.)



then create the necessary tables and database needed.

Regards...

Anthrope wrote
Hello,
    I'm using version 4.1 and am trying to get a fairly straightforward jdbc master-slave setup going. I'm using a minimal configuration, with the default JDBC persistence adaptor, as specified in this example: http://www.activemq.org/site/jdbc-master-slave.html .  I start the master instance first, and attempt to start the slave with the *same* configuration file. The slave fails to start, because it attempts to create the derby database as well.

     Now, the documentation states this: in regard to JDBC master slave configuration: "By default if you use the <jdbcPersistenceAdapter/> to avoid the high performance journal you will be using JDBC Master Slave by default. You just need to run more than one broker and point the client side URIs to them to get master/slave."

     The behaviour I see is not quite consistent with this. I am not able to start more than one broker, which is the master. Am I missing something here? And, has anyone got this to work? I am attaching the broker configuration file, which is a verbatim cut and paste of the xml configuration file in the JDBC master slave example.

m.xml 

Regards,
Prashanth
Reply | Threaded
Open this post in threaded view
|

Re: JDBC Master Slave

James Strachan-2
In reply to this post by Anthrope
You must use a shared database for JDBC based master/slave so use
MySQL or Postgresql - not Derby (which is typically used as an in-JVM
database).


On 12/11/06, Anthrope <[hidden email]> wrote:

>
> Hello Marlon,
>       Thanks for the response. I tried your suggestion by changing the
> jdbcPersistence tag to:
>
> <jdbcPersistenceAdapter dataDirectory="activemq-data"
> dataSource="#derby-ds"/>
>
> and declaring a derby-ds bean (basically uncommenting the derby-ds
> specification in the example). I still see the same problem, with the slave
> failing because it is also attempting to create the database. I can get the
> slave to start if I specify a different location for its own database, but
> that doesn't quite make it any different from the Pure Master Slave.
>
>      I will attempt this with MySQL and see whether this works as
> advertised. From your message, it appears that you have been able to gte
> this JDBC Master Slave configuration working with Postgres. Is that correct?
>
> Thanks much,
> Prashanth
>
>
> Marlon Santos wrote:
> >
> > Hi,
> >
> > The problem was you were not using a  jdbc database in your xml config.
> > Try changing
> >
> >      <jdbcPersistenceAdapter
> > dataDirectory="${activemq.base}/activemq-data"/>
> >
> > with
> >
> >      <jdbcPersistenceAdapter dataDirectory="activemq-data"
> > dataSource="#postgres-ds"/>
> >
> > If your using other data source rather than postgres-sql, just change the
> > dataSource with the database you are using, such as mysql. then uncomment
> > this part.
> > ( this example is for postgres-sql.)
> >
> > <!--
> >
> >   <bean id="postgres-ds" class="org.postgresql.ds.PGPoolingDataSource">
> >     <property name="serverName" value="localhost"/>
> >     <property name="databaseName" value="activemq"/>
> >     <property name="portNumber" value="0"/>
> >     <property name="user" value="activemq"/>
> >     <property name="password" value="activemq"/>
> >     <property name="dataSourceName" value="postgres"/>
> >     <property name="initialConnections" value="1"/>
> >     <property name="maxConnections" value="10"/>
> >   </bean>
> >
> > -->
> >
> > then create the necessary tables and database needed.
> >
> > Regards...
> >
> >
> > Anthrope wrote:
> >>
> >> Hello,
> >>     I'm using version 4.1 and am trying to get a fairly straightforward
> >> jdbc master-slave setup going. I'm using a minimal configuration, with
> >> the default JDBC persistence adaptor, as specified in this example:
> >> http://www.activemq.org/site/jdbc-master-slave.html .  I start the master
> >> instance first, and attempt to start the slave with the *same*
> >> configuration file. The slave fails to start, because it attempts to
> >> create the derby database as well.
> >>
> >>      Now, the documentation states this: in regard to JDBC master slave
> >> configuration: "By default if you use the <jdbcPersistenceAdapter/> to
> >> avoid the high performance journal you will be using JDBC Master Slave by
> >> default. You just need to run more than one broker and point the client
> >> side URIs to them to get master/slave."
> >>
> >>      The behaviour I see is not quite consistent with this. I am not able
> >> to start more than one broker, which is the master. Am I missing
> >> something here? And, has anyone got this to work? I am attaching the
> >> broker configuration file, which is a verbatim cut and paste of the xml
> >> configuration file in the JDBC master slave example.
> >>
> >>  http://www.nabble.com/file/4543/m.xml m.xml
> >>
> >> Regards,
> >> Prashanth
> >>
> >
> >
>
> --
> View this message in context: http://www.nabble.com/JDBC-Master-Slave-tf2792225.html#a7790449
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>


--

James
-------
http://radio.weblogs.com/0112098/
Reply | Threaded
Open this post in threaded view
|

Re: JDBC Master Slave

Anthrope
Thanks for this information; it clarifies things. On to the next question now. I was able to get ActiveMQ to use a MySQL repository, and noticed that there were three tables created:

ACTIVEMQ_ACKS
ACTIVEMQ_LOCK
activemq_msgs

I ran a producer and dumped 10 messages onto a queue (without consuming them), but saw nothing in the activemq_msgs table. I assume this is probably because the server caches a certain amount before needing to use the database. What I was a bit surprised by was the fact that there was one row in the ACTIVEMQ_LOCK table (which has 3 columns, ID, TIME and BROKER_NAME), which had 1 for the ID column, and NULLs for TIME and BROKER_NAME columns. Is that what we ought to expect? If it is, then I'd hazard a guess that each broker will have to have its own database instance. Is that correct?

Thanks much,
Prashanth

 
James.Strachan wrote
You must use a shared database for JDBC based master/slave so use
MySQL or Postgresql - not Derby (which is typically used as an in-JVM
database).


On 12/11/06, Anthrope <pn@anthrope.com> wrote:
>
> Hello Marlon,
>       Thanks for the response. I tried your suggestion by changing the
> jdbcPersistence tag to:
>
> <jdbcPersistenceAdapter dataDirectory="activemq-data"
> dataSource="#derby-ds"/>
>
> and declaring a derby-ds bean (basically uncommenting the derby-ds
> specification in the example). I still see the same problem, with the slave
> failing because it is also attempting to create the database. I can get the
> slave to start if I specify a different location for its own database, but
> that doesn't quite make it any different from the Pure Master Slave.
>
>      I will attempt this with MySQL and see whether this works as
> advertised. From your message, it appears that you have been able to gte
> this JDBC Master Slave configuration working with Postgres. Is that correct?
>
> Thanks much,
> Prashanth
>
>
> Marlon Santos wrote:
> >
> > Hi,
> >
> > The problem was you were not using a  jdbc database in your xml config.
> > Try changing
> >
> >      <jdbcPersistenceAdapter
> > dataDirectory="${activemq.base}/activemq-data"/>
> >
> > with
> >
> >      <jdbcPersistenceAdapter dataDirectory="activemq-data"
> > dataSource="#postgres-ds"/>
> >
> > If your using other data source rather than postgres-sql, just change the
> > dataSource with the database you are using, such as mysql. then uncomment
> > this part.
> > ( this example is for postgres-sql.)
> >
> >
> >
> > then create the necessary tables and database needed.
> >
> > Regards...
> >
> >
> > Anthrope wrote:
> >>
> >> Hello,
> >>     I'm using version 4.1 and am trying to get a fairly straightforward
> >> jdbc master-slave setup going. I'm using a minimal configuration, with
> >> the default JDBC persistence adaptor, as specified in this example:
> >> http://www.activemq.org/site/jdbc-master-slave.html .  I start the master
> >> instance first, and attempt to start the slave with the *same*
> >> configuration file. The slave fails to start, because it attempts to
> >> create the derby database as well.
> >>
> >>      Now, the documentation states this: in regard to JDBC master slave
> >> configuration: "By default if you use the <jdbcPersistenceAdapter/> to
> >> avoid the high performance journal you will be using JDBC Master Slave by
> >> default. You just need to run more than one broker and point the client
> >> side URIs to them to get master/slave."
> >>
> >>      The behaviour I see is not quite consistent with this. I am not able
> >> to start more than one broker, which is the master. Am I missing
> >> something here? And, has anyone got this to work? I am attaching the
> >> broker configuration file, which is a verbatim cut and paste of the xml
> >> configuration file in the JDBC master slave example.
> >>
> >>  http://www.nabble.com/file/4543/m.xml m.xml
> >>
> >> Regards,
> >> Prashanth
> >>
> >
> >
>
> --
> View this message in context: http://www.nabble.com/JDBC-Master-Slave-tf2792225.html#a7790449
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>


--

James
-------
http://radio.weblogs.com/0112098/
Reply | Threaded
Open this post in threaded view
|

Re: JDBC Master Slave

James Strachan-2
On 12/12/06, Anthrope <[hidden email]> wrote:
> Thanks for this information; it clarifies things. On to the next question
> now. I was able to get ActiveMQ to use a MySQL repository, and noticed that
> there were three tables created:
>
> ACTIVEMQ_ACKS
> ACTIVEMQ_LOCK
> activemq_msgs

Looks about right.

> I ran a producer and dumped 10 messages onto a queue (without consuming
> them), but saw nothing in the activemq_msgs table.

You're definitely using the <jdbcPersistenceAdapter/> element right?
i.e. not using the journal

http://incubator.apache.org/activemq/jdbc-master-slave.html


> I assume this is probably
> because the server caches a certain amount before needing to use the
> database. What I was a bit surprised by was the fact that there was one row
> in the ACTIVEMQ_LOCK table (which has 3 columns, ID, TIME and BROKER_NAME),
> which had 1 for the ID column, and NULLs for TIME and BROKER_NAME columns.
> Is that what we ought to expect?

Yeah, that sounds right.

> If it is, then I'd hazard a guess that each
> broker will have to have its own database instance. Is that correct?

Each group of 1 master and N slaves shares a single database instance.
Or another way of saying that is each master requires its own database
instance
--

James
-------
http://radio.weblogs.com/0112098/
Reply | Threaded
Open this post in threaded view
|

Re: JDBC Master Slave

Anthrope
James,
    Thanks for the response. I am using the config file as-is from the example. I am using the jdbcPersistenceAdapter element, and here's what I have:

- I start activemq on port 5616 and it duly starts up, taking over as the master
- I start a second instance with exactly the same configuration, and it fails to start, because it tries to bind to 5616
- I change the configuration to use port 5626, and the slave starts, but surprisingly, it is also able to become the master (as per the logs)
- I don't quite understand how both end up becoming the master, but perhaps it's just how it's being logged?
- I run the 'producer' example with 100000 messages of 5000 bytes each (using the failover uri to connect), and am able to only push through about 16000 messages to a queue called TEST.FOO before the producer dies with an exception trying to create a connection
- I kill the master broker and then run the consumer example with the failover uri and am able to successfully extract about 7800 messages before the client shuts down with a JMS exception
- I run the consumer again, and am able to drain the rest of the messages

I'll run more extensive tests, re-introducing the master to see it it does take over indeed, but am a bit baffled as to why the slave also thinks it is the master when it is started. I was under the impression that the slave would not start any connectors, but it does indeed start all its connectors when started.

Am I missing something here? This behaviour seems more like what we'd expect from a network of brokers as opposed to a Master Slave configuration. Do I need to tell the slave explicitly what the masterConnectorURI is?

Thanks, and apologies for the long post,
Prashanth


James.Strachan wrote
On 12/12/06, Anthrope <pn@anthrope.com> wrote:
> Thanks for this information; it clarifies things. On to the next question
> now. I was able to get ActiveMQ to use a MySQL repository, and noticed that
> there were three tables created:
>
> ACTIVEMQ_ACKS
> ACTIVEMQ_LOCK
> activemq_msgs

Looks about right.

> I ran a producer and dumped 10 messages onto a queue (without consuming
> them), but saw nothing in the activemq_msgs table.

You're definitely using the <jdbcPersistenceAdapter/> element right?
i.e. not using the journal

http://incubator.apache.org/activemq/jdbc-master-slave.html


> I assume this is probably
> because the server caches a certain amount before needing to use the
> database. What I was a bit surprised by was the fact that there was one row
> in the ACTIVEMQ_LOCK table (which has 3 columns, ID, TIME and BROKER_NAME),
> which had 1 for the ID column, and NULLs for TIME and BROKER_NAME columns.
> Is that what we ought to expect?

Yeah, that sounds right.

> If it is, then I'd hazard a guess that each
> broker will have to have its own database instance. Is that correct?

Each group of 1 master and N slaves shares a single database instance.
Or another way of saying that is each master requires its own database
instance
--

James
-------
http://radio.weblogs.com/0112098/
Reply | Threaded
Open this post in threaded view
|

Re: JDBC Master Slave

James Strachan-2
On 12/12/06, Anthrope <[hidden email]> wrote:

>
> James,
>     Thanks for the response. I am using the config file as-is from the
> example. I am using the jdbcPersistenceAdapter element, and here's what I
> have:
>
> - I start activemq on port 5616 and it duly starts up, taking over as the
> master
> - I start a second instance with exactly the same configuration, and it
> fails to start, because it tries to bind to 5616
> - I change the configuration to use port 5626,

This sounds like something is not working correctly as a slave should
not try to bind to a socket until it becomes the master.

> - I don't quite understand how both end up becoming the master, but perhaps
> it's just how it's being logged?

No - sounds like you're not using a shared database between the two.


> - I kill the master broker and then run the consumer example with the
> failover uri and am able to successfully extract about 7800 messages before
> the client shuts down with a JMS exception

What exception?

--

James
-------
http://radio.weblogs.com/0112098/
Reply | Threaded
Open this post in threaded view
|

Re: JDBC Master Slave

Anthrope
Something is surely not right. The logical sequence should be that the broker first attempt to acquire the lock before starting any services. My config file is exactly what is specified in the example, and the behaviour I see is not what I expect.

Has anyone actually got this configuration to work?

As regards the client dying, the only information I have is that a JMSException occurred. I'd have posted other information if I'd had it.


James.Strachan wrote
On 12/12/06, Anthrope <pn@anthrope.com> wrote:
>
> James,
>     Thanks for the response. I am using the config file as-is from the
> example. I am using the jdbcPersistenceAdapter element, and here's what I
> have:
>
> - I start activemq on port 5616 and it duly starts up, taking over as the
> master
> - I start a second instance with exactly the same configuration, and it
> fails to start, because it tries to bind to 5616
> - I change the configuration to use port 5626,

This sounds like something is not working correctly as a slave should
not try to bind to a socket until it becomes the master.

> - I don't quite understand how both end up becoming the master, but perhaps
> it's just how it's being logged?

No - sounds like you're not using a shared database between the two.


> - I kill the master broker and then run the consumer example with the
> failover uri and am able to successfully extract about 7800 messages before
> the client shuts down with a JMS exception

What exception?

--

James
-------
http://radio.weblogs.com/0112098/
Reply | Threaded
Open this post in threaded view
|

Re: JDBC Master Slave

Jack Leung
I have been following this thread and tried the same example. I cannot get multiple "master" brokers to start either. It seems the locking does not work. I agree that the behavior demonstrated is not consistent with the documentation.

So maybe this feature is not production ready, or has not been tested yet?

Jack

Anthrope wrote
Something is surely not right. The logical sequence should be that the broker first attempt to acquire the lock before starting any services. My config file is exactly what is specified in the example, and the behaviour I see is not what I expect.

Has anyone actually got this configuration to work?

As regards the client dying, the only information I have is that a JMSException occurred. I'd have posted other information if I'd had it.


James.Strachan wrote
On 12/12/06, Anthrope <pn@anthrope.com> wrote:
>
> James,
>     Thanks for the response. I am using the config file as-is from the
> example. I am using the jdbcPersistenceAdapter element, and here's what I
> have:
>
> - I start activemq on port 5616 and it duly starts up, taking over as the
> master
> - I start a second instance with exactly the same configuration, and it
> fails to start, because it tries to bind to 5616
> - I change the configuration to use port 5626,

This sounds like something is not working correctly as a slave should
not try to bind to a socket until it becomes the master.

> - I don't quite understand how both end up becoming the master, but perhaps
> it's just how it's being logged?

No - sounds like you're not using a shared database between the two.


> - I kill the master broker and then run the consumer example with the
> failover uri and am able to successfully extract about 7800 messages before
> the client shuts down with a JMS exception

What exception?

--

James
-------
http://radio.weblogs.com/0112098/
Reply | Threaded
Open this post in threaded view
|

Re: JDBC Master Slave

Anthrope
Okay,
     So we've apparently run into a MySQL-related idisyncracy. The tables that ActiveMQ was creating were of the MyISAM type, which doesn't support SELECT FOR UPDATE semantics. We converted the tables to INNODB table types, and it worked like a charm. On to the next issue, which involves providing some form of load balancing.

Regards,
Prashanth

Jack Leung wrote
I have been following this thread and tried the same example. I cannot get multiple "master" brokers to start either. It seems the locking does not work. I agree that the behavior demonstrated is not consistent with the documentation.

So maybe this feature is not production ready, or has not been tested yet?

Jack

Anthrope wrote
Something is surely not right. The logical sequence should be that the broker first attempt to acquire the lock before starting any services. My config file is exactly what is specified in the example, and the behaviour I see is not what I expect.

Has anyone actually got this configuration to work?

As regards the client dying, the only information I have is that a JMSException occurred. I'd have posted other information if I'd had it.


James.Strachan wrote
On 12/12/06, Anthrope <pn@anthrope.com> wrote:
>
> James,
>     Thanks for the response. I am using the config file as-is from the
> example. I am using the jdbcPersistenceAdapter element, and here's what I
> have:
>
> - I start activemq on port 5616 and it duly starts up, taking over as the
> master
> - I start a second instance with exactly the same configuration, and it
> fails to start, because it tries to bind to 5616
> - I change the configuration to use port 5626,

This sounds like something is not working correctly as a slave should
not try to bind to a socket until it becomes the master.

> - I don't quite understand how both end up becoming the master, but perhaps
> it's just how it's being logged?

No - sounds like you're not using a shared database between the two.


> - I kill the master broker and then run the consumer example with the
> failover uri and am able to successfully extract about 7800 messages before
> the client shuts down with a JMS exception

What exception?

--

James
-------
http://radio.weblogs.com/0112098/
Reply | Threaded
Open this post in threaded view
|

Re: JDBC Master Slave

James Strachan-2
In reply to this post by Jack Leung
On 12/12/06, Jack Leung <[hidden email]> wrote:
>
> I have been following this thread and tried the same example. I cannot get
> multiple "master" brokers to start either. It seems the locking does not
> work. I agree that the behavior demonstrated is not consistent with the
> documentation.
>
> So maybe this feature is not production ready, or has not been tested yet?

Its been both tested and used in production with various customers.
The issue is mostly due to the exact SQL database used. e.g. most
customers I'm aware of use Oracle.

The MySQL related SQL dialect issues were fixed in trunk so are
available in 4.2 snapshot...

http://issues.apache.org/activemq/browse/AMQ-992
--

James
-------
http://radio.weblogs.com/0112098/