Java – Removes the lock file from the hive Metastore database

Removes the lock file from the hive Metastore database… here is a solution to the problem.

Removes the lock file from the hive Metastore database

I get the following error in the hive database:

Caused by: ERROR XSDB6: Another instance of Derby may have already booted the database /home/usr/metastore_db

I’ve heard that I can fix it by deleting the lock file – how safe is that? There is a db.lck file in the metastore_db folder with a line containing some ID strings.

Solution

Yes, you can delete that lck file. It just creates the id for that derby instance.

Also note that if you change the local directory and then start Hive, you will see another metastore_db directory created with the lck file, but all your previous data will be on your first metastore_db instead of the new metastore_db

Related Problems and Solutions