Support Questions
Find answers, ask questions, and share your expertise

Configure external mySQL for hive metastore



This is first time we are configuring mySQL as external databases for hive metastore and rest of CM components (Service Monitor, activity monitor etc...) We are separating to have one node for CM and anothe node for mySQL. 


We were able to get the CM management services up running but it takes more than five minutes login to hive CLI. Once in Hive CLI, hive commands just hangs and can't run any hive queries.


When I look at the "metastore" database in mysql, I don't see any tables created. Below is the link that I followed.



What am I missing here? not enough permission or something else?





Re: Configure external mySQL for hive metastore


The Hive CLI should work, but it is deprecated. You should use be beeline client instead, like so:


# beeline

Beeline version 1.1.0-cdh5.4.2 by Apache Hive

beeline> !connect jdbc:hive2://mfernest-bootc-1:10000

Connecting to jdbc:hive2://mfernest-bootc-1:10000

Enter username for jdbc:hive2://mfernest-bootc-1:10000: metastore

Enter password for jdbc:hive2://mfernest-bootc-1:10000: ********

Connected to: Apache Hive (version 1.1.0-cdh5.4.2)

Driver: Hive JDBC (version 1.1.0-cdh5.4.2)


0: jdbc:hive2://mfernest-bootc-1:10000> show tables;


|   tab_name    |


| parquet_test  |


1 row selected (0.133 seconds)


Do you recall testing the connection to the metastore database through CM? When the Hive service is first started, it will (or should) connect to the database and source the scheme for the metastore.



You can perform this step yourself by logging in to MySQL and sourcing this schema. If you've installed CDH using parcels, the schema are located here: