Skip to content

Clustering


The SEAL NATS installation package is preconfigured for a single server installation. If you are running PLOSSYS 5 in a cluster, SEAL NATS needs to be installed on every PLOSSYS 5 server. The following instructions refer to a cluster containing three PLOSSYS 5 servers.


Configuring Cluster Server 1

Configuration for server 1

Perform the following configuration steps on <server_1>:

  1. Open the /opt/seal/etc/nats.conf configuration file.

  2. Edit the following line. Replace the hostname-of-this-server placeholder by the server name of the current server.

    server_name: hostname-of-this-server
    

    Example

    server_name: pegasus1
    
  3. Uncomment the following section to activate the preconfigured cluster settings.

    # This is for clustering multiple servers together.
    cluster {
        # It is recommended to set a cluster name
        name: "seal"
    
        # Route connections to be received on any interface on port 6222
        port: 6222
    
        # Routes are protected, so need to use them with --routes flag
        # e.g. --routes=nats-route://ruser:T0pS3cr3t@otherdockerhost:6222
        authorization {
            user: ruser
            password: T0pS3cr3t
            timeout: 2
    }
    
  4. Edit the routes entry. Replace the hostname-of-cluster-server1 placeholder by the server name of the current (= first) server.

    # Routes are actively solicited and connected to from this server.
    routes = [
        nats-route://ruser:T0pS3cr3t@hostname-of-cluster-server1:6222
    ]
    

    Hint - add all NATS services to the list

    The NATS services are building a service mesh without a dedicated master. So one route entry pointing to the first (running) service is enough. To ensure that the system comes up again after a complete failure even if the one configured isn't coming up again, you can add all NATS services to the routes list, one line each.

  5. Save the file.

  6. Restart the service:

    sudo systemctl restart seal-nats
    

Configuring Cluster Server 2 and 3

Configuration for server 2 and 3

Perform the following configuration steps on <server_2> and <server_3>:

  1. Copy the /opt/seal/etc/nats.conf configuration file created for <server_1> to the same directory on the current server.

  2. Replace the value of the server_name entry by the server name of the current server.

  3. Start the service:

    sudo systemctl start seal-nats
    

Back to top