Community Articles
Find and share helpful community-sourced technical articles
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.
Cloudera Employee

Context

Hortonworks tutorials are a great resource and one I use often to explore new topics or re-enforce my current knowledge. Recently, I went through the Predicting Airline Delays using SparkR tutorial. This tutorial is using SparkR and RStudio, running on the HDP Sandbox.

For those, like me, who want to run rstudio on an HDP node running on something else than the sandbox, the configuration of rstudio differs a little from the article linked in this tutorial, which is why I thought of writing this quick article.

This tutorial will thus detail the installation and unit testing of RStudio Server for the following environment versions:

  • Hortonworks Data Platform: HDP 2.6
  • OS: Centos 7 64bit
  • Cloud Infrastucture: OpenStack

Installing rstudio-server on Centos 7

1. Connect to the server onto which you want to install rstudio-server:

$ ssh [your_user]@[your_server]

Note: the user with which you connect must have sudo priviledges.

2. Install R:

$ sudo yum install R -y

3. Once connected, following the RStudio official site, download the latest version of RStudio:

$ wget https://download2.rstudio.org/rstudio-server-rhel-1.1.453-x86_64.rpm
$ sudo yum install rstudio-server-rhel-1.1.453-x86_64.rpm

4. Run & Verify service:

$ sudo systemctl enable rstudio-server.service
$ sudo systemctl start rstudio-server.service
$ sudo systemctl status rstudio-server.service

You should see something like this:

$ sudo systemctl status rstudio-server.service
● rstudio-server.service - RStudio Server
   Loaded: loaded (/etc/systemd/system/rstudio-server.service; enabled; vendor preset: disabled)
   Active: active (running) since Mon 2018-07-16 12:31:29 UTC; 22s ago
 Main PID: 13043 (rserver)
   CGroup: /system.slice/rstudio-server.service
           └─13043 /usr/lib/rstudio-server/bin/rserver

Jul 16 12:31:29 pvidal-hdp26-9244-compute-2 systemd[1]: Starting RStudio Server...
Jul 16 12:31:29 pvidal-hdp26-9244-compute-2 systemd[1]: Started RStudio Server.

5. Check that you can access the server inside of the network:

$ wget [your_server]:8787

You should see something like this:

$ wget 172.26.252.182:8787
--2018-07-16 12:34:28--  http://172.26.252.182:8787/
Connecting to 172.26.252.182:8787... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: http://172.26.252.182:8787/unsupported_browser.htm [following]
--2018-07-16 12:34:28--  http://172.26.252.182:8787/unsupported_browser.htm
Connecting to 172.26.252.182:8787... connected.
HTTP request sent, awaiting response... 200 OK
Length: 894 [text/html]
Saving to: ‘index.html’

100%[===============================================================================================================================================================================>] 894         --.-K/s   in 0s      

2018-07-16 12:34:28 (99.4 MB/s) - ‘index.html’ saved [894/894]

Opening rstudio-server port on OpenStack

1. In your OpenStack dashboard, note your stack parameters (found in the overview tab of your stack):

79489-screen-shot-2018-07-16-at-24123-pm.png

2. Copy your current template to a text file (found in the template tab of your Stack):

79490-screen-shot-2018-07-16-at-24138-pm.png

Note: Make sure that the copy paste from the site did not add text before the "description" parameter.

3. Add the following line to allow TCP connections to 8787 to your security group:

      - {port_range_max: 8787, port_range_min: 8787, protocol: tcp, remote_ip_prefix: 0.0.0.0/0}

4. Change your template using the OpenStack dashboard:

Click on Change Stack Template:

79491-screen-shot-2018-07-16-at-24609-pm.png

Browse to the file you just modified and click Next:

79492-screen-shot-2018-07-16-at-24635-pm.png

Copy paste the parameters you noted previously:

79493-screen-shot-2018-07-16-at-24716-pm.png

Verify access to RStudio

1. Open your browser and go to the following address:

http://[your_server]:8787

You should see the following screen:

79494-screen-shot-2018-07-16-at-25422-pm.png

2. Use any unix user/password to connect.

168 Views
Don't have an account?
Coming from Hortonworks? Activate your account here
Version history
Revision #:
2 of 2
Last update:
‎08-17-2019 06:56 AM
Updated by:
 
Contributors
Top Kudoed Authors