环境 -> 元数据库:mysql
执行hive命令, 第一个客户端正常, 第二个客户端就报错如下:
[root@fdc07 ~]# hive
Logging initialized using configuration in file:/opt/cloudera/parcels/CDH-5.16.2-1.cdh5.16.2.p0.8/etc/hive/conf.dist/hive-log4j.properties
WARNING: Hive CLI is deprecated and migration to Beeline is recommended.
hive> show tables;
FAILED: SemanticException org.apache.hadoop.hive.ql.metadata.HiveException: java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient
解决方案:
使用beeline
连接命令: /opt/cloudera/parcels/CDH/bin/beeline -u "jdbc:hive2://fdc07:10000"
[root@fdc07 test]# /opt/cloudera/parcels/CDH/bin/beeline -u "jdbc:hive2://fdc07:10000"
scan complete in 1ms
Connecting to jdbc:hive2://fdc07:10000
Connected to: Apache Hive (version 1.1.0-cdh5.16.2)
Driver: Hive JDBC (version 1.1.0-cdh5.16.2)
Transaction isolation: TRANSACTION_REPEATABLE_READ
Beeline version 1.1.0-cdh5.16.2 by Apache Hive
0: jdbc:hive2://fdc07:10000> show tables;
INFO : Compiling command(queryId=hive_20201221164242_e40955c7-c5d1-4fd2-83a4-7dc1ccf882a8): show tables
INFO : Semantic Analysis Completed
INFO : Returning Hive schema: Schema(fieldSchemas:[FieldSchema(name:tab_name, type:string, comment:from deserializer)], properties:null)
INFO : Completed compiling command(queryId=hive_20201221164242_e40955c7-c5d1-4fd2-83a4-7dc1ccf882a8); Time taken: 0.014 seconds
INFO : Executing command(queryId=hive_20201221164242_e40955c7-c5d1-4fd2-83a4-7dc1ccf882a8): show tables
INFO : Starting task [Stage-0:DDL] in serial mode
INFO : Completed executing command(queryId=hive_20201221164242_e40955c7-c5d1-4fd2-83a4-7dc1ccf882a8); Time taken: 0.018 seconds
INFO : OK
+---------------------+--+
| tab_name |
+---------------------+--+
| alarm_report_data |
| report_fdc_day |
| report_fdc_month |
| report_fdc_quarter |
| report_fdc_week |
| report_fdc_year |
+---------------------+--+
6 rows selected (0.107 seconds)
0: jdbc:hive2://fdc07:10000> !exit
Closing: 0: jdbc:hive2://fdc07:10000
You have new mail in /var/spool/mail/root
[root@fdc07 test]#