You can configure multiple RaaS nodes that share a single PostgreSQL database and Redis node. This method iis also sometimes called clustering.

These instructions demonstrate how to install the PostgreSQL and Redis services on the primary RaaS node using the single-node installation scenario.

Note: Some high availability requirements may require consultation services.

Preparatory steps

In order to set up multiple RaaS nodes, all the RaaS nodes must:

  • Access the same PostgreSQL database
  • Share the same key space
  • Use the same /etc/raas/pki/.raas.key and /etc/raas/raas.secconf files

Before configuring multiple RaaS nodes, follow the steps to install two standalone RaaS nodes using the single-node installation scenario. At the end of this scenario, both nodes should run SaltStack Config in standalone mode, meaning each node has its own local version of PostgreSQL and Redis.

Configure the primary RaaS node

This section explains how to configure the first RaaS node to work with a second RaaS node.

To configure the first RaaS node:

  1. Follow the steps to install two standalone RaaS nodes using the Single-node installation scenario. At the end of this scenario, both nodes should run SaltStack Config in standalone mode, meaning each node has its own local version of PostgreSQL and Redis.
  2. On the first RaaS node, stop the RaaS, Redis, and PostgreSQL services using the following commands:
    systemctl stop raas
    systemctl stop redis
    systemctl stop postgresql-12
    Note:

    The command to stop PostgreSQL may differ if you are running a different version.

  3. On the first RaaS node, update your postgresqlpg_hba.conf file to allow remote connections from the other RaaS node. To allow remote connections, append the following entry to the end of that file, replacing the example IP address with the IP address of the second RaaS node:
    # Allow connection from RaaS 2
    host all all 127.31.4.137/32 trust
  4. Update your /etc/redis.conf file to allow binding to all interfaces. By default, the bind is set to localhost. Add the following to your file:
    #bind 127.0.0.1
  5. Start the services and verify their status using the following commands:
    systemctl start postgresql-12
    systemctl status postgresql-12
    systemctl start redis
    systemctl status redis
    systemctl start raas
    systemctl status raas
  6. Access the SaltStack Config user interface using the URL for the first RaaS node to confirm that SaltStack Config is working properly on the first node.

After verifying you can access the user interface, proceed to the next section.

Configure the secondary RaaS node

This section explains how to configure the second RaaS node to work with the primary RaaS node.

To configure the second RaaS node:

  1. On the second RaaS node, stop the RaaS, Redis, and PostgreSQL services using the following commands:
    systemctl stop raas
    systemctl stop redis
    systemctl stop postgresql-12
  2. On the second RaaS node, update the /etc/raas/raas file to connect to the remote Redis and PostgreSQL services on the first RaaS node. The customer_id configuration should be identical on both nodes. The following shows an example configuration:
    customer_id: 43cab1f4-de60-4ab1-85b5-1d883c5c5d09
    sql:
      dialect: postgresql
      host: 172.31.8.237
      port: 5432
      driver: psycopg2
      ssl: True
    
    redis:
      url: redis://172.31.8.237:6379
  3. Copy the /etc/raas/pki/.raas.key and /etc/raas/secconf from the first node to the second node. Maintain the access and permissions, as shown in this example:
    # ls -l /etc/raas/raas.secconf
    -rw-------. 1 raas raas 313 Jan 2117:21 /etc/raas/raas.secconf
    # ls -l /etc/raas/pki/.raas.key
    -rwx------. 1 raas raas 77 Jan 2117:17 /etc/raas/pki/.raas.key
  4. Start the RaaS service and verify its status using the following commands:
    systemctl start raas
    systemctl status raas
  5. Access the SaltStack Config user interface using the URL for the second RaaS node to confirm that SaltStack Config is working properly on the second node.

After verifying you can access the user interface on the secondary node, proceed to the next section.

Test the configuration

To test whether your new system architecture is working correctly:

  1. To test the configuration, create a new object, such as a new target. Verify that the change is present on both nodes when you refresh the user interface.
  2. On the second RaaS node, disable the Redis and PostgreSQL services using the following commands:
    systemctl disable redis
    systemctl disable postgresql-12

You now have two instances of the RaaS node running. For troubleshooting, Contact Support.