Hive: Unable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient
java.lang.RuntimeExceptionUnable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClientHive (or Spark with Hive support) could not create a metastore client. The class name is only the wrapper: the "Caused by" lines underneath say whether the metastore service was unreachable or the metastore database could not be opened.
Common causes
- hive.metastore.uris points to a metastore service that is down or unreachable.How to confirm: The cause mentions "Could not connect to meta store" or a connection refused on port 9083.
- Embedded or local metastore mode cannot open its database: missing JDBC driver, wrong URL or credentials, schema not initialized.How to confirm: The cause mentions JDBC, DataNucleus, or "Version information not found in metastore".
- Kerberos or other authentication to the metastore fails.How to confirm: The cause mentions GSS, SASL or "Failed to find any Kerberos tgt".
How to fix it
Point clients at the running metastore service and check it is listening.
| Setting | Default | Note |
|---|---|---|
hive.metastore.uris | empty (embedded metastore) |
For a new metastore database, initialize the schema with schematool, and put the JDBC driver on the classpath.
schematool -dbType mysql -initSchemaWhere the message comes from
JavaUtils.javainapache/hiveatrel/release-4.2.1- Message checked in Hive 4.2.1
Message template in the source: Unable to instantiate %s