Thursday, March 23, 2017

Hive - Hive metastore database is not initialized

Problem


I encountered the following error when I tried to start up Hive

Exception in thread "main" java.lang.RuntimeException: Hive metastore database is not initialized. Please use schematool (e.g. ./schematool -initSchema -dbType ...) to create the schema. If needed, don't forget to include the option to auto-create the underlying database in your JDBC connection string (e.g. ?createDatabaseIfNotExist=true for mysql)

Solution


a. Delete the existing $DERBY_HOME/data/metastore_db with rm command

b. Stop the Derby server

c. Run schematool -initSchema -dbType derby

No comments:

Post a Comment

Hadoop - How to setup a Hadoop Cluster

Below is a step-by-step guide which I had used to setup a Hadoop Cluster Scenario 3 VMs involved: 1) NameNode, ResourceManager - Host...