Hive CLI启动报错Unable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient

Hive CLI启动报错Unable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient

Background

When starting the Hive client on the Hadoop cluster, the following error is reported:

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

Generally, this is because the metastore service is not enabled.

Solution

  1. Pre: HIVE_HOME has been added as a system environment variable
  2. input the command
    hive --service metastore &
➜  ext source ~/.zshrc                                                                                                
➜  ext hive --service metastore &
[1] 39705
➜  ext 2023-05-28 23:00:55: Starting Hive Metastore Server
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/Users/onetwothree/BIGDATA_DEV/hive-3.1.2/lib/log4j-slf4j-impl-2.10.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/opt/homebrew/Cellar/hadoop/3.3.1/libexec/share/hadoop/common/lib/slf4j-log4j12-1.7.30.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
  1. Enter the command Hive again to enter the Hive interactive command line interface:
➜  lib hive
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/Users/onetwothree/BIGDATA_DEV/hive-3.1.2/lib/log4j-slf4j-impl-2.10.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/opt/homebrew/Cellar/hadoop/3.3.1/libexec/share/hadoop/common/lib/slf4j-log4j12-1.7.30.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
Hive Session ID = 52d1397e-df67-40b5-b47f-a1b4d4adfd04

Logging initialized using configuration in jar:file:/Users/onetwothree/BIGDATA_DEV/hive-3.1.2/lib/hive-common-3.1.2.jar!/hive-log4j2.properties Async: true
Hive Session ID = bc2fd479-9774-4da3-b395-48b91f93a3a8
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: 0.391 seconds, Fetched: 1 row(s)
hive>

Guess you like

Origin blog.csdn.net/liuwei0376/article/details/130919128