1
我,我們配置所有(顯然)正確運行RHive包在R和rhive.connect()錯誤ClassNotFoundException的
Sys.setenv(HADOOP_CMD="/opt/cloudera/parcels/CDH-5.4.5-1.cdh5.4.5.p0.7/bin/hadoop")
Sys.setenv(RHIVE_HIVESERVER_VERSION="2");
library("rJava", lib.loc="/usr/lib64/R/library")
library("RJDBC", lib.loc="/usr/lib64/R/library")
library("rhdfs", lib.loc="/usr/lib64/R/library")
hdfs.init()
library("Rserve", lib.loc="~/R/x86_64-redhat-linux-gnu-library/3.2")
library("RHive", lib.loc="~/R/x86_64-redhat-linux-gnu-library/3.2")
rhive.init()
rhive.connect(host="oururl",port="ourport", defaultFS="hdfs://ourhdfsservice", hiveServer2=TRUE ,updateJar=FALSE)
當我們收到的下一個錯誤(我想說HIVE_HOME
和HADOOP_HOME
正確定義)
的錯誤,我們得到:
Exception in thread "Thread-12" java.lang.RuntimeException: java.sql.SQLException: java.lang.ClassNotFoundException
at com.nexr.rhive.hive.HiveJdbcClient$HiveJdbcConnector.connect(HiveJdbcClient.java:337)
at com.nexr.rhive.hive.HiveJdbcClient$HiveJdbcConnector.run(HiveJdbcClient.java:322)
Caused by: java.sql.SQLException: java.lang.ClassNotFoundException
at com.nexr.rhive.hive.DatabaseConnection.connect(DatabaseConnection.java:41)
at com.nexr.rhive.hive.HiveJdbcClient$HiveJdbcConnector.connect(HiveJdbcClient.java:330)
... 1 more
Caused by: java.lang.ClassNotFoundException
at RJavaClassLoader.findClass(RJavaClassLoader.java:383)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:191)
at com.nexr.rhive.hive.DatabaseConnection.connect(DatabaseConnection.java:38)
... 2 more
Error: java.lang.IllegalStateException: Not connected to hiveserver
這裏會發生什麼?我們嘗試重新安裝Hive,但同樣的錯誤。