You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Abrasha70 <ya...@gmail.com> on 2015/11/01 08:26:55 UTC

Re: JDBC driver with Failover (Master-Slave) MS SQL database

Of course it fails, but it should not put the service down.
The service should keep running until it can reconnect.

I believe this is not a normal behavior of ActiveMQ,
and if it is, how can I config it otherwise?



--
View this message in context: http://activemq.2283324.n4.nabble.com/Crushing-JDBC-driver-with-Failover-Master-Slave-MS-SQL-database-tp4702654p4703577.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: JDBC driver with Failover (Master-Slave) MS SQL database

Posted by Tim Bain <tb...@alumni.duke.edu>.
Thanks for clarifying about the behavior when manually restart the broker
after a failover.

Are you using Tanuki's ability to restart a process automatically?  If so,
does Tanuki retry repeatedly while the database is in the process of
failing over?
On Nov 2, 2015 7:39 AM, "Abrasha70" <ya...@gmail.com> wrote:

> Hi Tim,
>
> Thank you for your assistance and your quick response.
>
> As for the questions, let me try to explain better:
>
> 1. We have 2 ActiveMQ Services installed (A, B) on different machines
> (Amq1,
> Amq2)
>    which are configured in ActiveMQ Failover configuration-
>    Both relay on a single SQL database.
>    This single database is configured in SQL Failover configuration
>    using 2 Microsoft SQL Servers (Server1, Server2)
>
> 2. When shutting one of A or B,
>    it fails-over *properly* to the other one.
>
> 3. However when the database fails-over-
>    both ActiveMQ *services* A and B go down.
>
> 4. When starting again the services they connect properly.
>
> So to sum it up:
> The problem is that when there's SQL Failover, the ActiveMQ can't recover
> by
> itself,
> It won't reconnect by itself until we start manually back the Service.
>
> I can't believe that this is the normal behavior of ActiveMQ,
> Especially since the SQL Failover starts and ends within a very short
> period
> of 30 seconds or so.
>
> * When I say "Service" - I infer to the installed ActiveMQ Windows Service.
>
>
>
> --
> View this message in context:
> http://activemq.2283324.n4.nabble.com/Crushing-JDBC-driver-with-Failover-Master-Slave-MS-SQL-database-tp4702654p4703584.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>

Re: JDBC driver with Failover (Master-Slave) MS SQL database

Posted by Tim Bain <tb...@alumni.duke.edu>.
My last question in that three-year-old thread applies to you too: are you
using a wrapper such as Tanuki that would detect the broker process exiting
and respond by restarting the ActiveMQ process? This would be the expected
way to handle this situation, so if you're not doing that, it's what I'd
recommend.

Tim

On Thu, Feb 14, 2019, 1:58 PM ramapr00 <prabhakaransr@hotmail.com wrote:

> I have the same issue with ActiveMQ. I have two nodes of AMQ and it is
> configured to use MS SQL with database cluster. When the database cluster
> fails over, my AMQ stops working and I need to re-start it manually to fix
> the issue. Could you please post how did you fix your issue?
>
>
>
> --
> Sent from:
> http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html
>

Re: JDBC driver with Failover (Master-Slave) MS SQL database

Posted by ramapr00 <pr...@hotmail.com>.
I have the same issue with ActiveMQ. I have two nodes of AMQ and it is
configured to use MS SQL with database cluster. When the database cluster
fails over, my AMQ stops working and I need to re-start it manually to fix
the issue. Could you please post how did you fix your issue?



--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html

Re: JDBC driver with Failover (Master-Slave) MS SQL database

Posted by Abrasha70 <ya...@gmail.com>.
Hi Tim,

Thank you for your assistance and your quick response.

As for the questions, let me try to explain better:

1. We have 2 ActiveMQ Services installed (A, B) on different machines (Amq1,
Amq2)
   which are configured in ActiveMQ Failover configuration-
   Both relay on a single SQL database.
   This single database is configured in SQL Failover configuration 
   using 2 Microsoft SQL Servers (Server1, Server2)

2. When shutting one of A or B, 
   it fails-over *properly* to the other one.

3. However when the database fails-over- 
   both ActiveMQ *services* A and B go down.

4. When starting again the services they connect properly.

So to sum it up:
The problem is that when there's SQL Failover, the ActiveMQ can't recover by
itself,
It won't reconnect by itself until we start manually back the Service.

I can't believe that this is the normal behavior of ActiveMQ,
Especially since the SQL Failover starts and ends within a very short period
of 30 seconds or so.

* When I say "Service" - I infer to the installed ActiveMQ Windows Service.



--
View this message in context: http://activemq.2283324.n4.nabble.com/Crushing-JDBC-driver-with-Failover-Master-Slave-MS-SQL-database-tp4702654p4703584.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: JDBC driver with Failover (Master-Slave) MS SQL database

Posted by Tim Bain <tb...@alumni.duke.edu>.
This is normal and expected behavior for ActiveMQ with KahaDB as well.
I've never used LevelDB, so I can't speak to its behavior, though I have no
reason to believe it would behave differently than the other two.

ActiveMQ can't work without a backing store if you've configured it to
require one.  What would it do while it was up without the ability to
accept messages?  Should it keep accepting connections when it can't accept
or deliver messages on them, depriving clients of the ability to fail over
to a broker that was actually alive?  This is how ActiveMQ works, and I'm
not aware of a way to configure it to behave otherwise (nor do I think such
an ability should exist).

If you need a workaround that allows you to handle periods of time (short
or long) when your database is unavailable, you could script a process to
watch for the ActiveMQ process to not be running and restart it...  It
wouldn't be unreasonable to allow the ability to configure how long to
retry the connection before giving up on it and halting the server, so you
could submit an enhancement request for that if you wanted.  But for right
now, monitoring and restarting the process seems like your best bet.

Also, you haven't answered my question: can ActiveMQ connect successfully
after the database failover?  Is the problem simply that ActiveMQ is
re-testing the connection sooner than the failover process makes it
available again?  Or is the problem that your broker can't connect to a
failed-over database no matter how long you wait?

Tim

On Sun, Nov 1, 2015 at 1:26 AM, Abrasha70 <ya...@gmail.com> wrote:

> Of course it fails, but it should not put the service down.
> The service should keep running until it can reconnect.
>
> I believe this is not a normal behavior of ActiveMQ,
> and if it is, how can I config it otherwise?
>
>
>
> --
> View this message in context:
> http://activemq.2283324.n4.nabble.com/Crushing-JDBC-driver-with-Failover-Master-Slave-MS-SQL-database-tp4702654p4703577.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>