You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Fabrice Triboix <fa...@armedia.com> on 2021/08/10 15:46:39 UTC

How to disable KahaDB lock?

Hi everyone,

It seems that when ActiveMQ terminates uncleanly, it leaves a lock on the Kaha DB. Next time it starts, it complains that the DB is locked and goes in slave mode.

In my setup, I am 100% certain that a given broker will access one and only one KahaDB, so I would like to configure ActiveMQ so that it doesn't put a lock on KahaDB. Is that possible? If yes, how?

Thanks a lot for your help!

  Fabrice

Re: Antwort: How to disable KahaDB lock?

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
The lease locker would work only for JDBC store.

However you can mix both (see my blog post about that).

Regards
JB

Antwort: How to disable KahaDB lock?

Posted by He...@systema.com.
Hello Fabricio,

did you try a lease locker rather than a database lock?
https://activemq.apache.org/pluggable-storage-lockers
for me this works fine but not on KahaDB but shouldn't matter

Regards

Herbert




Von:    "Fabrice Triboix" <fa...@armedia.com>
An:     "users@activemq.apache.org" <us...@activemq.apache.org>
Datum:  10.08.2021 17:47
Betreff:        How to disable KahaDB lock?



Hi everyone,

It seems that when ActiveMQ terminates uncleanly, it leaves a lock on the 
Kaha DB. Next time it starts, it complains that the DB is locked and goes 
in slave mode.

In my setup, I am 100% certain that a given broker will access one and 
only one KahaDB, so I would like to configure ActiveMQ so that it doesn't 
put a lock on KahaDB. Is that possible? If yes, how?

Thanks a lot for your help!

  Fabrice





Re: How to disable KahaDB lock?

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
You can take a look on my blog post "Apache ActiveMQ 5.7, 5.9 and 
Master-Slave" for some details.

Regards
JB

Re: How to disable KahaDB lock?

Posted by Tim Bain <tb...@alumni.duke.edu>.
While working with Kubernetes for non-ActiveMQ things I've observed
situations where a deployment starts a replacement pod before the prior pod
was fully terminated. Might that be what's going on, a race condition where
your two programs competing for the lock are the previous and current pods
from this one deployment?

Tim

On Tue, Aug 10, 2021, 12:36 PM Jean-Baptiste Onofré <jb...@nanthrax.net> wrote:

> The lock file is located in the kahadb folder (by default it's
> $ACTIVEMQ_HOME/data/kahadb/lock file).
>
> Regards
> JB
>
> On 10/08/2021 19:15, Fabrice Triboix wrote:
> > Hi JB,
> >
> > I think the timeout is too long and Kubernetes kills the pod. What is
> the location of the lock file?
> >
> > Cheers,
> >
> >    Fabrice
> >
> > ________________________________
> > From: Jean-Baptiste Onofré <jb...@nanthrax.net>
> > Sent: 10 August 2021 18:04
> > To: users@activemq.apache.org <us...@activemq.apache.org>
> > Subject: Re: How to disable KahaDB lock?
> >
> > CAUTION: This email originated from outside of the organization. Do not
> click links or open attachments unless you recognize the sender and know
> the content is safe.
> >
> >
> > There's a timeout on the lock and so. Even if you kill the activemq
> > process, it should not be a problem.
> >
> > When you say "terminated", you mean killed right ?
> >
> > Regards
> > JB
> >
> > On 10/08/2021 18:15, Fabrice Triboix wrote:
> >> Hi JB,
> >>
> >> Thanks for your answer. Please note I don't know much about ActiveMQ
> and I work as a DevOps. I just want ActiveMQ to start every time, even if
> it is restarted after a crash. At the moment, I get this error about KahaDB
> lock and I know for a fact that this broker is the only broker that
> accesses this KahaDB. I can only conclude that ActiveMQ exited abnormally
> and didn't release the lock, and that consequently every time it is
> restarted it complains about the lock and goes into slave move.
> >>
> >> In our setup, ActiveMQ might be terminated at any time and without
> warning. When it is subsequently restarted, it must work.
> >>
> >> Could you please let me know how to do that?
> >>
> >> Thanks,
> >>
> >>     Fabrice
> >>
> >> ________________________________
> >> From: JB Onofré <jb...@nanthrax.net>
> >> Sent: 10 August 2021 16:53
> >> To: users@activemq.apache.org <us...@activemq.apache.org>
> >> Subject: Re: How to disable KahaDB lock?
> >>
> >> CAUTION: This email originated from outside of the organization. Do not
> click links or open attachments unless you recognize the sender and know
> the content is safe.
> >>
> >>
> >> Hi
> >>
> >> No as soon  as a broker start with kahadb it lock kahadb.
> >>
> >> Imho you have a file system issue or config: I never had locking issue
> with kahadb.
> >>
> >> You can always remove the lock manually but I would check if you don’t
> have another process or so.
> >>
> >> Regards
> >> JB
> >>
> >>> Le 10 août 2021 à 17:46, Fabrice Triboix <fa...@armedia.com>
> a écrit :
> >>>
> >>> Hi everyone,
> >>>
> >>> It seems that when ActiveMQ terminates uncleanly, it leaves a lock on
> the Kaha DB. Next time it starts, it complains that the DB is locked and
> goes in slave mode.
> >>>
> >>> In my setup, I am 100% certain that a given broker will access one and
> only one KahaDB, so I would like to configure ActiveMQ so that it doesn't
> put a lock on KahaDB. Is that possible? If yes, how?
> >>>
> >>> Thanks a lot for your help!
> >>>
> >>>    Fabrice
> >>
>

Re: How to disable KahaDB lock?

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
The lock file is located in the kahadb folder (by default it's 
$ACTIVEMQ_HOME/data/kahadb/lock file).

Regards
JB

On 10/08/2021 19:15, Fabrice Triboix wrote:
> Hi JB,
> 
> I think the timeout is too long and Kubernetes kills the pod. What is the location of the lock file?
> 
> Cheers,
> 
>    Fabrice
> 
> ________________________________
> From: Jean-Baptiste Onofré <jb...@nanthrax.net>
> Sent: 10 August 2021 18:04
> To: users@activemq.apache.org <us...@activemq.apache.org>
> Subject: Re: How to disable KahaDB lock?
> 
> CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.
> 
> 
> There's a timeout on the lock and so. Even if you kill the activemq
> process, it should not be a problem.
> 
> When you say "terminated", you mean killed right ?
> 
> Regards
> JB
> 
> On 10/08/2021 18:15, Fabrice Triboix wrote:
>> Hi JB,
>>
>> Thanks for your answer. Please note I don't know much about ActiveMQ and I work as a DevOps. I just want ActiveMQ to start every time, even if it is restarted after a crash. At the moment, I get this error about KahaDB lock and I know for a fact that this broker is the only broker that accesses this KahaDB. I can only conclude that ActiveMQ exited abnormally and didn't release the lock, and that consequently every time it is restarted it complains about the lock and goes into slave move.
>>
>> In our setup, ActiveMQ might be terminated at any time and without warning. When it is subsequently restarted, it must work.
>>
>> Could you please let me know how to do that?
>>
>> Thanks,
>>
>>     Fabrice
>>
>> ________________________________
>> From: JB Onofré <jb...@nanthrax.net>
>> Sent: 10 August 2021 16:53
>> To: users@activemq.apache.org <us...@activemq.apache.org>
>> Subject: Re: How to disable KahaDB lock?
>>
>> CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.
>>
>>
>> Hi
>>
>> No as soon  as a broker start with kahadb it lock kahadb.
>>
>> Imho you have a file system issue or config: I never had locking issue with kahadb.
>>
>> You can always remove the lock manually but I would check if you don’t have another process or so.
>>
>> Regards
>> JB
>>
>>> Le 10 août 2021 à 17:46, Fabrice Triboix <fa...@armedia.com> a écrit :
>>>
>>> Hi everyone,
>>>
>>> It seems that when ActiveMQ terminates uncleanly, it leaves a lock on the Kaha DB. Next time it starts, it complains that the DB is locked and goes in slave mode.
>>>
>>> In my setup, I am 100% certain that a given broker will access one and only one KahaDB, so I would like to configure ActiveMQ so that it doesn't put a lock on KahaDB. Is that possible? If yes, how?
>>>
>>> Thanks a lot for your help!
>>>
>>>    Fabrice
>>

Re: How to disable KahaDB lock?

Posted by Fabrice Triboix <fa...@armedia.com>.
Hi JB,

I think the timeout is too long and Kubernetes kills the pod. What is the location of the lock file?

Cheers,

  Fabrice

________________________________
From: Jean-Baptiste Onofré <jb...@nanthrax.net>
Sent: 10 August 2021 18:04
To: users@activemq.apache.org <us...@activemq.apache.org>
Subject: Re: How to disable KahaDB lock?

CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.


There's a timeout on the lock and so. Even if you kill the activemq
process, it should not be a problem.

When you say "terminated", you mean killed right ?

Regards
JB

On 10/08/2021 18:15, Fabrice Triboix wrote:
> Hi JB,
>
> Thanks for your answer. Please note I don't know much about ActiveMQ and I work as a DevOps. I just want ActiveMQ to start every time, even if it is restarted after a crash. At the moment, I get this error about KahaDB lock and I know for a fact that this broker is the only broker that accesses this KahaDB. I can only conclude that ActiveMQ exited abnormally and didn't release the lock, and that consequently every time it is restarted it complains about the lock and goes into slave move.
>
> In our setup, ActiveMQ might be terminated at any time and without warning. When it is subsequently restarted, it must work.
>
> Could you please let me know how to do that?
>
> Thanks,
>
>    Fabrice
>
> ________________________________
> From: JB Onofré <jb...@nanthrax.net>
> Sent: 10 August 2021 16:53
> To: users@activemq.apache.org <us...@activemq.apache.org>
> Subject: Re: How to disable KahaDB lock?
>
> CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.
>
>
> Hi
>
> No as soon  as a broker start with kahadb it lock kahadb.
>
> Imho you have a file system issue or config: I never had locking issue with kahadb.
>
> You can always remove the lock manually but I would check if you don’t have another process or so.
>
> Regards
> JB
>
>> Le 10 août 2021 à 17:46, Fabrice Triboix <fa...@armedia.com> a écrit :
>>
>> Hi everyone,
>>
>> It seems that when ActiveMQ terminates uncleanly, it leaves a lock on the Kaha DB. Next time it starts, it complains that the DB is locked and goes in slave mode.
>>
>> In my setup, I am 100% certain that a given broker will access one and only one KahaDB, so I would like to configure ActiveMQ so that it doesn't put a lock on KahaDB. Is that possible? If yes, how?
>>
>> Thanks a lot for your help!
>>
>>   Fabrice
>

Re: How to disable KahaDB lock?

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
There's a timeout on the lock and so. Even if you kill the activemq 
process, it should not be a problem.

When you say "terminated", you mean killed right ?

Regards
JB

On 10/08/2021 18:15, Fabrice Triboix wrote:
> Hi JB,
> 
> Thanks for your answer. Please note I don't know much about ActiveMQ and I work as a DevOps. I just want ActiveMQ to start every time, even if it is restarted after a crash. At the moment, I get this error about KahaDB lock and I know for a fact that this broker is the only broker that accesses this KahaDB. I can only conclude that ActiveMQ exited abnormally and didn't release the lock, and that consequently every time it is restarted it complains about the lock and goes into slave move.
> 
> In our setup, ActiveMQ might be terminated at any time and without warning. When it is subsequently restarted, it must work.
> 
> Could you please let me know how to do that?
> 
> Thanks,
> 
>    Fabrice
> 
> ________________________________
> From: JB Onofré <jb...@nanthrax.net>
> Sent: 10 August 2021 16:53
> To: users@activemq.apache.org <us...@activemq.apache.org>
> Subject: Re: How to disable KahaDB lock?
> 
> CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.
> 
> 
> Hi
> 
> No as soon  as a broker start with kahadb it lock kahadb.
> 
> Imho you have a file system issue or config: I never had locking issue with kahadb.
> 
> You can always remove the lock manually but I would check if you don’t have another process or so.
> 
> Regards
> JB
> 
>> Le 10 août 2021 à 17:46, Fabrice Triboix <fa...@armedia.com> a écrit :
>>
>> Hi everyone,
>>
>> It seems that when ActiveMQ terminates uncleanly, it leaves a lock on the Kaha DB. Next time it starts, it complains that the DB is locked and goes in slave mode.
>>
>> In my setup, I am 100% certain that a given broker will access one and only one KahaDB, so I would like to configure ActiveMQ so that it doesn't put a lock on KahaDB. Is that possible? If yes, how?
>>
>> Thanks a lot for your help!
>>
>>   Fabrice
> 

Re: How to disable KahaDB lock?

Posted by Fabrice Triboix <fa...@armedia.com>.
Hi JB,

Thanks for your answer. Please note I don't know much about ActiveMQ and I work as a DevOps. I just want ActiveMQ to start every time, even if it is restarted after a crash. At the moment, I get this error about KahaDB lock and I know for a fact that this broker is the only broker that accesses this KahaDB. I can only conclude that ActiveMQ exited abnormally and didn't release the lock, and that consequently every time it is restarted it complains about the lock and goes into slave move.

In our setup, ActiveMQ might be terminated at any time and without warning. When it is subsequently restarted, it must work.

Could you please let me know how to do that?

Thanks,

  Fabrice

________________________________
From: JB Onofré <jb...@nanthrax.net>
Sent: 10 August 2021 16:53
To: users@activemq.apache.org <us...@activemq.apache.org>
Subject: Re: How to disable KahaDB lock?

CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.


Hi

No as soon  as a broker start with kahadb it lock kahadb.

Imho you have a file system issue or config: I never had locking issue with kahadb.

You can always remove the lock manually but I would check if you don’t have another process or so.

Regards
JB

> Le 10 août 2021 à 17:46, Fabrice Triboix <fa...@armedia.com> a écrit :
>
> Hi everyone,
>
> It seems that when ActiveMQ terminates uncleanly, it leaves a lock on the Kaha DB. Next time it starts, it complains that the DB is locked and goes in slave mode.
>
> In my setup, I am 100% certain that a given broker will access one and only one KahaDB, so I would like to configure ActiveMQ so that it doesn't put a lock on KahaDB. Is that possible? If yes, how?
>
> Thanks a lot for your help!
>
>  Fabrice


Re: How to disable KahaDB lock?

Posted by JB Onofré <jb...@nanthrax.net>.
Hi

No as soon  as a broker start with kahadb it lock kahadb. 

Imho you have a file system issue or config: I never had locking issue with kahadb. 

You can always remove the lock manually but I would check if you don’t have another process or so. 

Regards 
JB

> Le 10 août 2021 à 17:46, Fabrice Triboix <fa...@armedia.com> a écrit :
> 
> Hi everyone,
> 
> It seems that when ActiveMQ terminates uncleanly, it leaves a lock on the Kaha DB. Next time it starts, it complains that the DB is locked and goes in slave mode.
> 
> In my setup, I am 100% certain that a given broker will access one and only one KahaDB, so I would like to configure ActiveMQ so that it doesn't put a lock on KahaDB. Is that possible? If yes, how?
> 
> Thanks a lot for your help!
> 
>  Fabrice