2013-05-17 94 views
0

我試圖在CDH4環境中配置RHive。 在R中讀取包'RHive'時,下面的錯誤被返回。 我猜這是由於錯誤的家園。 如果是這樣,那麼正確的是什麼? 或者如果這不是原因,那有什麼問題?CDH4中的Hadoop和Hive Homes

任何幫助將不勝感激。

謝謝。

> Sys.setenv(HIVE_HOME="/etc/hive") 
> Sys.setenv(HADOOP_HOME="/etc/hadoop") 
> library(RHive) 
Loading required package: rJava 
Loading required package: Rserve 
This is RHive 0.0-7. For overview type '?RHive'. 
HIVE_HOME=/etc/hive 
[1] "there is no slaves file of HADOOP. so you should pass hosts argument when you call rhive.connect()." 
Error : .onLoad failed in loadNamespace() for 'RHive', details: 
    call: .jnew("org/apache/hadoop/conf/Configuration") 
    error: java.lang.ClassNotFoundException 
In addition: Warning message: 
In file(file, "rt") : 
    cannot open file '/etc/hadoop/conf/slaves': No such file or directory 
Error: package/namespace load failed for 'RHive' 
+0

似乎很自我解釋。您缺少指定集羣中哪些節點的「從屬」文件。 – greedybuddha

回答

0

您應該單獨設置HADOOP_CONF_DIR。 嘗試導出$ HADOOP_CONF_DIR =/etc/hadoop/conf/conf.pseudo

conf.pseudo具有從屬文件。

雖然我很想知道您是否可以讓CDH4使用RHive。

+0

感謝您的迴應!我會給它一個鏡頭併發布結果。 –

+0

似乎像RHive可以使用CDH4。你可以看看http://stackoverflow.com/questions/16783549/rhive-not-working-with-cdh4。雖然我沒有機會再看一遍。如果你確實得到它的工作,那麼請張貼你是如何做到的。謝謝。 –

2
Had the problems but solved it. Downside is that I have to keep track of a bunch of sym links 

After struggling with install RHive_0.0-7.tar.gz on CDH 4.7.x and getting: 
Warning in file(file, "rt") : 
cannot open file '/etc/hadoop/conf/slaves': No such file or directory 
[1] "there is no slaves file of HADOOP. so you should pass hosts argument when you call rhive.connect()." 

In /etc/hadoop/conf 
I added a the following sym link ----> ln -s /opt/cloudera/parcels/CDH-4.4.0-1.cdh4.4.0.p0.39/etc/hadoop/conf.empty/slaves slaves 
(why Cloudera CHD 4.7 installs in /opt without creating the proper sym links from /usr/lib is puzzling) 

I also defined the followingin /usr/lib64/R/etc/Renviron 
## set hive paths 
HIVE_HOME='/opt/cloudera/parcels/CDH-4.4.0-1.cdh4.4.0.p0.39/lib/hive' 
HADOOP_HOME='/opt/cloudera/parcels/CDH-4.4.0-1.cdh4.4.0.p0.39/lib/hadoop' 
LD_LIBRARY_PATH='/opt/cloudera/parcels/CDH-4.4.0-1.cdh4.4.0.p0.39/lib/hadoop' 

At a shell prompt I ran R CMD INSTALL RHive_0.0-7.tar.gz 
Installation Happiness!! 

++++++ 
Inside R-Studio (server) 

> 
> library(RHive) 
Loading required package: rJava 
Loading required package: Rserve 
This is RHive 0.0-7. For overview type ‘?RHive’. 
HIVE_HOME=/opt/cloudera/parcels/CDH-4.4.0-1.cdh4.4.0.p0.39/lib/hive 
call rhive.init() because HIVE_HOME is set. 
rhive.init() 
> 
+++++++