我在两台服务器上安装了CDH 6.2
,device1是主服务器。
CM Web UI中没有任何错误,但是,当我在设备1中运行hive命令行:show databaes;
时,出现如下异常:
dennis@device1:~$ hive
/opt/cloudera/parcels/CDH-6.2.0-1.cdh6.2.0.p0.967373/bin/../lib/hive/conf/hive-env.sh: line 24: /opt/cloudera/parcels/CDH-6.2.0-1.cdh6.2.0.p0.967373/lib/hbase/hbase-hadoop2-compat.jar: Permission denied
/opt/cloudera/parcels/CDH-6.2.0-1.cdh6.2.0.p0.967373/bin/../lib/hive/conf/hive-env.sh: line 25: /opt/cloudera/parcels/CDH-6.2.0-1.cdh6.2.0.p0.967373/lib/hbase/lib/htrace-core.jar: Permission denied
/opt/cloudera/parcels/CDH-6.2.0-1.cdh6.2.0.p0.967373/bin/../lib/hive/conf/hive-env.sh: line 26: /opt/cloudera/parcels/CDH-6.2.0-1.cdh6.2.0.p0.967373/lib/hbase/hbase-common.jar: Permission denied
/opt/cloudera/parcels/CDH-6.2.0-1.cdh6.2.0.p0.967373/bin/../lib/hive/conf/hive-env.sh: line 27: /opt/cloudera/parcels/CDH-6.2.0-1.cdh6.2.0.p0.967373/lib/hbase/hbase-server.jar: Permission denied
/opt/cloudera/parcels/CDH-6.2.0-1.cdh6.2.0.p0.967373/bin/../lib/hive/conf/hive-env.sh: line 28: /opt/cloudera/parcels/CDH-6.2.0-1.cdh6.2.0.p0.967373/lib/hbase/hbase-hadoop-compat.jar: Permission denied
/opt/cloudera/parcels/CDH-6.2.0-1.cdh6.2.0.p0.967373/bin/../lib/hive/conf/hive-env.sh: line 29: /opt/cloudera/parcels/CDH-6.2.0-1.cdh6.2.0.p0.967373/lib/hbase/hbase-protocol.jar: Permission denied
/opt/cloudera/parcels/CDH-6.2.0-1.cdh6.2.0.p0.967373/bin/../lib/hadoop/libexec/hadoop-functions.sh: line 2331: HADOOP_ORG.APACHE.HADOOP.HBASE.UTIL.GETJAVAPROPERTY_USER: bad substitution
/opt/cloudera/parcels/CDH-6.2.0-1.cdh6.2.0.p0.967373/bin/../lib/hadoop/libexec/hadoop-functions.sh: line 2426: HADOOP_ORG.APACHE.HADOOP.HBASE.UTIL.GETJAVAPROPERTY_OPTS: bad substitution
WARNING: Use "yarn jar" to launch YARN applications.
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/opt/cloudera/parcels/CDH-6.2.0-1.cdh6.2.0.p0.967373/jars/log4j-slf4j-impl-2.8.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/opt/cloudera/parcels/CDH-6.2.0-1.cdh6.2.0.p0.967373/jars/slf4j-log4j12-1.7.25.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]
Logging initialized using configuration in jar:file:/opt/cloudera/parcels/CDH-6.2.0-1.cdh6.2.0.p0.967373/jars/hive-common-2.1.1-cdh6.2.0.jar!/hive-log4j2.properties Async: false
WARNING: Hive CLI is deprecated and migration to Beeline is recommended.
hive> show databases;
FAILED: SemanticException org.apache.hadoop.hive.ql.metadata.HiveException: java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient
hive>
但是,当我运行hive命令行时,device2上没有任何异常。
此外,在Hue
答案 0 :(得分:0)
您可能在device1上没有Hive服务的网关,而仅在device2上(可能也有Hive MetaStore)。另请参见How Hive Configurations are Propagated to Hive Clients(强调我的观点):
由于Hive服务没有辅助角色,因此需要另一种机制来实现将客户端配置传播到群集中的其他主机。在Cloudera Manager中,网关角色履行此功能。无论是在安装时还是在以后添加Hive服务,请确保将网关角色分配给群集中的主机。 如果您没有网关角色,则不会部署客户端配置。
您的device1没有客户端配置,因此无法与Hive MetaStore建立连接。
您还应该检查复制输出开始时得到的错误消息(强调我的问题):
/opt/cloudera/parcels/CDH-6.2.0-1.cdh6.2.0.p0.967373/bin /../ lib / hive / conf / hive-env.sh:第24行:/ opt / cloudera /parcels/CDH-6.2.0-1.cdh6.2.0.p0.967373/lib/hbase/hbase-hadoop2-compat.jar:权限被拒绝
配置单元用户无法访问某些目录可能存在权限问题。
最后一点是您应该切换到直线。由于输出中的以下消息显示不建议使用Hive CLI:
警告:不建议使用Hive CLI,建议迁移到Beeline。
另请参阅Migrating from Hive CLI to Beeline: A Primer,这是Cloudera fom 2014的指南:
最近,Hive社区(由Cloudera工程师领导)引入了HiveServer2,这是一种增强的Hive服务器,用于多客户端并发和改进的身份验证,还为通过JDBC和ODBC连接的客户端提供了更好的支持。现在推荐使用Beeline作为命令行界面的HiveServer2。 HiveServer1和Hive CLI已弃用,后者甚至无法与HiveServer2一起使用。