无法在centos中安装rhdfs

时间:2014-07-01 11:33:48

标签: r hadoop hdfs rstudio rstudio-server

$ sudo R CMD INSTALL rhdfs
* installing to library ‘/usr/lib64/R/library’
* installing *source* package ‘rhdfs’ ...
** R
** inst
** preparing package for lazy loading
** help
*** installing help indices
  converting help for package ‘rhdfs’
    finding HTML links ... done
    hdfs-file-access                        html  
    hdfs-file-manip                         html  
    hdfs.defaults                           html  
    hdfs.file-level                         html  
    initialization                          html  
    rhdfs                                   html  
    text.files                              html  
** building package indices
** testing if installed package can be loaded
Error : .onLoad failed in loadNamespace() for 'rhdfs', details:
  call: fun(libname, pkgname)
  error: Environment variable HADOOP_CMD must be set before loading package rhdfs
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/usr/lib64/R/library/rhdfs’

我尝试过多次迭代,但仍然没有。我无法安装rhdfs和rmr2。我已经在cludera的R环境中设置了HADOOP_CMD,JAVA_HOME,PATH和rjava。我根本无法加载rhdfs。请帮助解决这个问题,或者我应该从R-R,Studio卸载所有内容并重新安装。请帮忙..

当我尝试在R中安装rhdfs时,它给了我这个错误:

> install.packages("rhdfs")
Installing package into ‘/home/supstat/R/x86_64-unknown-linux-gnu-library/2.13’
(as ‘lib’ is unspecified)
Warning in install.packages :
  package ‘rhdfs’ is not available (for R version 3.1.0)

2 个答案:

答案 0 :(得分:0)

我在尝试安装RHadoop时面临几个问题,而且所有问题都与rjava有关。导出HADOOP_CMDHADOOP_STREAMING变量。之后,您需要告诉R库路径指向Java安装的位置:

export LD_LIBRARY_PATH=/usr/lib/jvm/java-7-oracle/jre/lib/amd64/server

然后,您需要运行以下命令:

R CMD javareconf -e

之后你应该能够安装rhdfs和rmr2。如果我没记错,你需要在安装rhdfs之前安装rmr2,否则可能是相反的。

编辑尝试配置并从R:

内部安装
Sys.setenv(HADOOP_CMD="the same value you used outside R")
Sys.setenv(HADOOP_STREAMING="same as above")
install.packages("rhdfs_1.0.8.tar.gz", repos=NULL, type="source")

答案 1 :(得分:0)

  1. 在.bashrc文件中,在末尾添加以下行 导出LD_LIBRARY_PATH =“ / usr / lib / jvm / java-8-oracle / jre / lib / amd64 / server”

  2. 获取bashrc文件的源代码或直接关闭终端并打开一个新的

  3. $ R CMD javareconf -e

  4. $ R

  5. 在R中运行以下命令:
      

    Sys.setenv(HADOOP_CMD =“ / home // hadoop-2.5.0-cdh5.3.2 / bin / hadoop”)   Sys.setenv(HADOOP_STREAMING =“ / home // hadoop-2.5.0-cdh5.3.2 / bin / hadoop”)   install.packages(“ / home // Downloads / rhbase_1.2.1.tar.gz”,repos = NULL,键入=“ source”)

这假设rhbase_1.2.1.tar.gz在主目录下的Downloads目录下