如何使用配置单元jdbc运行beeline连接

时间:2018-08-30 22:05:28

标签: jdbc hive beeline

我有多个问题被阻止,因为我是Hadoop,hive和radoop Rapidminer的新手。 首先,我正在Windows 8,Hadoop 2.6.2,Apache Hive 2.1.1上工作。 HDFS,Yarn和Hive都工作正常。 当我运行蜂巢时,它工作正常,我可以显示数据库和运行表。 hiveserver在端口10000和Web UI端口10002上运行,但是仍然出现此错误

ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console.

当我想通过jdbc驱动程序连接到mysql时,我运行蜂巢直线,我遇到此错误

E:\tweets\hadoop\hive2_1\bin>beeline -u jdbc:hive2://localhost:10000
Fichier introuvable
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/hadoop/hiv
e/conf/HiveConf
        at java.lang.Class.getDeclaredMethods0(Native Method)
        at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
        at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
        at java.lang.Class.getMethod0(Class.java:3018)
        at java.lang.Class.getMethod(Class.java:1784)
        at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:544
)
        at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526)

Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.hive.conf.HiveCon
f
        at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:338)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        ... 7 more
    enter code here

在火花蜂线上,我遇到此错误,并且连接已关闭

beeline> !connect jdbc:hive2://localhost:10000/
Connecting to jdbc:hive2://localhost:10000/
Enter username for jdbc:hive2://localhost:10000/: hiveuser
Enter password for jdbc:hive2://localhost:10000/: ************
18/08/30 22:51:04 INFO Utils: Supplied authorities: localhost:10000
18/08/30 22:51:04 INFO Utils: Resolved authority: localhost:10000
18/08/30 22:51:05 INFO HiveConnection: Will try to open client transport with JD
BC Uri: jdbc:hive2://localhost:10000/
18/08/30 22:51:05 INFO HiveConnection: Could not open client transport with JDBC
 Uri: jdbc:hive2://localhost:10000/
18/08/30 22:51:05 INFO HiveConnection: Transport Used for JDBC connection: null
Error: Could not open client transport with JDBC Uri: jdbc:hive2://localhost:100
00/: null (state=08S01,code=0)
0: jdbc:hive2://localhost:10000/ (closed)>

此配置正在运行

Connecting to jdbc:hive2://
Connected to: Apache Hive (version 2.1.1)
Driver: Hive JDBC (version 2.1.1)
Transaction isolation: TRANSACTION_REPEATABLE_READ
Beeline version 2.1.1 by Apache Hive
hive>

我真的不知道beeline蜂巢和spark之间有什么区别吗? 还有其他配置要设置吗? 我非常感谢您的帮助。

0 个答案:

没有答案