02 - RStudio server

Launching RStudio server

We will use RStudio server to run MitoPilot. RStudio server on Hydra functions just like the normal RStudio on your local computer, except that you are accessing it remotely.

There are two methods to access RStudio server on Hydra.

Method 2: tunneling to a RStudio server session

To launch RStudio server on Hydra, run the following.

# avoid package conflicts (may not be necessary for all users)
conda deactivate 
# load the RStudio server module
module load tools/R/RStudio/server
# launch RStudio server
start-rstudio-server
Note

If this is your first time launching RStudio server, you may be asked to run a different command.

You will see something like this printed to your screen.

start-rstudio-server: starting RStudio server on host=login02 and port=8787
  you need to create a ssh tunnel on your local machine with
    ssh -N -L 8787:login02:8787 macguigand@hydra-login01.si.edu

Point your browser to http://localhost:8787 on your local machine.
Use Control+C in this window to kill the server when done.

TTY detected. Printing informational message about logging configuration. Logging configuration loaded from '/etc/rstudio/logging.conf'. Logging to '/home/macguigand/.local/share/rstudio/log/rserver.log'.
Why can’t I connect?

If you get a message saying “ERROR system error 98 (Address already in use)”, someone else has a tunnel established with the default port (8787). To fix this, try using a different port, e.g. start-rstudio-server -port 8890. Any port number between 1025-65535 is allowed.

Leave this cluster terminal window open, open a new terminal window on your local computer, and run the ssh command printed by start-rstudio-server.

ssh -N -L 8787:login02:8787 macguigand@hydra-login01.si.edu

Enter your Hydra password when prompted. If nothing happens, this means that you have successfully established a SSH tunnel and can connect to RStudio server.

Leaving both terminal windows open, enter http://localhost:YOUR_PORT_NUMBER in a web browser. We recommend using Chrome or Firefox. There are some known issues running MitoPilot with Safari.

Enter your cluster login credentials to access the RStudio server. This should open a full RStudio session in your browser. Any R commands run in this new window will execute on the cluster.