RPM - Upgrade database components
Follow these steps to perform an RPM 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 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.1.1/')
-
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.1.1*.rpm
Upgrade MySQL to v5.7.26
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.
-
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.
-
Download and install the MySQL packages using the appropriate step below:
-
If the server running MySQL has internet access, download and install the packages from the MySQL Yum repository:
yum -y upgrade mysql-community-libs-5.7.31 \ mysql-community-libs-compat-5.7.31 \ mysql-community-server-5.7.31 \ mysql-community-common-5.7.31 \ mysql-community-client-5.7.31
-
If the server running MySQL does not have internet access, download the packages on a server that does have internet access and copy the files 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.31-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.31-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.31-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.31-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.9-1.el7.x86_64.rpm;
Then manually install the packages:
yum -y upgrade mysql-*5.7.31*.rpm
-
-
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
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:
service mysqld restart
See the Upgrading MySQL documentation for more information.
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. You can skip
this step if you have already completed this step as part of this upgrade process on the current
host.
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.
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
).
You can skip this step if you have already completed this step as part of this upgrade process on the current host.
To confirm this has worked, run the following command:
$JAVA_HOME/bin/java -version
It should return:
openjdk version "11.0.5" 2019-10-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.
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
.
You can skip this step if you have already completed this step as part of this upgrade process on the current host.
Upgrade the Moogsoft AIOps database schema
Before upgrading the schema, check if the MySQL log_bin_trust_function_creators
variable is enabled:
mysql -e "show variables like '%log_bin_trust_function_creators%';"
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:
service 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.
-
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 - Upgrade data ingestion components.