rhdfs没有连接

时间:2013-10-01 12:48:28

标签: windows r hadoop cygwin rhadoop

我已经设置了 HADOOP_CMD (hadoop路径)变量,但它没有采用路径,说没找到

library("rhdfs")
hdfs.init()
Sys.setenv(HADOOP_CMD="C:/cygwin64/usr/local/hadoop/bin/hadoop") 
Error in system(command, intern = TRUE) : 
'C:/cygwin64/usr/local/hadoop/bin/hadoop' not found

我已经在系统env变量中以及在cygwin中定义了HADOOP_CMD

export HADOOP_CMD="C:/cygwin64/usr/local/hadoop/bin/hadoop"

我错了,在这方面有任何帮助,谢谢。

1 个答案:

答案 0 :(得分:1)

HADOOP_HOME&在调用HADOOP_CMD

之前,应在R会话中设置hdfs.init()

在记录RHadoop

之前,请记住遵循检查点
  • R-Hadoop依赖项

    • rmr2 - RCpp, RJSONIO, digest, functional, stringr, plyr
    • rhdfs - rJava
  • 在运行init()

    之前,在R Session中导出env变量

    # requied
    Sys.setenv(HADOOP_HOME="/home/trendwise/apache/hadoop-1.0.4"); Sys.setenv(HADOOP_CMD="/home/trendwise/apache/hadoop-1.0.4/bin/hadoop"); Sys.setenv(HADOOP_STREAMING='/home/trendwise/apache/hadoop-1.0.4/contrib/streaming/hadoop-streaming-1.0.4.jar')

    #optional
    Sys.setenv(HADOOP_BIN="/home/trendwise/apache/hadoop-1.0.4/bin"); Sys.setenv(HADOOP_CONF_DIR="/home/trendwise/apache/hadoop-1.0.4/conf"); Sys.setenv(HIVE_HOME="/home/trendwise/apache/hive-0.10.0"); Sys.setenv(HBASE_HOME="/home/trendwise/apache/hbase-0.94.3");

    # Library Path Sys.setenv(LD_LIBRARY_PATH="/lib:/lib/x86_64-linux-gnu:/lib64:/usr/lib:/usr/lib64:/usr/local/lib:/usr/local/lib64:/usr/lib/jvm/jdk1.7.0_10/lib:/usr/lib/jvm/jdk1.7.0_10/jre/lib:/usr/lib/jvm/jdk1.7.0_10/jre/lib/amd64:/usr/lib/jvm/jdk1.7.0_10/jre/lib/amd64/server");

    # Loading library
    library(rmr2)
    library(rhdfs)

    # initializing
    hdfs.init()