1.ubuntu,hadoop,R,jdk安装好
2.下载Rhadoop项目的的三个包,rmr,hdfs,rHBase存放到Downloads/R。
3.切换到root
4.安装依赖的库
~R CMD javareconf
~R
>install.packages("rJava")
reshape2,Rcpp,iterators,itertools,digest,RJSONIO,functional
5.安装rhdfs库
环境变量
export JAVA_HOME=/home/csf/Downloads/jdk1.8.0_31
HADOOP_CMD=/home/csf/Downloads/hadoop/bin/hadoopHADOOP_STREAMING=/home/csf/Downloads/hadoop/share/hadoop/tools/lib/hadoop-streaming-2.2.0.jar6.
csf@ubuntu:~/Downloads/hadoop$ . /etc/environment
csf@ubuntu:~/Downloads/hadoop$ cd ..csf@ubuntu:~/Downloads$ R CMD INSTALL /R/rhdfs_1.0.8.tar.gzWarning: invalid package ‘/R/rhdfs_1.0.8.tar.gz’Error: ERROR: no packages specifiedcsf@ubuntu:~/Downloads$ R CMD INSTALL /R/rhdfs_1.0.8.tar.gzWarning: invalid package ‘/R/rhdfs_1.0.8.tar.gz’Error: ERROR: no packages specifiedcsf@ubuntu:~/Downloads$ R CMD INSTALL R/rhdfs_1.0.8.tar.gz* installing to library ‘/usr/local/lib/R/site-library’Error: ERROR: no permission to install to directory ‘/usr/local/lib/R/site-library’csf@ubuntu:~/Downloads$ sudo su[sudo] password for csf: root@ubuntu:/home/csf/Downloads# R CMD INSTALL R/rhdfs_1.0.8.tar.gz* installing to library ‘/usr/local/lib/R/site-library’* installing *source* package ‘rhdfs’ ...** R** inst** preparing package for lazy loading** help*** installing help indices** building package indices** testing if installed package can be loaded* DONE (rhdfs)root@ubuntu:/home/csf/Downloads# ^Croot@ubuntu:/home/csf/Downloads#7.确保安装所有的库
这里Rcpp没有安装成功,折腾了半天,
使用下面这个命令删除了Rcpp的相关文件夹
http://zhidao.baidu.com/link?url=czeXx5lWhQc-ATAfgDN3YFaIsftg0D6KskzphiUi6s2a3uA4tbtN82365wo1_1LvwsQi--dY75GpquUYrgDana
8.重新安装plyr,reshape2等
9.
> library(rhdfs)
Loading required package: rJavaHADOOP_CMD=/home/csf/Downloads/hadoop/bin/hadoopBe sure to run hdfs.init()> hdfs.init()15/03/11 21:55:50 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable>