Set Up the Database for HA
The database layer Moogsoft AIOps for HA uses the Percona XtraDB Cluster mechanism.
See Database Strategy for more information about the supported database platform.
HA architecture
In our distributed HA installation, the database components are installed on servers 3, 4, and 5:
![]() |
The roles are installed as follows:
Server 3: DB 1.
Server 4: DB 2.
Server 5: DB 3.
Fully distributed installation
See Distributed HA Installation for a reference diagram and steps to achieve a fully distributed installation.
Minimally distributed installation
For a minimally distributed installation follow the instructions below, replacing server 3, server 4 and server 5 with the relevant values for your architecture.
Build a Percona cluster
The sections below detail how to build a Percona XtraDB cluster.
Install Moogsoft AIOps components on DB 1, DB 2, DB 3
On servers 3, 4 and 5, install the following Moogsoft AIOps components:
yum -y install moogsoft-utils-7.3* moogsoft-db-7.3*
Set up Percona on DB 1
On server 3, run install_percona_nodes.sh
to install, configure and start Percona Cluster node 1:
install_percona_nodes.sh -p -d -i <server 3 ip address>,<server 4 ip address>,<server 5 ip address> -u sstuser -w passw0rd
Moogsoft advises that you provide the IP addresses instead of hostnames for servers running the Percona Cluster in order to reduce network latency. The “sstuser“, in the command above, is the user that will be used by the Percona nodes to communicate with each other. The script performs the following tasks:
Disables SELinux and sets the
vm.swappiness
property to 1.Installs the Percona Yum repository.
Installs the Percona compatibility package.
Installs Percona XtraDB cluster.
Installs the Extended Internet Service Daemon (xinetd).
Creates a
my.cnf
configuration file based on the server's hardware.Configures a
mysqlchk
service on port 9198 and restarts the xinetd service.Starts the first Percona node in bootstrap mode.
Reconfigures
my.cnf
to ensure the node will restart in non-bootstrap mode.
Initialize the Moogsoft AIOps database
On server 3, run the following commands to create the Moogsoft AIOps databases (moogdb
, moog_reference
, historic_moogdb
, moog_intdb
), and populate them with the required schema:
$MOOGSOFT_HOME/bin/utils/moog_init_db.sh -qIu root --accept-eula <<-EOF EOF
Note
You do not need to run this command on any of the other nodes. The new schema is replicated automatically around the cluster.
Set up Percona on DB 2
On server 4, run install_percona_nodes.sh
for DB 2. The script will perform the same actions, only this time starting the second Percona node to join the first node as a cluster:
install_percona_nodes.sh -d -i <server 3 ip address>,<server 4 ip address>,<server 5 ip address> -u sstuser -w passw0rd
Set up Percona on DB 3
On server 5, run install_percona_nodes.sh
as you did for DB 1 and DB 2. The script will perform the same actions, only this time starting the third Percona node to join the first and second nodes as a cluster.
install_percona_nodes.sh -d -i <server 3 ip address>,<server 4 ip address>,<server 5 ip address> -u sstuser -w passw0rd
Verify Percona cluster status
To verify the replication status of each node, run the following commands from a remote server:
curl http://<server3 ip address/hostname>:9198 curl http://<server4 ip address/hostname>:9198 curl http://<server5 ip address/hostname>:9198
A successful response is shown below:
[root@ldev01]# curl -v http://server3:9198 * About to connect() to ldev03 port 9198 (#0) * Trying 10.99.1.24... * Connected to server3 (10.99.1.24) port 9198 (#0) > GET / HTTP/1.1 > User-Agent: curl/7.29.0 > Host: ldev03:9198 > Accept: */* > < HTTP/1.1 200 OK < Content-Type: text/plain < Connection: close < Content-Length: 40 < Percona XtraDB Cluster Node is synced.