Database Redundancy

The first SAFR Server you install will automatically become the primary server. All subsequent servers you install will be secondary servers. There are two types of secondary servers:

With both types of secondary servers the traffic for the CoVi and Event API services are load-balanced across all servers. Other services, such as VIRGA (feed management), Reports, and the Web Console are not load-balanced and are always served from the primary server.

Multiple Server Installations

1 Server

Install a single SAFR Server. The database runs on the primary (and only) server.

2+ Servers (Simple)

Install a primary server and one or more simple secondary servers. The database runs on the primary server only.

2 Servers (Redundant)

Install a primary server and a redundant secondary server. The database runs on both the primary and secondary servers.

3 Servers (Redundant)

Install a primary server and 2 redundant secondary servers. The database runs on both the primary and both secondary servers.

4+ Servers (Redundant)

Install a primary server and 3 or more redundant secondary servers. The database runs on both the primary server as well as all the secondary servers. Only the first two secondary servers that were added can act as the primary database host, though. Additional secondary servers will continue to replicate database data but cannot become the primary database host and do not count towards the “majority” count required for a primary database host to be elected.

Add a Secondary Server While Connected to the Internet

If your system is connected to the Internet, do the following to add a secondary server to your existing primary server:

  1. Download and install SAFR Platform on the additional machine.
  2. To start the SAFR auto-discovery process:
    • Connect the Desktop client to the primary server (for macOS and Windows) as described here
    • Connect your Web Console to the primary server (for Linux) as described here.
  3. During auto-discovery, the following automatically happens:
    1. The secondary server contacts a SAFR Licensing Server in the cloud to acquire a license.
    2. The SAFR Licensing Server authenticates the SAFR account credentials.
    3. The SAFR Licensing Server identifies the license and deployment type.
    4. A suitable license is returned to the secondary server and information about the primary server is returned to the secondary server, including the hostname.
  4. If your new secondary server is on a Windows or Linux machine, you will be prompted to choose which kind of secondary server you want: simple or redundant. If your new secondary server is on a macOS machine no prompt will occur; macOS secondary servers are always simple.
  5. Auto-discovery will now continue, with the following automatically occurring:
    1. The secondary server re-configures itself to reference the primary server.
    2. The secondary server registers itself with the primary server.
    3. The primary server updates its local database and adds the new secondary server to its load balancer configuration.
    4. From this point on, the primary server uses the secondary server as an additional node in its cluster.

Add a Secondary SAFR Server While Offline

If you are not connected to the Internet, you can still connect to the primary SAFR Server, but the auto-discovery process is not available. You must instead manually configure the newly installed secondary server to locate the primary server. When manually configuring the new secondary server, Windows and Linux users will need to choose if they want the server to be a simple secondary server or a redundant secondary server.

  1. Download and install SAFR Platform on the second machine.

  2. Run the safr-worker script on your secondary server by doing the following:

    For macOS:

    1. Open Terminal.
    2. Run the following command, substituting the primary SAFR hostname for HOSTNAME:
      • sudo /Library/RealNetworks/SAFR/bin/safr-worker HOSTNAME

    For Windows

    1. On the primary server record the contents of C:\Program Files\RealNetworks\SAFR\mongo\.adminpass and C:\Program Files\RealNetworks\SAFR\mongo\mongod.keyfile

    2. On the new secondary server, open a command prompt by right-clicking on the Start menu, select Run, and enter cmd.

    3. If you want it to be a simple secondary server, in the new command prompt run the following command, substituting the password from Step 1 for PASSWORD and the primary server hostname for HOSTNAME:

      • "C:\Program Files\RealNetworks\SAFR\bin\safr-worker.py" -p PASSWORD HOSTNAME

      OR

    4. If you want it to be a redundant secondary server, in the new command prompt run the following command, substituting the mongod.keyfile contents from Step 1 for KEYFILE, the password from Step 1 for PASSWORD, and the primary server hostname for HOSTNAME:

      • "C:\Program Files\RealNetworks\SAFR\bin\safr-worker.py" -s KEYFILE -p PASSWORD HOSTNAME

    For Linux

    1. On the primary server, record the contents of /opt/RealNetworks/SAFR/mongo/.adminpass and /opt/RealNetworks/SAFR/mongo/mongod.keyfile

    2. If you want it to be a simple secondary server, on the new secondary server run the following command, substituting the password from Step 1 for PASSWORD and the primary server hostname for HOSTNAME:

      • sudo python /opt/RealNetworks/SAFR/bin/safr-worker.py -p PASSWORD HOSTNAME

      OR

    3. If you want it to be a redundant secondary server, on the new secondary server run the following command, substituting the mongod.keyfile contents from Step 1 for KEYFILE, the password from Step 1 for PASSWORD, and the primary server hostname for HOSTNAME:

      • sudo python /opt/RealNetworks/SAFR/bin/safr-worker.py -s KEYFILE -p PASSWORD HOSTNAME

Error Messages

When attempting to join a new secondary server, you might encounter the following error messages:

Error Message Description
System is offline Network or system connectivity issue. Attempt to access the system at a later time.
SAFR master host is not reachable Ensure all servers are connected to the same network and try again.
Improperly configured SSL certificate SSL certificates are required to set up multiple servers. See the SSL Certificate Installation page for information about how to install an SSL certificate.
Secure connection error. Check server for valid SSL certificate SSL certificates are required to set up multiple servers. See the SSL Certificate Installation page for information about how to install an SSL certificate.
Incomplete server connection Attempt to join again; a persistent issue may require either uninstalling and reinstalling SAFR Platform on your servers or contacting your SAFR support representative.

See Also