1

I'm trying to create the database in azure databricks using sql script.

 %sql
    CREATE DATABASE DB_TEST;

failed with below error

org.apache.hadoop.hive.ql.metadata.HiveException: java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.metastore.HiveMetaStoreClient

Also, I have tried creating a table in default database, failed with same error.

Can someone help me on fixing the above issue?

jarlh
  • 42,561
  • 8
  • 45
  • 63
pythonUser
  • 183
  • 2
  • 7
  • 20

2 Answers2

0

the error message indicates that there is an issue with the Hive Metastore client -- which is used by Databricks to manage metadata related to tables and databases

  1. check if the Metastore service is running: Hive Metastore service running on your cluster

  2. check the configuration: make sure that the configuration of the Metastore client is correct(check hive-site.xml in /etc/hive/conf on cluster driver node. hive.metastore.uris should be set to the URL of the Metastore service)

  3. check the network connectivity: Make sure that there is no issue with the network connectivity between the cluster and the Metastore service(using telnet or nc command to check if you can connect to the Metastore)

  4. restart the Metastore service

Lemonina
  • 712
  • 2
  • 14
0

You may try below options if helps:

  • Use System.setSecurityManager(null) at start after importing java.lang.System
  • Restarting the virtual machine or System, this should also release the lock
  • Make hive.metastore.schema.verification=false in hive-site.xml file, this might help.
  • Use rm metastore_db/*.lck It can be found in your home/user directory. You can use the locate command to find it: locate metastore_db After removing the lock files, close the current session. Call hive shell in new session.