Hive 直线-无当前连接-未找到默认hs2连接配置

Hive 直线-无当前连接-未找到默认hs2连接配置,hive,cloudera,cloudera-manager,beeline,Hive,Cloudera,Cloudera Manager,Beeline,我们在一个cloudera集群中面临一个关于beeline CLI的问题。我们正在尝试连接和执行hql文件,这些文件是使用beeline CLI的alter语句,如下所示,但由于以下错误而失败 [srvcacc@hostname ~]$ beeline -u jdbc:hive2://hostname.domain.dom:10000 --verbose=true --showWarnings=true WARNING: Use "yarn jar" to launch YARN applica

我们在一个cloudera集群中面临一个关于beeline CLI的问题。我们正在尝试连接和执行hql文件,这些文件是使用beeline CLI的alter语句,如下所示,但由于以下错误而失败

[srvcacc@hostname ~]$ beeline -u jdbc:hive2://hostname.domain.dom:10000 --verbose=true --showWarnings=true
WARNING: Use "yarn jar" to launch YARN applications.
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/lib/hive/lib/log4j-slf4j-impl-2.8.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/lib/zookeeper/lib/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]
ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console. Set system property 'org.apache.logging.log4j.simplelog.StatusLogger.level' to TRACE to show Log4j2 internal initialization logging.
Beeline version 2.1.1-cdh6.1.1 by Apache Hive
Default hs2 conection config file not found
0: jdbc:hive2://hostname.domain.dom:10000> show databases;
No current connection
0: jdbc:hive2://hostname.domain.dom:10000>
我们已经尝试了使用以下方法进行直线连接,两种方法中有一种失败,另一种有效

第一种方法:

[srvcacc@hostname ~]$ beeline -u jdbc:hive2://hostname.domain.dom:10000
第二种方法:

[srvcacc@hostname ~]$ beeline
WARNING: Use "yarn jar" to launch YARN applications.
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/lib/hive/lib/log4j-slf4j-impl-2.8.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/lib/zookeeper/lib/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]
ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console. Set system property 'org.apache.logging.log4j.simplelog.StatusLogger.level' to TRACE to show Log4j2 internal initialization logging.
Beeline version 2.1.1-cdh6.1.1 by Apache Hive
beeline> !connect jdbc:hive2://hostname.domain.dom:10000
Connecting to jdbc:hive2://hostname.domain.dom:10000
Enter username for jdbc:hive2://hostname.domain.dom:10000:
Enter password for jdbc:hive2://hostname.domain.dom:10000:
Connected to: Apache Hive (version 2.1.1-cdh6.1.1)
Driver: Hive JDBC (version 2.1.1-cdh6.1.1)
Transaction isolation: TRANSACTION_REPEATABLE_READ
0: jdbc:hive2://hostname.domain.do>
第一种方法因以下错误而失败

Default hs2 conection config file not found
0: jdbc:hive2://hostname.domain.dom:10000> show databases;
No current connection
第二种方式连接没有任何错误

我们使用-d参数尝试连接,并明确提到了驱动程序“org.apache.hive.jdbc.HiveDriver”,即使这样,也会出现与“未找到默认hs2连接配置”相同的错误。我们还尝试了与“Hive CLI”(已弃用)的连接,该连接可以正常工作。我们需要使用带“-u”和“-f”参数的直线

群集信息:

  • RHEL 7.5上CDH版本6.1.1的5个节点(一个主节点和4个数据节点)群集
  • HiveServer2、Hive Metastore和webHcat服务器位于同一服务器(主节点)中
  • 到配置单元的连接没有任何身份验证机制
我们已经验证了“HiveServer2”、“HiveMetastore”服务以及相关端口和web UI端口,所有这些都正常工作,不会出现任何问题

在这个集群的初始设置过程中,由于/tmp的安全策略具有“noexec”配置,我们必须更改以下配置,并明确提到“'-Djava.io.tmpdir=/var/log/cloudera scm server/yarntemp”(其中“/var/log/cloudera scm server”是具有775权限的单独装载点)

参考:

请让我们知道需要为beeline执行哪些操作才能使用-u和-f参数。任何帮助都将不胜感激


提前谢谢。

所以你想说使用“beeline”连接,而使用“beeline-uxxx-fyyy”则没有

看看你的日志,它似乎是由用户名和密码组成的

你能试试这样的吗

beeline -u jdbc:hive2://hostname.domain.dom:10000 -n <yourname> -p <yourpassword> -f <filename.hql>
beeline-ujdbc:hive2://hostname.domain.dom:10000-n-p-f

所以你想说,使用“beeline”连接,而使用“beeline-uxxx-fyyy”则没有

看看你的日志,它似乎是由用户名和密码组成的

你能试试这样的吗

beeline -u jdbc:hive2://hostname.domain.dom:10000 -n <yourname> -p <yourpassword> -f <filename.hql>
beeline-ujdbc:hive2://hostname.domain.dom:10000-n-p-f

它在CDH47上不起作用。它与CDH514版本一起工作。很好。我们可以用Hive shell来做,但CDH47不起作用。它与CDH514版本一起工作。很好。我们可以使用HiveShell来实现这一点

正如您所说,是的,只是“beeline”连接,但是“beeline-uJDBC:hive2://xxxxx”-f“不行。我们没有任何用户名和密码来连接蜂巢。没有身份验证机制。但是在日志中,提到了输入用户名和密码。是的,它提示输入用户名和密码,但我们没有提供任何内容。尝试在我给您的直线查询中为-u和-p提供“”,看看它是否如您所说的那样工作,是的,只是“beeline”连接,但“beeline-ujdbc:hive2://xxxxx”-f“不行。我们没有任何用户名和密码来连接蜂巢。没有身份验证机制。但是在日志中,提到了输入用户名和密码。是的,它提示输入用户名和密码,但我们没有提供任何内容。尝试在我给您的直线查询中为-u和-p输入“”,看看是否有效