Hive Metastore does not start, shows error message "Failed to get schema version"
search cancel

Hive Metastore does not start, shows error message "Failed to get schema version"

book

Article ID: 294914

calendar_today

Updated On:

Products

Services Suite

Issue/Introduction

Symptoms:

When trying to start Hive Metastore with Ambari, the following error is displayed:

 

The error message is shown below:

resource_management.core.exceptions.Fail: Execution of 'export HIVE_CONF_DIR=/etc/hive/conf.server ; /usr/phd/current/hive-metastore/bin/schematool -initSchema -dbType mysql -userName hive -passWord [PROTECTED]' returned 1. Metastore connection URL:	 jdbc:mysql://dn2.lab/hive?createDatabaseIfNotExist=true
Metastore Connection Driver :	 com.mysql.jdbc.Driver
Metastore connection User:	 hive
org.apache.hadoop.hive.metastore.HiveMetaException: Failed to get schema version.
*** schemaTool failed ***

Environment


Cause

The reason for this issue is that the Hive Metastore cannot access the Hive database.

Resolution

During the installation of Hive, a database is generally set up or initiated. The above error indicates that for some reason, the Hive Metastore cannot access this database.
 

1. In Ambari under Hive/Configs/Advanced, confirm that the following configurations are correct:

2. Confirm that the relational database management system (RDMS) in use allows access to the Hive Database from the Hive Metastore host by following similar steps as in shown in this article: HiveServer2 fails to start because host is not allowed to connect to this MySQL server.

3. Restart the Hive Metastore with Ambari once again.