High Availability Setup
========================

Commands
========
    - netq config ts add server <ip-master> <ip-replica> <ip-replica>
    - netq config ts show server
    - netq config add server <ip-server> <ip-server> <ip-server> [vrf <vrf?]
    - netq config show server

Usage
=====

NetQ high availability setup ensures that the failure of a single telemetry
server does not cause network monitoring to come unstuck.

The setup consists of three telemetry servers, running on three different
servers. Specifically, there is no support for running all three instances
on the same physical server with the same IP address, but different ports.
In the future, we may support more than three servers, but the current version
supports exactly three.

The steps to configure HA are:

    - Ensure the machines can reach each other (ping works).
    - Pick one of the machines as the master node. The other two nodes will
      will be replica nodes.
    - On the master node type the command:
      netq config ts add server <ip-master> <ip-replica1> <ip-replica2>

      For example: netq config ts add server 10.0.0.5 10.0.0.6 10.0.0.7
    - Execute the same command on each of the other machines (cut-n-paste
      the same command as above on the replica machines).
    - To check the status of the setup, execute the command:
      netq config ts show server
    - Go to each of the nodes running the netq-agent and execute the command:
      netq config add server <ip-master> <ip-replica> <ip-replica> [vrf <vrf>]

    - Execute the following command to check the status of the agent
      connection:
      netq config show server

If you want to switch to replacing an existing instance with another, merely
issue the same netq config ts add server command on all the relevant machines
again, with the IP address of the new server, leaving out that of the old.

NetQ's high availability is primarily tied to, in its current implementation,
the database Redis server's HA implementation. Essentially, the model employed
here is described on the page: https://redis.io/topics/sentinel. Scroll down
to the section titled 'Example 2'.
