Tarball - Upgrade database components
Follow these steps to perform a Tarball upgrade on the Moogsoft AIOps database components to v7.3 from v7.0.x, v7.1.x, or 7.2.x:
-
Moogsoft AIOps databases
-
MySQL
Refer to Upgrade Moogsoft AIOps for general information and upgrade instructions for other components and versions.
Upgrade MySQL to v5.7.26
You must update the ~/.my.cnf
file to reflect the correct path for
MySQL. Run the following commands to update this file. The command below assumes the Database
.my.cnf
file is under the current user's 'home' folder.
MYSQL_HOME=$(dirname $(dirname $(which mysqld))) sed -i "s;basedir.*;basedir = ${MYSQL_HOME};" ~/.my.cnf sed -i '/\[mysqld\]/a log_bin_trust_function_creators = 1\nthread_stack = 524288\n' ~/.my.cnf
Restart MySQL:
$MOOGSOFT_HOME/bin/utils/process_cntl mysqld restart
Note
Use the following instructions if the database deployed is MySQL Community instead of Percona.
You should upgrade MySQL to 5.7.26 to address a number of bugs and security vulnerabilities.
Before you start the upgrade process, you should back up your database.
-
Download the MySQL 5.7.26 tarball to the server:
curl -L -O https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.26-el7-x86_64.tar.gz
-
Check if MySQL is configured to run with
--gtid-mode=ON
using the following command in the MySQL CLI:show variables like 'gtid_mode';
Remember what the value is because you will need it later.
-
Move the MySQL tarball into the desired location and extract it:
tar -xf mysql-5.7.26-el7-x86_64.tar.gz
-
Update the system
PATH
to point at the new MySQL folder. The command below assumes the new MySQL folder is in the same folder as the previous MySQL folder (user home). If this is not the case, you must manually update the~/.bashrc
file.sed -i 's/5.7.22/5.7.26/g' ~/.bashrc; source ~/.bashrc;
-
Restart MySQL:
$MOOGSOFT_HOME/bin/utils/process_cntl mysql restart
-
If the
gtid-mode
was OFF (based on the command run earlier in the upgrade), run the MySQL upgrade utility. Provide the MySQL root password when prompted or just press Enter if no password set.mysql_upgrade -u root -p -S $MOOGSOFT_HOME/var/lib/mysql/var/lib/mysql/mysql.sock
if the
gtid-mode
was ON, you do not need to do this step.See the MySQL documentation on restrictions on replication with GTIDs for more information.
-
Restart MySQL to save any changes to system tables:
$MOOGSOFT_HOME/bin/utils/process_cntl mysql restart
See the Upgrading MySQL documentation for more information.
Upgrade Moogsoft AIOps
To upgrade Moogsoft AIOps, run the following commands.
If you have already run this step on the current host as part of this upgrade (for single-host upgrade for example), you can skip this step.
tar -xf moogsoft-aiops-7.3.1.1.tgz bash moogsoft-aiops-install-7.3.1.1.sh
Follow the instructions that appear. The upgrade process detects the existing installation and performs the upgrade.
Important
If any of the checks performed by the install script are reported as a failure on the initial screen, please contact Moogsoft support as this could impact functionality.
Merge the latest configuration file changes
Note
In Moogsoft AIOps v7.3.x, the Sigalisers (Cookbook and Tempus),
and merge groups (default and custom) are imported into the database by default, enabling you
to to access and configure them via the UI and API. The migration occurs once when Moogfarmd
is restarted. A new flag has been added to the 7.3.x version of moog_farmd.conf
that you can use to prevent the migration from taking
place (file_only_config=true
). If this flag is missing or is set to
false
, Moogfarmd attempts to perform the import when it starts.
The top-level $MOOGSOFT_HOME/config
and $MOOGSOFT_HOME/bots
folders are the master folder locations for
configuration and bot files.
Note
If you have already completed this step previously (as part of this upgrade process) on the current host, you can skip this step.
The new 'default' v7.3 versions of the config and bot files are stored in $MOOGSOFT_HOME/dist/7.3.1.1/config/
and $MOOGSOFT_HOME/dist/7.3.1.1/bots/
respectively.
The config and bot files from the previous version should not be copied on top of (replace) the new version of those files in 7.3, as they are not always forwards-compatible, and some config/bot lines need to be added for the new version to work.
-
Identify the config files that have changed between the previously installed version and v7.3. For example:
diff -rq $MOOGSOFT_HOME/dist/7.[^3]*/config $MOOGSOFT_HOME/dist/7.3.*/config | grep -i 'differ'
-
Update files in
$MOOGSOFT_HOME/config
with any changes introduced in the v7.3 versions of these files. -
Identify the contrib files that have changed between the previously installed version and v7.3. For example:
diff -rq $MOOGSOFT_HOME/dist/7.[^3]*/contrib $MOOGSOFT_HOME/dist/7.3.*/contrib | grep -i 'differ'
-
Update files in
$MOOGSOFT_HOME/contrib
with any changes introduced in the v7.3 versions of these files. -
Identify the bot files that have changed between the previously installed version and v7.3. For example:
diff -rq $MOOGSOFT_HOME/dist/7.[^3]*/bots $MOOGSOFT_HOME/dist/7.3.*/bots | grep -i 'differ'
-
Update files in
$MOOGSOFT_HOME/bots
with any changes introduced in the v7.3 versions of these files.
Upgrade the Moogsoft AIOps database schema
Before upgrading the schema, check if the MySQL variable log_bin_trust_function_creators
is enabled:
mysql -e "show variables like '%log_bin_trust_function_creators%';"
You must enter the root username and password when you run this command. The value must be ON or 1. If the value is OFF or 0, you must enable this variable and restart the database:
-
Open the
/etc/my.cnf
file on the host running Percona MySQL. -
If the variable is not in this file, run the following to add the variable to the file:
sed -i 's/\(innodb_autoinc_lock_mode.*\)/\1\nlog_bin_trust_function_creators = 1\n/' /etc/my.cnf
If the variable is already in the
/etc/my.cnf
file, set the variable to 1. -
Once you have enabled the variable, restart the database:
$MOOGSOFT_HOME/bin/utils/process_cntl mysqld restart
To upgrade the Moogsoft AIOps database, provide the Auto Upgrader utility with the credentials of a database user with super privileges. For single-host installations where MySQL was installed as part of the Moogsoft AIOps deployment, you can use the default 'root' user.
-
Ensure the database is running, then execute the following command, replacing
<MySQL-SuperUsername>
with the username of your super user:bash $MOOGSOFT_HOME/bin/utils/moog_db_auto_upgrader -t 7.3.0 -u <MySQL-SuperUsername>
-
Enter the password for the user.
Note
You can provide the password to the utility with the
-p
flag but Moogsoft does not recommend this in non-test deployments for security reasons.
Drop deprecated historic database tables
Note
Only perform this step if you are upgrading from Moogsoft AIOps v7.0.x.
Run the following commands to drop two tables from the historic database that are no longer used. If you do not drop the tables at this stage, the Database Validator utility that you run during the validation step reports their presence as a delta.
Note
Run these commands on the server where the database or, on RPM deployments, the moogsoft-db package is installed.
These commands may fail if DBSplit has never been enabled. You can ignore these errors.
bash $MOOGSOFT_HOME/bin/utils/moog_mysql_client -i -e "drop table room_post_sigs" 2>/dev/null; bash $MOOGSOFT_HOME/bin/utils/moog_mysql_client -i -e "drop table room_posts" 2>/dev/null;
To continue with the upgrade, see Tarball v7.3 - Upgrade data ingestion components.