SlideShare a Scribd company logo
RHive tutorial – Rstudio-server setup
for RHive
This tutorial explains how to set up RStudio for using RHive more conveniently.
You can see a detailed how-to document about setting RStudio up at
http://rstudio.org.
A how-to for installing and using RStudio for RHive users is introduced here.

RHive is one of R packages that uses Hadoop and Hive for processing
massive data.

Though there are many R codes made with RHive that come up with results
and finish running in a short time, but if a code that processes extremely large
data is written, it may take a long time for it to finish analyzing and come up
with results.
Depending on the size of the data and the complexity of the processed
calculations, it can take anything from minutes at minimum to couple weeks at
maximum.

The problem here is that R’s session must be kept until the task started by the
user reaches completion.

If the user used a laptop to run the code then it must stay on and keep its
session until the code finishes. Even for desktops, it would be difficult for
desktops to reboot or anything similar while keeping its session until the task
is completed.
There are many other inconveniences stemming from having to keep the
session.

This problem, unrelated to RHive, also occurs when only using either Hadoop
or Hive, and RHive is no exception.

To solve this problem, you can also use a method of having a Hadoop client
opened, connect to the terminal, and run the code in the background.
But this is not that convenient for R users, and it is difficult to make use of the
convenience of the user’s IDE environment or the task environment in R.
Also, if the user is not familiar with using terminal then there is the
inconvenience of having to learn that.

RStudio is the best solution for this.

RStudio provides desktop and server versions but the desktop version is very
good for being an IDE for R.
And RStudio-server connects via a web browser and enables many people to
share common resources, and also has the advantage of being able to keep
the user’s session.
And if the Hadoop, Hive, RHive installed by the user are located in a restricted
network and so warrants approaching them through firewalls, then RStudio
port can be opened for that.
You can use RHive more conveniently if you use RStudio-server with RHive.

Lastly, since RStudio facilitates connecting to the server’s R environment, it
enables sharing of RHive, Hadoop, and Hive between multiple people.

This tutorial will demonstrate how to install, connect to, and use RStudio-
server.

Installing RStudio-server

RStudio can be downloaded from its official site.

http://rstudio.org/

RStudio’s official site, rstudio.org, provides documents detailing how to easily
install and use RStudio.
The page below gives a guide on the installation so it is equally fine to peruse
that instead of this tutorial.

http://rstudio.org/download/server

This tutorial explains how to install RStudio onto CentOS5.
The majority of this installation guide is cited from the aforementioned site,
with partial changes.

Of course, you must install R before installing RStudio-server
If you have read previous RHive tutorials and installed RHive accordingly,
then installation of R should already be complete.
But an explanation will be given here once more.

In order to install newest version of R, you should do the following.

$	
  sudo	
  rpm	
  -­‐Uvh	
  
http://download.fedora.redhat.com/pub/epel/5/i386/epel-­‐release-­‐
5-­‐4.noarch.rpm	
  

Now install R.

$	
  sudo	
  yum	
  install	
  R	
  R-­‐devel	
  
When installing RHive, remember to not only install R but R-devel as well.

Before installing RStudio-server, you must first know whether your server is of
a 32bit architecture or a 64bit architecture.
Recent servers would most likely be 64bit and you can confirm this via the
uname command.

uname	
  -­‐m	
  
x86_64	
  

The above case confirms the server being of a 64bit architecture.

Now download the appropriate RStudio version for your architecture.

Installing for 32-bit:

$	
   wget	
        http://download2.rstudio.org/rstudio-­‐server-­‐0.94.110-­‐
i686.rpm	
  
$ sudo rpm -Uvh rstudio-server-0.94.110-i686.rpm

Installing for 64-bit:

$	
   wget	
   http://download2.rstudio.org/rstudio-­‐server-­‐0.94.110-­‐
x86_64.rpm	
  
$	
  sudo	
  rpm	
  -­‐Uvh	
  rstudio-­‐server-­‐0.94.110-­‐x86_64.rpm	
  

Making a User Account

In order to connect to RStudio-server, a user account must exist in the server
where RStudio-server is installed.
As RStudio-server does not allow connecting via a root account, so accounts
for normal users are needed.

Connect to the server to create accounts for would-be users of RStudio-server
and set their passwords.

ssh	
  root@10.1.1.1	
  
adduser	
  user1	
  
passwd	
  user1	
  
The user1 above is an arbitrarily named account, so name one to your liking.

Starting RStudio-server

RStudio-server must be run as a background process (Daemon mode).
Connect to the server like it is shown below

ssh	
  root@10.1.1.1	
  
/etc/init.d/rstudioserver	
  start	
  

You can easily run it like above.

Connecting to RStudio-server

You can use a web browser to connect to the RStudio-server.
Run your web browser and connect to the RStudio-server’s URL.

http://10.1.1.1:8787

The port that can connect to RStudio is set to be 8787 by default.
You can change this to something else as needed.

Now you can connect to RStutio-server and perform massive data analysis
with R and RHive.

Tips for using RHive in RStudio

While working in RStudio-server, you might experience failure in loading
RHive due to improper environment variables.
In this case you can solve this by adding a code that assigns values for
environment variables.

Sys.setenv(HADOOP_HOME="/mnt/srv/hadoop-­‐0.20.203.0")	
  
Sys.setenv(HIVE_HOME="/mnt/srv/hive-­‐0.7.1")	
  
Sys.setenv(RHIVE_DATA="/mnt/srv/rhive_data")	
  
	
  	
  
library(RHive)	
  

The HADOOP_HOME mentioned above must have assigned to it the home
directories of Hadoop and Hive in the server where RStudio is installed.
And RHIVE_DATA refers to a temporary directory which RHive will use; it is
created in each Hadoop node.
The setting of environment variables should be done before loading RHive via
use of library functions.
If you have loaded RHive without setting the environment variables, then you
can set them and then use the rhive.init() function to initialize RHive.

library(RHive)	
  
	
  	
  
Sys.setenv(HADOOP_HOME="/mnt/srv/hadoop-­‐0.20.203.0")	
  
Sys.setenv(HIVE_HOME="/mnt/srv/hive-­‐0.7.1")	
  
Sys.setenv(RHIVE_DATA="/mnt/srv/rhive_data")	
  
	
  	
  
rhive.init()	
  

Now you have written codes in R via RStudio, and finished the setup of an
environment that can use RHive to handle Hive and Hadoop.

More Related Content

What's hot (16)

PPT
Linux
Kavi Bharathi R
 
PPT
Hadoop on ec2
Mark Kerzner
 
PDF
Introduction to Flume
Rupak Roy
 
DOCX
Installing lemp with ssl and varnish on Debian 9
عطاءالمنعم اثیل شیخ
 
PDF
Setting up LAMP for Linux newbies
Shabir Ahmad
 
PPT
Linux Webserver Installation Command and GUI.ppt
webhostingguy
 
PDF
Introduction to Hbase
Rupak Roy
 
PDF
Hadoop completereference
arunkumar sadhasivam
 
PDF
Standby db creation commands
Piyush Kumar
 
PPT
Power point on linux commands,appache,php,mysql,html,css,web 2.0
venkatakrishnan k
 
PPT
Linux presentation
Ajaigururaj R
 
PDF
Deploying your rails application to a clean ubuntu 10
Maurício Linhares
 
PPTX
BD-zero lecture.pptx
vishal choudhary
 
PDF
Mahout Workshop on Google Cloud Platform
IMC Institute
 
PDF
Single node hadoop cluster installation
Mahantesh Angadi
 
PPTX
Ex-8-hive.pptx
vishal choudhary
 
Hadoop on ec2
Mark Kerzner
 
Introduction to Flume
Rupak Roy
 
Installing lemp with ssl and varnish on Debian 9
عطاءالمنعم اثیل شیخ
 
Setting up LAMP for Linux newbies
Shabir Ahmad
 
Linux Webserver Installation Command and GUI.ppt
webhostingguy
 
Introduction to Hbase
Rupak Roy
 
Hadoop completereference
arunkumar sadhasivam
 
Standby db creation commands
Piyush Kumar
 
Power point on linux commands,appache,php,mysql,html,css,web 2.0
venkatakrishnan k
 
Linux presentation
Ajaigururaj R
 
Deploying your rails application to a clean ubuntu 10
Maurício Linhares
 
BD-zero lecture.pptx
vishal choudhary
 
Mahout Workshop on Google Cloud Platform
IMC Institute
 
Single node hadoop cluster installation
Mahantesh Angadi
 
Ex-8-hive.pptx
vishal choudhary
 

Viewers also liked (11)

PDF
RHive tutorials - Basic functions
Aiden Seonghak Hong
 
KEY
RHadoop, R meets Hadoop
Revolution Analytics
 
PPTX
Hive vs Hbase, a Friendly Competition
Xplenty
 
PDF
Running R on Hadoop - CHUG - 20120815
Chicago Hadoop Users Group
 
PDF
R hive tutorial - apply functions and map reduce
Aiden Seonghak Hong
 
PDF
Performance and Scale Options for R with Hadoop: A comparison of potential ar...
Revolution Analytics
 
PDF
R hive tutorial - udf, udaf, udtf functions
Aiden Seonghak Hong
 
PPTX
Hadoop Integration with Microstrategy
snehal parikh
 
PDF
Integrate Hive and R
JunHo Cho
 
PDF
Data processing platforms architectures with Spark, Mesos, Akka, Cassandra an...
Anton Kirillov
 
PDF
Enabling R on Hadoop
DataWorks Summit
 
RHive tutorials - Basic functions
Aiden Seonghak Hong
 
RHadoop, R meets Hadoop
Revolution Analytics
 
Hive vs Hbase, a Friendly Competition
Xplenty
 
Running R on Hadoop - CHUG - 20120815
Chicago Hadoop Users Group
 
R hive tutorial - apply functions and map reduce
Aiden Seonghak Hong
 
Performance and Scale Options for R with Hadoop: A comparison of potential ar...
Revolution Analytics
 
R hive tutorial - udf, udaf, udtf functions
Aiden Seonghak Hong
 
Hadoop Integration with Microstrategy
snehal parikh
 
Integrate Hive and R
JunHo Cho
 
Data processing platforms architectures with Spark, Mesos, Akka, Cassandra an...
Anton Kirillov
 
Enabling R on Hadoop
DataWorks Summit
 
Ad

Similar to R hive tutorial supplement 3 - Rstudio-server setup for rhive (20)

DOCX
R Studio (Report)
Adeel Rasheed
 
DOCX
RStudio
Adeel Rasheed
 
PDF
Intro to RStudio
egoodwintx
 
PPTX
R Programming and Lab - Unit I PPTX with examples
SARAVANA KUMAR SS
 
PPTX
Introduction to R.pptx
rehab517883
 
PPTX
Workshop presentation hands on r programming
Nimrita Koul
 
PDF
R training
Hellen Gakuruh
 
PDF
R Intro
koppenolski
 
PPTX
Introduction to r
gslicraf
 
PPTX
R Brownbag Seminar 2.1
Muhammad Nabi Ahmad
 
PDF
Poly_introduction_R.pdf
BenjaminTheodorNicai
 
PDF
RStudio is good for you
Cdiscount
 
PPTX
Getting Started with R
Sankhya_Analytics
 
PPTX
R presentation
ShwetDadhaniya1
 
PDF
R tutorial
Dungg Nguyên Thùy
 
PPTX
R language
Kìshør Krîßh
 
PPTX
R programming presentation
Akshat Sharma
 
PDF
Introduction to R and R Studio
Rupak Roy
 
PPTX
R-Studio Vs. Rcmdr
Syracuse University
 
PDF
R Programming Overview
dlamb3244
 
R Studio (Report)
Adeel Rasheed
 
RStudio
Adeel Rasheed
 
Intro to RStudio
egoodwintx
 
R Programming and Lab - Unit I PPTX with examples
SARAVANA KUMAR SS
 
Introduction to R.pptx
rehab517883
 
Workshop presentation hands on r programming
Nimrita Koul
 
R training
Hellen Gakuruh
 
R Intro
koppenolski
 
Introduction to r
gslicraf
 
R Brownbag Seminar 2.1
Muhammad Nabi Ahmad
 
Poly_introduction_R.pdf
BenjaminTheodorNicai
 
RStudio is good for you
Cdiscount
 
Getting Started with R
Sankhya_Analytics
 
R presentation
ShwetDadhaniya1
 
R language
Kìshør Krîßh
 
R programming presentation
Akshat Sharma
 
Introduction to R and R Studio
Rupak Roy
 
R-Studio Vs. Rcmdr
Syracuse University
 
R Programming Overview
dlamb3244
 
Ad

More from Aiden Seonghak Hong (10)

PDF
IoT and Big data with R
Aiden Seonghak Hong
 
PDF
RHive tutorial supplement 3: RHive 튜토리얼 부록 3 - RStudio 설치
Aiden Seonghak Hong
 
PDF
RHive tutorial supplement 2: RHive 튜토리얼 부록 2 - Hive 설치
Aiden Seonghak Hong
 
PDF
RHive tutorial supplement 1: RHive 튜토리얼 부록 1 - Hadoop 설치
Aiden Seonghak Hong
 
PDF
RHive tutorial 5: RHive 튜토리얼 5 - apply 함수와 맵리듀스
Aiden Seonghak Hong
 
PDF
RHive tutorial 4: RHive 튜토리얼 4 - UDF, UDTF, UDAF 함수
Aiden Seonghak Hong
 
PDF
RHive tutorial 3: RHive 튜토리얼 3 - HDFS 함수
Aiden Seonghak Hong
 
PDF
RHive tutorial 2: RHive 튜토리얼 2 - 기본 함수
Aiden Seonghak Hong
 
PDF
RHive tutorial 1: RHive 튜토리얼 1 - 설치 및 설정
Aiden Seonghak Hong
 
PDF
R hive tutorial 1
Aiden Seonghak Hong
 
IoT and Big data with R
Aiden Seonghak Hong
 
RHive tutorial supplement 3: RHive 튜토리얼 부록 3 - RStudio 설치
Aiden Seonghak Hong
 
RHive tutorial supplement 2: RHive 튜토리얼 부록 2 - Hive 설치
Aiden Seonghak Hong
 
RHive tutorial supplement 1: RHive 튜토리얼 부록 1 - Hadoop 설치
Aiden Seonghak Hong
 
RHive tutorial 5: RHive 튜토리얼 5 - apply 함수와 맵리듀스
Aiden Seonghak Hong
 
RHive tutorial 4: RHive 튜토리얼 4 - UDF, UDTF, UDAF 함수
Aiden Seonghak Hong
 
RHive tutorial 3: RHive 튜토리얼 3 - HDFS 함수
Aiden Seonghak Hong
 
RHive tutorial 2: RHive 튜토리얼 2 - 기본 함수
Aiden Seonghak Hong
 
RHive tutorial 1: RHive 튜토리얼 1 - 설치 및 설정
Aiden Seonghak Hong
 
R hive tutorial 1
Aiden Seonghak Hong
 

Recently uploaded (20)

PDF
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
PPTX
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
PDF
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
PDF
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
PPTX
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
PDF
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
PDF
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
PDF
What Makes Contify’s News API Stand Out: Key Features at a Glance
Contify
 
PDF
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
PPTX
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
PPTX
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
PPTX
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
PDF
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
PDF
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
PDF
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
PPTX
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
PDF
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
PDF
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
What Makes Contify’s News API Stand Out: Key Features at a Glance
Contify
 
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 

R hive tutorial supplement 3 - Rstudio-server setup for rhive

  • 1. RHive tutorial – Rstudio-server setup for RHive This tutorial explains how to set up RStudio for using RHive more conveniently. You can see a detailed how-to document about setting RStudio up at http://rstudio.org. A how-to for installing and using RStudio for RHive users is introduced here. RHive is one of R packages that uses Hadoop and Hive for processing massive data. Though there are many R codes made with RHive that come up with results and finish running in a short time, but if a code that processes extremely large data is written, it may take a long time for it to finish analyzing and come up with results. Depending on the size of the data and the complexity of the processed calculations, it can take anything from minutes at minimum to couple weeks at maximum. The problem here is that R’s session must be kept until the task started by the user reaches completion. If the user used a laptop to run the code then it must stay on and keep its session until the code finishes. Even for desktops, it would be difficult for desktops to reboot or anything similar while keeping its session until the task is completed. There are many other inconveniences stemming from having to keep the session. This problem, unrelated to RHive, also occurs when only using either Hadoop or Hive, and RHive is no exception. To solve this problem, you can also use a method of having a Hadoop client opened, connect to the terminal, and run the code in the background. But this is not that convenient for R users, and it is difficult to make use of the convenience of the user’s IDE environment or the task environment in R. Also, if the user is not familiar with using terminal then there is the inconvenience of having to learn that. RStudio is the best solution for this. RStudio provides desktop and server versions but the desktop version is very good for being an IDE for R. And RStudio-server connects via a web browser and enables many people to
  • 2. share common resources, and also has the advantage of being able to keep the user’s session. And if the Hadoop, Hive, RHive installed by the user are located in a restricted network and so warrants approaching them through firewalls, then RStudio port can be opened for that. You can use RHive more conveniently if you use RStudio-server with RHive. Lastly, since RStudio facilitates connecting to the server’s R environment, it enables sharing of RHive, Hadoop, and Hive between multiple people. This tutorial will demonstrate how to install, connect to, and use RStudio- server. Installing RStudio-server RStudio can be downloaded from its official site. http://rstudio.org/ RStudio’s official site, rstudio.org, provides documents detailing how to easily install and use RStudio. The page below gives a guide on the installation so it is equally fine to peruse that instead of this tutorial. http://rstudio.org/download/server This tutorial explains how to install RStudio onto CentOS5. The majority of this installation guide is cited from the aforementioned site, with partial changes. Of course, you must install R before installing RStudio-server If you have read previous RHive tutorials and installed RHive accordingly, then installation of R should already be complete. But an explanation will be given here once more. In order to install newest version of R, you should do the following. $  sudo  rpm  -­‐Uvh   http://download.fedora.redhat.com/pub/epel/5/i386/epel-­‐release-­‐ 5-­‐4.noarch.rpm   Now install R. $  sudo  yum  install  R  R-­‐devel  
  • 3. When installing RHive, remember to not only install R but R-devel as well. Before installing RStudio-server, you must first know whether your server is of a 32bit architecture or a 64bit architecture. Recent servers would most likely be 64bit and you can confirm this via the uname command. uname  -­‐m   x86_64   The above case confirms the server being of a 64bit architecture. Now download the appropriate RStudio version for your architecture. Installing for 32-bit: $   wget   http://download2.rstudio.org/rstudio-­‐server-­‐0.94.110-­‐ i686.rpm   $ sudo rpm -Uvh rstudio-server-0.94.110-i686.rpm Installing for 64-bit: $   wget   http://download2.rstudio.org/rstudio-­‐server-­‐0.94.110-­‐ x86_64.rpm   $  sudo  rpm  -­‐Uvh  rstudio-­‐server-­‐0.94.110-­‐x86_64.rpm   Making a User Account In order to connect to RStudio-server, a user account must exist in the server where RStudio-server is installed. As RStudio-server does not allow connecting via a root account, so accounts for normal users are needed. Connect to the server to create accounts for would-be users of RStudio-server and set their passwords. ssh  [email protected]   adduser  user1   passwd  user1  
  • 4. The user1 above is an arbitrarily named account, so name one to your liking. Starting RStudio-server RStudio-server must be run as a background process (Daemon mode). Connect to the server like it is shown below ssh  [email protected]   /etc/init.d/rstudioserver  start   You can easily run it like above. Connecting to RStudio-server You can use a web browser to connect to the RStudio-server. Run your web browser and connect to the RStudio-server’s URL. http://10.1.1.1:8787 The port that can connect to RStudio is set to be 8787 by default. You can change this to something else as needed. Now you can connect to RStutio-server and perform massive data analysis with R and RHive. Tips for using RHive in RStudio While working in RStudio-server, you might experience failure in loading RHive due to improper environment variables. In this case you can solve this by adding a code that assigns values for environment variables. Sys.setenv(HADOOP_HOME="/mnt/srv/hadoop-­‐0.20.203.0")   Sys.setenv(HIVE_HOME="/mnt/srv/hive-­‐0.7.1")   Sys.setenv(RHIVE_DATA="/mnt/srv/rhive_data")       library(RHive)   The HADOOP_HOME mentioned above must have assigned to it the home directories of Hadoop and Hive in the server where RStudio is installed. And RHIVE_DATA refers to a temporary directory which RHive will use; it is created in each Hadoop node.
  • 5. The setting of environment variables should be done before loading RHive via use of library functions. If you have loaded RHive without setting the environment variables, then you can set them and then use the rhive.init() function to initialize RHive. library(RHive)       Sys.setenv(HADOOP_HOME="/mnt/srv/hadoop-­‐0.20.203.0")   Sys.setenv(HIVE_HOME="/mnt/srv/hive-­‐0.7.1")   Sys.setenv(RHIVE_DATA="/mnt/srv/rhive_data")       rhive.init()   Now you have written codes in R via RStudio, and finished the setup of an environment that can use RHive to handle Hive and Hadoop.