Skip to content

HA commands

HA commands are used to create and manage a HA Pair. When you log into the Management Interface, you will be presented with a list of available commands that can be performed from the PAM Server you are logged into.

Primary PAM Server

The following commands can be run on an active Primary PAM Server to manage a HA Pair.

Command
Description
ha-initialise When you have an established HA Pair and it becomes degraded, one of the reason maybe that the Primary database is behind the Secondary which could happen in a Split-brain scenario or the database is not synchronising. This command can be used to re-initialise the HA setup and get the HA Pair in sync and replicating again.
ha-failover This command is used to promote the standby server to become the active server.

When run on the active Primary server this command will:
- Promote the Secondary PAM Server to be active
- Demote the Primary PAM Server.

Operations will be handed over and the Secondary will become the promoted active Secondary.
ha-failback This command allows the Primary server to take back control from a promoted active Secondary server.

When run on the active Primary server this command will:
- Replace the contents of the Primary server with replicated data from the Secondary
- Terminate all active connections on the Secondary PAM Server
ha-demote-primary Only use in a split-brain scenario.

A HA Pair can end up in a split brain scenario if both servers in the HA Pair have a status of active. There is no database replication during this period.
Instructions on how to recover a split-brain scenario can be found here.
ha-status Provides current overview of the HA Pair:
- The active Primary PAM Server ip
- The standby Secondary PAM Server ip
- The floating ip address, if one has been configured
- Indicates which host you are logged into
- Lists any SMB warnings
ha-make-standalone This command is used to revert a HA server back to standalone server. When run on the active Primary server this command will:
- Terminate all active connections
- Remove all configuration expect IP address
- Remove historical data
- Stop replication
- Retain the HA Pair MEK

This PAM Server will revert to being an active Standalone PAM Server.

Other useful commands

The following additional commands can also be run on an active Primary server.

Command
Description
ha-initialise --ha-ip=<ip> This command can be used to:
- Set a floating ip: When a HA Pair is created using the ha-initialise command, you are given the option to add a floating ip. If this is left blank during the initialisation, then it can be configured later using this command.
- Change the floating ip: If a floating ip has been set but you want to change it, then you can use this command to set a different floating ip for the HA Pair.
ha-initialise --disable-ha-ip This command will disable the configured floating ip. Users using the floating ip will be disconnected. No user connections will be allowed through the floating ip. Users will have to use the active server address to log onto PAM.

To reconfigure a floating IP address, run:
ha-initialise --ha-ip=<ip>
ha-initialise --secondary-ip=<ip> When you run this command, the previously configured Secondary will be forgotten and the HA Pair will be re-established with the new Secondary. The joining code of the new Secondary will be required.

On the new Secondary this operation will:
- Disconnect any users
- Remove all configuration except IP address
- Remove historical data
- Begin replication from the Primary

Secondary PAM Server

The following commands can be run on a standby Secondary PAM Server to manage a HA Pair.

Command
Description
ha-failover This command can be used to takeover operations by the standby server from the active Primary if it is having issues.

Running this command on s standby Secondary server:
- Promote the standby Secondary to become the promoted active Secondary PAM Server
- Demote the active Primary server
- Terminate all connections to the Primary server
- Stop database replication

The HA Pair will be in a degraded state.

Once successfully failed over you can rebuild the primary and then run the ha-failback command on either the Primary or Secondary servers to pass operations back to the Primary server and make it the active server and the Secondary back to standby. Instructions on how to recover a failed Primary server can be found here.
ha-status Provides current overview of the HA Pair:

- The active Primary PAM server ip
- The standby Secondary PAM Server ip
- The floating ip address, if one has been configured
- Indicates which host you are logged into
- Lists any SMB warnings
ha-make-standalone This command is used to revert a HA server back to standalone server. When run on the standby Secondary server this command will:

- Remove all configuration expect IP address
- Remove historical data
- Stop replication
- Retain the HA Pair MEK

This PAM Server will revert to being an active Standalone PAM Server .