Enabling automatic failover
Configure automatic OpsCenter failover from the primary OpsCenter instance to the designated backup OpsCenter instance.
Follow these steps to enable automatic failover from the primary OpsCenter instance to the designated backup OpsCenter instance. Enabling failover requires minimal initial set up on the backup OpsCenter.
Important: When configuring automatic failover, both the primary and
secondary OpsCenter instances must be running the same OpsCenter version. The
OpsCenter daemon (opscenterd) and the DataStax Agents must be running the same
version before configuring high availability. DataStax cannot guarantee results if
the primary and secondary OpsCenter instances are running different versions.
To enable automatic OpsCenter failover:
opscenterd.conf
The location of the opscenterd.conf file depends on the type of installation:- Package installations: /etc/opscenter/opscenterd.conf
- Tarball installations: install_location/conf/opscenterd.conf
lcm.db
The location of the Lifecycle Manager database lcm.db depends on the type of installation:- Package installations: /var/lib/opscenter/lcm.db
- Tarball installations: install_location/lcm.db
lcm.key
The location of the Lifecycle Manager database encryption key lcm.key depends on the type of installation:- Package installations: /etc/opscenter/lcm.key
- Tarball installations: install_location/keys/lcm.key
passwd.db
The default location of the password database passwd.db for OpsCenter authentication depends on the type of installation:- Package installations: /etc/opscenter/passwd.db
- Tarball installations: install_location/passwd.db
Prerequisites
Warning: Ensure that
address.yaml is not being managed by third-party
Configuration Management. During failover, OpsCenter automatically changes
stomp_interface
in address.yaml to point to the
backup opscenterd instance. If a separate Configuration Management system is managing
address.yaml, that change might be undone when the Configuration
Management system pushes its next update.Procedure
- Optional:
Set up a hostname/IP that can switch between primary
and backup OpsCenter instances to avoid changing the browser URL for OpsCenter
if a failover occurs.
If you do not set up a hostname or IP for seamless URL switching post-failover, inform your OpsCenter users of any alternate URL to access OpsCenter.
-
Mirror the configuration directories stored on the OpsCenter primary to the
OpsCenter backup using the method you prefer, such as NFS mount or rysnc.
- Optional:
If you want to override the default values, edit the
[failover]
section of the OpsCenter configuration file opscenterd.conf.Table 1. OpsCenter daemon failover default configuration parameters Option Description Default heartbeat_period Frequency in seconds with which the primary OpsCenter sends a heartbeat to the backup OpsCenter. 10 heartbeat_reply_period Frequency in seconds with which the OpsCenter backup sends a heartbeat to the primary OpsCenter. 300 heartbeat_fail_window Amount of time in seconds that must elapse before the lack of a heartbeat triggers a failover. 60 failover_configuration_directory Directory location where failover-specific configuration is stored. The failover_id
file is also located in the failover directory.Note: The failover configuration directory should not be mirrored or replicated across OpsCenter installs when configuring OpsCenter to support failover.- /var/lib/opscenter/failover/ (package installs)
- install_location/failover/ (tarball installs)
-
On the backup OpsCenter in the failover directory,
create a
primary_opscenter_location
configuration file that indicates the IP address of the primary OpsCenter daemon to monitor:/var/lib/opscenter/failover/primary_opscenter_location
(package installs)install_location/failover/primary_opscenter_location
(tarball installs)
Theprimary_opscenter_location
file should only contain the IP address of the primary OpsCenter instance and nothing more:cat primary_opscenter_location
55.100.200.300
Ensure the user running OpsCenter has at least read permission for theprimary_opscenter_location
file. Before the backup OpsCenter can take over as the primary OpsCenter, the backup OpsCenter deletes theprimary_opscenter_location
file in the event of a failover. After a failover, recreate theprimary_opscenter_location
file on the newly designated backup OpsCenter.