Skip to content

Configuring High Availability with Local Launcher in Workbench#

Overview#

RStudio is now Posit!

Our professional products have been renamed to Posit Connect, Posit Workbench, Posit Package Manager, Posit Cloud, and Posit Academy so it’s easier for folks to understand that we support more than just R. Please review our Blog post/FAQ to answer commonly asked questions about the rebrand.

If your intended architecture involves multiple servers for Posit Workbench, formerly RStudio Workbench, and you want to enable Jupyter Notebook/VSCode support without integrating with a resource manager, then you will have to configure local launcher load balancing/high availability (HA). This document provides step-by-step procedures to achieve this architecture.

In this configuration we will:

  • Perform regular load balancing for Workbench servers
  • Then, add additional configuration for load balancing the launcher extension

Prerequisites#

  • More than one Workbench server with 1.4 and above
  • Postgres database
  • NFS share storage

Step 1: Database Configuration#

When running Workbench in a load balanced configuration, a Postgres database is required. You must create an empty database for RStudio Server to connect to and you must not share this database with other products or services.

Info

The minimum supported PostgreSQL version is 9.5.

  • In all the Workbench servers in your cluster, update the /etc/rstudio/database.conf as:

    File: /etc/rstudio/database.conf
    # Note: when connecting to a PostgreSQL database, a default empty RStudio database must first be created!
    provider=postgresql
    
    # Specifies the host (hostname or IP address) of the database host
    host=localhost
    
    # Specifies the database to connect to
    database=rstudio
    
    # Specifies the TCP port where the database is listening for connections
    port=5432
    
    # Specifies the database connection username
    username=postgres
    
    # Specifies the database connection password. This may be encrypted with the secure-cookie-key.
    # The encrypted password can be generated using the helper command rstudio-server encrypt-password.
    # It is strongly recommended that you encrypt the password!
    password=postgres
    

Please make sure that this file is exactly the same on all servers. For more information, refer to the Database configuration section of Workbench Admin guide.

Step 2: Configuring load balancing at server level#

In order to fully load balance this Workbench cluster, first you need to load balance the servers.

The details for configuring load balancing at the server level is provided in the Load Balancing Configuration section of the Posit Workbench Admin guide.

Step 3: Configuring load balancing at launcher level#

After you have completed load balancing configuration at server level, please perform the following steps across each server instance in the cluster:

  • On all servers, make sure the local launcher section in /etc/rstudio/launcher.conf looks exactly the same. Note that all Workbench configurations require a [server] section in /etc/rstudio/launcher.conf, and a [cluster] section must be added for High Availability Launcher. One sample configuration is:

    File: /etc/rstudio/launcher.conf
    [server]
    address=0.0.0.0
    port=5559
    server-user=rstudio-server
    admin-group=rstudio-server
    enable-debug-logging=1
    thread-pool-size=4
    authorization-enabled=1
    
    [cluster]
    name=Local
    type=Local
    
  • Create a directory in your NFS shared storage and make rstudio-server as the owner:

    Terminal
    sudo mkdir -p {NFS-Share}/Local
    sudo chown rstudio-server {NFS-Share}/Local
    

    Note

    If your server-user is something other than rstudio-server, then please update the above command accordingly. Also, update the command if your cluster name is something other than Local.

  • Now on each server in the Workbench cluster:

    • Mount the path created above.
    • Edit the /etc/rstudio/launcher.local.conf to set the scratch-path variable as:
    File: /etc/rstudio/launcher.local.conf
    scratch-path={NFS-Share}/Local
    
  • Each local plugin node must be able to directly connect to the launcher service located on other nodes in the load-balanced cluster. Verify that the default port for the launcher (port 5559) on all servers is listening for incoming requests. You can use a command like this to test:

    Terminal
    curl -i myip.com:5559/status
    

    Note

    If you are using an external load balancer in your architecture for load balancing this Workbench cluster, then we recommend using sticky sessions so as to maintain the most consistent view of the job state of the cluster.

  • Restart both rstudio-server and rstudio-launcher service on all servers.

    Terminal
    sudo rstudio-server restart
    sudo rstudio-launcher restart
    

Additional Documentation#

If you are looking for additional information, it can can be found in the Local Launcher Load Balancing section of the Job Launcher Admin guide.