Hive - Unable to Instantiate Meta Store Client

2021-12-30

Problem

I use docker-compose to build my development Hadoop cluster, and Hive is one of the components. I received an error message:

HiveException java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient

Diagnose

I started hive with a debug mode by using:

hive -hiveconf hive.root.logger=DEBUG,console

It returns error message:

ERROR utils.MetaStoreUtils: Got exception: java.net.URISy ntaxException Illegal character in hostname at index 37: thrift://hive-metastore.docker-hadoop_default:9083 Caused by: MetaException(message:Got exception: java.net.URISyntaxException Illegal character in hostname at index 37: thrift://hive-metastore.docker-hadoop_default:9083)

It looks like the system complained about the hostname thrift://hive-metastore.docker-hadoop_default:9083.

I did some Google and the hive system does not like the character "_"

Solution

The hostname was auto-generated by Docker Compose, so I need to change the default name explicitly. Docker Compose use yml to config, what we need to do is to ensure we are using docker compose yml version 3.5 or above. You can change the version by using:

version: "3.5"

And then set default network by using:

networks: default: name: newnetworkname

After updating the yml file everything works fine now

Hive Session ID = 5d4e4c64-dd7b-4c09-b000-7a2675d27ead Hive-on-MR is deprecated in Hive 2 and may not be available in the future versions. Consider using a different execution engine (i.e. spark, tez) or using Hive 1.X releases. hive> show databases; OK default Time taken: 1.021 seconds, Fetched: 1 row(s) hive>