14 High Availability and Load Balancing
Multiple instances of RStudio Package Manager can share the same data in highly available (HA) and load-balanced configurations. In this document, we refer to these configurations as “HA” for brevity.
14.1 HA Checklist
Follow the checklist below to configure multiple RStudio Package Manager instances for HA:
- Ensure that all node clocks are synchronized 14.2
- Install and Configure the same version of RStudio Package Manager on each node - 2
- HA requires using a PostgreSQL database. All nodes in the cluster must use the same PostgreSQL database.
- Configure each server’s
Server.DataDir(5.6) to point to the same shared location. Be sure to read 14.3.3 for additional information on the recommended settings for the shared directory.
14.2 HA Time Synchronization Requirements
The clocks on all nodes in an HA configuration must be synchronized. We recommend configuring NTP for clock synchronization.
14.3 HA Limitations
14.3.1 Node Management
RStudio Package Manager nodes in an HA configuration are not self-aware of HA. The load-balancing responsibility is fully assumed by your load balancer, and the load balancer is responsible for directing requests to specific nodes and checking whether nodes are available to accept request
14.3.2 Database Requirements
RStudio Package Manager only supports HA when using a PostgreSQL database.
14.4 Updating HA Nodes
When applying updates to the RStudio Package Manager nodes in your HA configuration, you should follow these steps to avoid errors due to an inconsistent database schema:
- Stop all RStudio Package Manager nodes in your cluster.
- Upgrade one RStudio Package Manager node. The first update will upgrade the database schema (if necessary) and start RStudio Package Manager on that instance - 3.2.
- Upgrade the remaining nodes.
If you forget to stop any RStudio Package Manager nodes while upgrading another node, these nodes will be using a binary that expects an earlier schema version, and will be subject to unexpected and potentially serious errors. These nodes will detect an out-of-date database schema within 30 seconds and shut down automatically.
If you wish to move from an HA environment to a single-node environment, please follow these steps:
- Stop all RStudio Package Manager services on all nodes
- Reconfigure your network to route traffic directly to one of the nodes, unless you wish to continue using a load balancer.
- If you wish to move all shared file data to the node, then
- Configure the server’s
Server.DataDirto point to a location on the node, and copy all the data from the NFS share to this location - 5.6
- Configure the server’s
- If you wish to move the databases to this node, install PostgreSQL on the node and copy the data. Moving the PostgreSQL databases from one server to another is beyond the scope of this guide. Please note that we do not support migrating from PostgreSQL to SQLite.
- Start the RStudio Package Manager process 3.1