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

Configure external mySQL for hive metastore

Hello,

 

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.

 

 

http://www.cloudera.com/content/cloudera/en/documentation/core/latest/topics/cm_ig_mysql.html

 

 

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

 

Thanks,

Silaphet

1 REPLY 1

Re: Configure external mySQL for hive metastore

Explorer

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)

Transaction isolation: TRANSACTION_REPEATABLE_READ

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:

/opt/cloudera/parcels/CDH/lib/hive/scripts/metastore/upgrade/mysql