RPM - Upgrade database components
Follow these steps to perform an RPM upgrade on the Moogsoft AIOps database components to v7.3.x 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 Moogsoft AIOps
To upgrade Moogsoft AIOps, run the upgrade command below that corresponds to your chosen upgrade mechanism.
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.
If you are using a remote or offline Yum repository, run the following command on every host where a Moogsoft AIOps RPM package is installed:
yum -y upgrade $(rpm -qa --qf '%{NAME}\n' | grep moogsoft | sed 's/$/-7.3.0/')
If you are using downloaded RPM files on a host, run the following command from the location where the files are installed:
yum -y upgrade moogsoft-*7.3.0*.rpm
Upgrade MySQL to v5.7.26
It is important to upgrade MySQL to 5.7.26 to address a number of bugs and security vulnerabilities.
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. Official instructions for upgrading to 5.7.26 are here: https://dev.mysql.com/doc/refman/5.7/en/upgrading.html and the steps are summarized below. Moogsoft recommends that you perform a backup of the database before continuing.
Download and install the MySQL packages using the appropriate step below:
Systems configured with the MySQL Yum repository:
yum -y upgrade mysql-community-libs-5.7.26 \ mysql-community-libs-compat-5.7.26 \ mysql-community-server-5.7.26 \ mysql-community-common-5.7.26 \ mysql-community-client-5.7.26
Or download the MySQL packages to the server running MySQL:
curl -L -O https://repo.mysql.com/yum/mysql-5.7-community/el/7/x86_64/mysql-community-libs-5.7.26-1.el7.x86_64.rpm; curl -L -O https://repo.mysql.com/yum/mysql-5.7-community/el/7/x86_64/mysql-community-libs-compat-5.7.26-1.el7.x86_64.rpm; curl -L -O https://repo.mysql.com/yum/mysql-5.7-community/el/7/x86_64/mysql-community-server-5.7.26-1.el7.x86_64.rpm; curl -L -O https://repo.mysql.com/yum/mysql-5.7-community/el/7/x86_64/mysql-community-common-5.7.26-1.el7.x86_64.rpm; curl -L -O https://repo.mysql.com/yum/mysql-5.7-community/el/7/x86_64/mysql-community-client-5.7.26-1.el7.x86_64.rpm;
Then manually install the packages:
yum -y upgrade mysql-*5.7.26*.rpm
If the
gtid-mode
was OFF (based on the command run earlier in the upgrade), run the MySQL upgrade utility. Provide mysql root password when prompted or just press Enter if no password set.mysql_upgrade -u root -p
More information on GTID and the MySQL upgrade is here: https://dev.mysql.com/doc/refman/5.7/en/replication-gtids-restrictions.html#replication-gtids-restrictions-mysql_upgrade.
Restart MySQL to ensure any changes to system tables are saved:
service mysqld restart
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.
Manually merge and compare .rpmsave
versions of files with the new versions of those files. Add any new properties to the older versions of the 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 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.x, as they are not always forwards-compatible, and some config/bot lines need to be added for the new version to work.
To find files that have been changed, moved or deleted, run these commands:
find $MOOGSOFT_HOME -name '*.rpmsave' find /etc/init.d/ -name '*.rpmsave'
For example, the following command displays the differences in the new version of the system.conf
file:
diff -u $MOOGSOFT_HOME/config/system.conf $MOOGSOFT_HOME/config/system.conf.rpmsave
Follow this process to merge the file differences:
Rename the new versions of the files, without the
.rpmsave
extension, to end with.bak
.Merge the
.rpmsave
file with the new.bak
file by adding new properties/configuration where needed (from the new version of the file into the old version), so the structure matches the new version of the file.Rename the
.rpmsave
file to remove the.rpmsave
extension.
Update JVM to use Java 11
Note
Only perform this step if you are upgrading from Moogsoft AIOps v7.0.x or v7.1.x.
Note
If you have already completed this step previously (as part of this upgrade process) on the current host, you can skip this step.
On each server with a Moogsoft AIOps RPM package installed, run the following command to replace the /usr/java/latest
symlink so it points at the new JDK11 JAVA_HOME
directory:
source $MOOGSOFT_HOME/bin/utils/moog_init_functions.sh
If there are non-Moogsoft AIOps packages on this server that do not support JDK11, you must update those applications to use a different JAVA_HOME
symlink (not /usr/java/latest
).
To confirm this has worked, run the following command:
$JAVA_HOME/bin/java -version
It should return:
openjdk version "11.0.2" 2019-01-15 LTS
You can also use the 'alternatives' command to point the system 'java' shortcut to the new version:
alternatives --config java
Remove references to the old MySQL connector
Note
Only perform this step if you are upgrading from Moogsoft AIOps v7.0.x or v7.1.x.
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 MySQL connector is upgraded in this release.
The original connector may be used by the External Database module in the current deployment, configured in $MOOGSOFT_HOME/config/moog_external_db_details.conf
.
If this file is configured in the current deployment, update it to reference the new mariadb connector here: $MOOGSOFT_HOME/lib/cots/mariadb-java-client-2.4.0.jar
.
Upgrade the Moogsoft AIOps database schema
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.
Run the following command, replacing
<MySQL-SuperUsername>
with the username of your super user:Note
Run this command on the server where the database is installed (on an RPM deployment, this is where the moogsoft-db package is deployed).
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 RPM v7.3.x - Upgrade data ingestion components.