rHadoop安装运行错误解决:
一、RHadoop的安装:
R语言在Linux中的安装:
(1).在r官网下载官方的Linux的R语言源程序包。
(2).用tar –xvzf命令解压数据包。
(3).在安装R之前应该把R依赖的库安装好,运行下面的命令:
yum install gcc gcc-c++(报“configure:error:NO f77 compiler found”错误)
yum install gcc-gfortran(报“configure:error:C++ preprocessor"/lib/cpp"fails sanity check”错误)
yum install readline-devel(报”–with-readline=yes (default) and headers/libs are not available”错误)
yum install libXt-devel(报”configure: error: –with-x=yes (default) and X11 headers/libs are not available”错误)
(4).安装完库之后切换到解压后的R-3.2.1目录下,执行:
./configure –enable-R-shlib –prefix=/home/Rhome –with-readline=yes –with-lib-libpng=yes –with-x=yes(全部都选择yes,否则会出现方向键和tab键不好用的现象)
(5).执行 make
(6).执行 make install
(7).配置r环境变量:
vi /etc/profile
加入:PATH=$PATH:/home/Rhome/bin
source /etc/profile
RHadoop的安装:.
1.下载RHadoop的三个相关程序包:rmr、rhdfs、rHBase
https://github.com/RevolutionAnalytics/RHadoop/wiki/Downloads
2.使用root用户操作。安装其他依赖包:
在命令行中输入R进入R语言编程环境
install.packages(“reshape2”)
install.packages(“Rcpp”)
install.packages(“iterators”)
install.packages(“itertools”)
install.packages(“digest”)
install.packages(“RJSONIO”)
install.packages(“functional”)
install.packages(“stringr”)
install.packages(“plyr”)
install.packages(“caTools”)
3.在环境变量文件中添加:
export HADOOP_STREAMING= HADOOPHOME/share/hadoop/tools/lib/hadoop−streaming−2.5.2.jarexportHADOOPCMD= H A D O O P H O M E / s h a r e / h a d o o p / t o o l s / l i b / h a d o o p − s t r e a m i n g − 2.5.2. j a r e x p o r t H A D O O P C M D = HADOOP_HOME/bin/hadoop
4.安装rhdfs包:运行命令 R CMD INSTALL rhdfs_1.0.8.tar.gz
5.安装rmr2包:运行命令 R CMD INSTALL rmr2_3.3.1.tar.gz
二、遇到的错误及问题:
1.hadoop streaming failed with error code 1:
解决:hadoop没有在/usr/bin下找到Rscript,于是从R的安装目录/usr/local/bin下做R和Rscript的符号链接到/usr/bin下,再次执行即可解决错误。即:
ln –s /Rhome/bin/R usr/bin
ln –s /Rhome/bin/Rscript usr/bin
http://blog.javachen.com/2013/07/20/install-rhadoop.html
2. Not a valid JAR: /home/hadoop/hadoop-2.5.2/contrib/streaming/hadoop-streaming-2.5.2.jar
解决:hadoop-sereaming环境变量没有配置对。重新配置。
参考网址:http://cos.name/2013/03/rhadoop2-rhadoop/
http://www.geedoo.info/tag/node-js
http://www.geedoo.info/installed-on-the-cloudera-hadoop-cdh-r-and-rhadoop-rhdfs-rmr2-rhbase-rhive.html