0

我已经设置了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

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

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

我在哪里错了,在这个方向上的任何帮助,谢谢。

4

1 回答 1

1

HADOOP_HOME&HADOOP_CMD应该在 R 会话中设置,在调用之前hdfs.init()

还要记住在启动 RHadoop 之前遵循检查点

  • R-Hadoop 依赖项

    • rmr2 -RCpp, RJSONIO, digest, functional, stringr, plyr
    • rhdfs -rJava
  • 运行前在 R Session 中导出环境变量init()

    # 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()

于 2013-10-11T05:46:08.543 回答