在cloudera集群中,我们正面临一个关于直线CLI的问题。我们正在尝试连接和执行hql文件,这些hql文件是alter语句,使用下面的直线CLI,它失败了,出现了以下错误。
[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>
我们在直线上尝试了使用以下方法进行连接,在2种方法中,1种方法失败,另一种方法有效。
第一种方法:
[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“(已废弃的)的连接,该连接工作正常,没有任何问题。我们需要使用带有"-u“和"-f”参数的直线。
集群信息:
我们已经验证了"HiveServer2“、"HiveMetastore”服务以及相关端口和web端口--所有这些都可以正常工作,没有任何问题。
在这个集群的初始设置过程中,由于具有"noexec“配置的安全策略,我们必须更改下面的配置,并明确提到"'-Djava.io.tmpdir=/var/log/cloudera-scm-server/yarntemp”(其中“/var/log/cloudera server”是具有775权限的单独挂载点)。
YARN configuration
1. ApplicationMaster Java Opts Base
2. Java Configuration Options for JobHistory Server
3. Java Configuration Options for NodeManager
4. Java Configuration Options for ResourceManager
Cloudera Manager --> YARN --> search for: Gateway Client Environment Advanced Configuration Snippet (Safety Valve) for hadoop-env.sh and add this:
HADOOP_CLIENT_OPTS="-Djava.io.tmpdir=/var/log/cloudera-scm-server/yarntemp"
请让我们知道直接使用-u和-f参数需要做些什么。任何帮助都会感激的。
提前谢谢。
发布于 2019-06-09 21:49:17
所以你想说的是,使用“直线”连接,使用“直线-u xxx -f”,是的,它不是。
看看你的日志,它看起来就像它的用户名和密码。
你能试试这样的东西吗?
beeline -u jdbc:hive2://hostname.domain.dom:10000 -n <yourname> -p <yourpassword> -f <filename.hql>
发布于 2020-05-03 18:12:06
它不适用于CDH47。它使用CDH514版本。这很好。我们可以用蜂壳来做
https://stackoverflow.com/questions/56516475
复制相似问题