Skip to main content
Star us on GitHub Star

Routers in Controller HA

There are only a few differences in how routers work in an HA cluster.

Configuration

When enrolling routers, the JWT for a new router contains the list of controllers. When the router is enrolled, the controller endpoints configuration file is initialized with the list of controllers.

This means that manually configuring the controllers for a router should no longer be required.

Endpoints File

The router stores the current known controllers in an endpoints configuration file.

Note that:

  • The endpoints file will be written whenever the router is notified of changes to the controller cluster.
  • The file is only read at router startup.
  • The file is not monitored, so changes made by administrators while the router is running won't take effect until the router is restarted, and may be overwritten by the router before it is restarted. Make sure the router is stopped before manually editting the file.
  • The endpoints file is only generated by enrollment and when the endpoints change. For an existing configuration with the routers specified in the router config, if the endpoints never change, the endpoints file will never be generated.

Location

By defaul the endpoints file will be named endpoints and will be placed in the same directory as the router config file.

However, the file can be customized using a config file settings.

ctrl:
endpoints:
- tls:ctrl1.ziti.example.com:1280
endpointsFile: /var/run/ziti/endpoints.yaml

Manual Controller Configuration

Instead of specifying a single controller, multiple controllers can be specified in the router configuration.

ctrl:
endpoints:
- tls:ctrl1.ziti.example.com:1280
- tls:ctrl2.ziti.example.com:1280
- tls:ctrl3.ziti.example.com:1280

If the controller cluster changes, it will notify routers of the updated controller endpoints.

Router Data Model

The router receives a stripped down version of the controller data model.

While the router data model can be disabled on the controller using a config setting in standalone mode, it is required for controller clusters, so that setting will be ignored.

The data model on the router is periodically snapshotted, so it doesn't need to be fully restored from a controller on every restart.

The location and frequency of snapshotting can be configured using the db and dbSaveIntervalSeconds properties.

Controller Selection

When creating circuits, routers will chose the most responsive controller, based on latency. Network operators will want to keep an eye on controllers to make sure they can keep up with the circuit creation load they receive.

When managing terminators, routers will try to talk directly to the current cluster leader, since updates have to go through the leader.