INSTALL 'R','RHADOOP' AND 'RHBASE'
Epel-release
- You need to install epel-release which is a prerequisite for installing 'R'.
-->wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
-->rpm -ivh epel-release-6-8.noarch.rpm
- Now you can install 'R' using yum installation method.
- Install and set the JAVA_HOME in .bashrc file.
- Configure java in 'R' using the following command.
NOTE: This is a 'R' command which we can use in command prompt itself.
- Check whether 'R' is working fine using R command.
- Install the packages in the 'R' shell.
> install.packages(c('functional', 'stringr', 'plyr'), repos="http://cran.revolutionanalytics.com", INSTALL_opts=c('--byte-compile') )
>install.packages(c('rJava'), repos="http://cran.revolutionanalytics.com" )
>install.packages(c('randomForest'), repos="http://cran.revolutionanalytics.com" )
>install.packages(c('reshape2'), repos="http://cran.revolutionanalytics.com" )
>install.packages(c('bitops'), repos="http://cran.revolutionanalytics.com" )
> install.packages(c('caTools'), repos="http://cran.revolutionanalytics.com" )
- Set the following environment variables in .bashrc and /etc/profile
export HADOOP_CMD=/usr/bin/hadoop
export HADOOP_STREAMING=/usr/lib/hadoop-mapreduce/hadoop-streaming-2.2.0.2.0.6.0-76.jar
NOTE: Set the jar file asper you hadoop version.
- Make sure to source the new variables before continuing.
-
Export the paths in the terminal (execute the following commands)-->source /etc/profile-->ource ~/.bashrc
Download RHadoop and Install
- We can download the Rhadoop from GITHUB site so we need to install git.
-->yum install git
Installing RMR2 package
-->git
clone git://github.com/RevolutionAnalytics/rmr2.git
-->R CMD INSTALL –byte-compile rmr2/pkg
Installing rhdfs Package
-->git clone
git://github.com/RevolutionAnalytics/rhdfs.git
-->R CMD INSTALL –byte –compile
/rhdfs/pkg
- Check with the permissions
-->hadoop fs -chmod -R 777 /user
- Open the ‘R’ terminal to check that it is working
- Give the commands to check whether the ‘R’ is working with hadoop
-->R
>system("pwd")
>library(rmr2)
- This command should output you the following lib
This command should show the libraries exists in it.
Loading required package: Rcpp
Loading required package: RJSONIO
Loading required package: bitops
Loading required package: digest
Loading required package: functional
Loading required package: stringr
Loading required package: plyr
Loading required package: reshape2
Loading required package: Rcpp
Loading required package: RJSONIO
Loading required package: bitops
Loading required package: digest
Loading required package: functional
Loading required package: stringr
Loading required package: plyr
Loading required package: reshape2
>library(rJava)
- Export the Hadoop path in the 'R' terminal.
>Sys.setenv(HADOOP_CMD=”/usr/bin/hadoop”)
>Sys.setenv(HADOOP_STREAMING=”/usr/lib/hadoop-mapreduce/hadoop-streaming-2.2.0.2.0.6.0-76.jar”)
>library(rhdfs)
- Should show you the Hadoop path
- Starts the Hadoop
- Run a sample job (follow the steps)
- Which writes 1-100 into hdfs
- Which is a mapreduce program to output the double values
- Which shows you the output
Install RStudio
- Download the rpm-->wget http://download2.rstudio.org/rstudio-server-0.98.490-x86_64.rpm
- Install the rpm
-->service rstudio-server status
- By default RStudio Server runs on port 8787 and accepts connections from all remote clients. After installation you should therefore be able to navigate a web browser to the following address to access the server:
- http://<server-ip>:8787
For more details visit http://www.rstudio.com/ide/docs/server/getting_started
NOTES:
- Check with the JAVA_HOME path is set.
- You need to export the HADOOP Paths in 'R' shell all the time you are working on it.
No comments:
Post a Comment