Set Up a High Availability Deployment
This page describes how to set up and deploy Controllers as a high availability (HA) pair. For installation and upgrade details, see Custom InstallNo Content found for /db/organizations/splunk/repositories/appdonprem-26_6_0/AppDynamics/documents/content/on_premises/c_custom_install.dita and Upgrade an HA Pair.
About the HA Deployment Using the Enterprise Console
The Enterprise Console automates HA-related setup and administration tasks for the Linux operating system. It does not require sudo privileges and can be deployed as a non-root user on Unix operating systems. It works with most flavors of Linux, including Ubuntu and Red Hat/CentOS.
You can:
- Configure Controllers in a high availability pair arrangement.
- Use the Enterprise Console to monitor the health of the primary Controller, App Server, and database, and failover to the secondary when needed.
- Use scripts that allows you to install the Controllers as a Linux service, and gracefully stop and start service in the event of a machine reboot.
- Failover to a secondary Controller manually (for example, when you need to perform maintenance on the primary).
- Revive a Controller (restore a Controller as an HA secondary after its database is more than seven days behind the primary as a replica).
- Set up a Controller HA pair.
Deploying Controllers as an HA pair ensures that service downtime in the event of a Controller machine failure is minimized. It also facilitates other administrative tasks, such as backing up data. For more background information, including the benefits of HA, see Controller High Availability (HA).
User Privilege Escalation Requirements
After installing a Controller high availability via the Enterprise Console, it is recommended to install MySQL as a Linux service. This is to prevent against MySQL data integrity issues. Installing the Controller and MySQL as a Unix service will ensure that whenever the machine reboots, the service will be shut down and started gracefully.
/etc/sudoers.d/appdynamicscontains entries to allow the Splunk AppDynamics user to access the/sbin/serviceutility usingsudowithout a password. This mechanism is not available if theSplunk AppDynamics user is authenticated by LDAP.-
/sbin/appdserviceis asetuidroot program distributed in source form in<controller_home>/controller-ha/init/appdservice.c.It is written explicitly to support auditing by security audit systems. Theinstall-init.shscript compiles and installs the program. It is executable only by the Splunk AppDynamics user and the root user. The script requires a C compiler to be available on the system. You can install a C compiler using the package manager for your operating system. For example, on Yum-based Linux distributions, you can use the following command to install the GNU Compiler, which includes a C compiler:sudo yum install gcc
Set Up the Controller High Availability Pair
To set up high availability:
- Step 1: Configure the Controller High Availability Pair Environment
- Step 2: Install a Controller High Availability PairNo Content found for /db/organizations/splunk/repositories/appdonprem-26_6_0/AppDynamics/documents/content/on_premises/c_step_2_install_a_controller_high_availability_pair.dita
- Step 3: Activate the Controller High Availability PairNo Content found for /db/organizations/splunk/repositories/appdonprem-26_6_0/AppDynamics/documents/content/on_premises/c_step_2_install_a_controller_high_availability_pair.dita
- Step 4: Install as a ServiceNo Content found for /db/organizations/splunk/repositories/appdonprem-26_6_0/AppDynamics/documents/content/on_premises/c_step_4_install_as_a_service.dita
Step 1: Configure the Controller High Availability Pair Environment
The following sections provide more information on how to configure a few of the system requirements. They describe how to configure the settings on Red Hat Linux as a sample deployment. Note that the specific steps for configuring these requirements may differ on different systems. Consult your system documentation for specific details.
Host Reverse Lookups
You need to set up a reliable symmetrical reverse host lookup on each machine. To do this, enter the hostnames of the pair into the hosts files (/etc/hosts) on each machine. This is preferable over other approaches, such as using reverse DNS, which adds a point of failure.
-
In
/etc/nsswitch.conf, enterfilesbeforednsto have thehostsfile entries take precedence over DNS. For example:hosts: files dns -
In
/etc/hostsfile, add an entry for each host in the HA pair. For example:192.168.144.128 host1.domain.com host1192.168.144.137 host2.domain.com host2Note: To reduce errors, use the correct format of/etc/hostsfiles. If you have both dotted hostnames and short versions, you need to list the dotted hostnames with the most dots first and the other versions subsequently. This should be done consistently for both HA server entries in each of the two/etc/hostsfiles. Note that in the examples provided, the aliases are listed last.
Set Up the SSH Key
SSH must be installed on both hosts in a way that gives the user who runs the Controller passwordless SSH access to the other Controller system in the HA pair. You can accomplish this by generating a key pair on each node, and placing the public key of the other Controller into the authorized keys (authorized_keys) file on each Controller.
The following steps describe how to perform this configuration. The instructions assume an Splunk AppDynamics user named appduser, and the Controller hostnames are node1, the active primary, and node2, the secondary. Adjust the instructions for your particular environment. Also note that you may not need to perform every step (for example, you may already have the .ssh directory and don't need to create a new one).
Although not shown here, some of the steps may prompt you for a password.
On the primary (node1) host:-
Change to the Splunk AppDynamics user,
appduserin our example:su - appduser
-
Create a directory for SSH artifacts (if it doesn't already exist) and set permissions on the directory, as follows:
mkdir -p .ssh chmod 700 .ssh
-
Generate the RSA-formatted key:
ssh-keygen -t rsa -N "" -f .ssh/id_rsa -m pem
-
Secure copy the key to the other Controller:
scp .ssh/id_rsa.pub node2:/tmp
-
As you did for node1, run these commands:
su - appduser mkdir -p .ssh chmod 700 .ssh ssh-keygen -t rsa -N "" -f .ssh/id_rsa -m pem scp .ssh/id_rsa.pub node1:/tmp
-
Add the public key of node1 that you previously copied to the secondary Controller host's authorized keys and set permissions on the authorized keys file:
cat /tmp/id_rsa.pub >> .ssh/authorized_keys chmod 700 ~/.ssh/authorized_keys
-
Move the secondary's public key to the authorized keys
cat /tmp/id_rsa.pub >> ~/.ssh/authorized_keys chmod 700 ~/.ssh/authorized_keys
To test the configuration, enter:
ssh -oNumberOfPasswordPrompts=0 <other_node> "echo success"
Verify that the echo command is successful.
Step 3: Activate the Controller High Availability Pair
This step ensures that the Enterprise Console is no longer in the critical path of the HA Controller failover process.
Open a command shell on the Enterprise Console host and enter:
platform-admin.sh submit-job --service controller --job activate-ha-modules
Your output should be similar to the following:

Convert a Standalone Controller to a Controller High Availability Pair
You can convert a standalone Controller to a Controller HA pair through the Enterprise Console GUI. Ensure that you have completed the prerequisites in the above Configure the Controller High Availability Pair Environment section that requires both the primary and secondary hosts to talk to each other via passwordless SSH.
Additionally, you can use incremental replication to add a secondary Controller. See Initiate Controller Database Incremental Replication for more information.
If you are starting from a fresh installation, you will need to first create a platform, then add two credentials and hosts for your HA pair.
To convert a standalone Controller to a Controller HA pair:
- Open the Enterprise Console GUI.
- Verify that the credentials and hosts you want to use are added to the Splunk AppDynamics On-Premises platform. For more information, see Administer the Enterprise ConsoleNo Content found for /db/organizations/splunk/repositories/appdonprem-26_6_0/AppDynamics/documents/content/on_premises/c_administer_the_enterprise_console.dita.
- On the Controller page, click Add Secondary Controller, and complete the wizard:
- Select Submit.