ActiveMQ will not restart because KahaDB is locked

Locally, to start / stop ActiveMQ (5.6) on my dev machine, I simply run ./activemq start and ./activemq stop respectively.

On our QA machine, we installed it as a service and run service activemq start and service activemq stop respectively.

I just went over to the QA machine crash and issued service activemq stop , then service activemq start to restart it.

I see that a process id is being created, and if I run ps -aef | grep activemq ps -aef | grep activemq , I see a live process of breathing the ActiveMQ server.

But if I go to http://<qa-server>:8161/admin , I get a typical error that you see when the server is shut down:

Firefox cannot connect to the server at: 8161.

Edit: Now I tried the ./active start and service activemq start , and both of them cause the same problem: I see a process that is being created but nothing works in the web admin tool.

I checked the ActiveMQ home directory and can't see any type of logs/ directory, so I'm not even sure where to start debugging the problem.

Either AMQ does not restart, or its web administrator application does not restart or does not work properly; In any case, I have no idea where to start. Thanks in advance!

Edit

I see the following error in data/activemq.log :

2012-10-07 11:37: 14,501 | INFO | The database / qa -server / kahadb / lock is locked ... waiting 10 seconds to unlock the database. Reason: java.io.IOException: The file '/ qa-server / kahadb / lock' could not be locked. | org.apache.activemq.store.kahadb.MessageDatabase | main 2012-10-07 11:37: 24,504 | INFO | The database / qa -server / kahadb / lock is locked ... waiting 10 seconds to unlock the database. Reason: java.io.IOException: The file '/ qa-server / kahadb / lock' could not be locked. | org.apache.activemq.store.kahadb.MessageDatabase | Main

+4
source share
4 answers

Turns out there were several AMQ servers in our QA environment. When I closed the first server, an exception was thrown for some reason, and therefore it did not release the lock. Ownership of this castle then transferred to another instance of AMQ (the first server was the master, the second was the slave).

When I tried to restart the first server (master), it will not restart, because the 2nd server has a lock. I turned off the second server and the lock was released, which allowed me to restart both of them.

+3
source

Check the data/ directory for logs.

And is that a typo? :8161.admin
Try :8161/admin

+2
source

Stopping the service does not guarantee that the service is stopped. Windows spans threads, and after a while it is assumed that the service is stopped. Always check, check, kill a process if you still see it running in the process list. This can remove the locks that it holds.

0
source

If you did not provide the above example, follow these steps:

  • Go to task manager and completely destroy the whole java process.
  • Run the activemq batch file as administrator

Make sure this works fine by opening below in your local browser: http: // localhost: 8161 /

0
source

Source: https://habr.com/ru/post/1438269/


All Articles