Tarball - Upgrade database components
Follow these steps to perform a Tarball upgrade on the Moogsoft Enterprise database components to v8.2.0 from v7.0.x, v7.1.x, or 7.2.x:
Moogsoft Enterprise databases
MySQL
Refer to Upgrade Moogsoft Enterprise or general information and upgrade instructions for other components and versions.
Upgrade MySQL Community to v5.7.36
Note
Use the following instructions if the database deployed is MySQL Community instead of Percona.
You should upgrade MySQL to 5.7.36 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.36 tarball to the server:
curl -L -O https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.36-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.36-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.3./5.7.36/g' ~/.bashrc; source ~/.bashrc;
Update the
~/.my.cnf
file to reflect the correct path for MySQL. Run the following commands to update this file. The commands 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 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 $(awk "NR>$(cat -un ~/.my.cnf | egrep '\[mysqld\]' | awk '{print $1}')" ~/.my.cnf | egrep 'socket\s*=' | head -1 | awk -F= '{print $2}')
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:
$MOOGSOFT_HOME/bin/utils/process_cntl mysql restart
See the Upgrading MySQL documentation for more information.
Upgrade Percona to v5.7.36
Note
These instructions apply to upgrading a single-node Percona cluster. For instructions on upgrading a multi-node Percona cluster, see Percona Cluster 5.7 Tarball Minor Version Upgrade.
Note
Use the following instructions if the database deployed is Percona instead of MySQL Community.
You should upgrade Percona to v5.7.36 to address a number of bugs and security vulnerabilities.
You should back-up your database before upgrading.
Download the Percona 5.7.36 tarball file to the server:
curl -L -O https://downloads.percona.com/downloads/Percona-XtraBackup-2.4/Percona-XtraBackup-2.4.24/binary/tarball/percona-xtrabackup-2.4.24-Linux-x86_64.glibc2.12.tar.gz curl -L -O https://downloads.percona.com/downloads/Percona-XtraDB-Cluster-57/Percona-XtraDB-Cluster-5.7.36-31.55/binary/tarball/Percona-XtraDB-Cluster-5.7.36-rel39-55.1.Linux.x86_64.glibc2.12.tar.gz
Check if Percona 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 Percona tarball files into the desired location and extract them:
tar -xf Percona-XtraDB-Cluster-5.7.36-rel39-55.1.Linux.x86_64.glibc2.12.tar.gz; tar -xf percona-xtrabackup-2.4.24-Linux-x86_64.glibc2.12.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;Percona-XtraDB-Cluster-5\.7[^/]\+;Percona-XtraDB-Cluster-5.7.36-rel39-55.1.Linux.x86_64.glibc2.12;' ~/.bashrc; sed -i 's/percona-xtrabackup-[^/]\+/percona-xtrabackup-2.4.24-Linux-x86_64.glibc2.12/g' ~/.bashrc source ~/.bashrc;
You must update the
~/.my.cnf
file to reflect the correct path for MySQL. Run the following commands to update this file. The commands 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 sed -i "s;wsrep_provider\s*=.*;wsrep_provider = ${MYSQL_HOME}/lib/libgalera_smm.so;" ~/.my.cnf
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 $(awk "NR>$(cat -un ~/.my.cnf | egrep '\[mysqld\]' | awk '{print $1}')" ~/.my.cnf | egrep 'socket\s*=' | head -1 | awk -F= '{print $2}')
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:
$MOOGSOFT_HOME/bin/utils/process_cntl mysql restart
See the Upgrading MySQL documentation for more information.
Upgrade Moogsoft Enterprise
To upgrade Moogsoft Enterprise, 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-enterprise-8.2.0.tgz bash moogsoft-enterprise-install-8.2.0.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 Enterprise v7.3.x and 8.0.x, the Cookbooks, 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 file_only_config=true
flag has been added to the 7.3.x and 8.0.x versions of moog_farmd.conf
that you can use to prevent the migration from taking place. If this flag is missing or is set to false
, Moogfarmd attempts to perform the import when it starts.
Note
If the file_only_config
flag is set to true
, UI-based Cookbooks will not run.
The following moolets are no longer supported in v8.0.x and should be removed from the moog_farmd.conf file as part of the upgrade:
Sigaliser Classic
Nexus
Speedbird
AlertRootCause
Version specific config file differences:
v7.1.x-v7.2.x
$MOOGSOFT_HOME/config/system.conf
message_persistence is now enabled by default
$MOOGSOFT_HOME/config/security.conf
The 'Google' realm has been deprecated and removed
$MOOGSOFT_HOME/config/servlets.conf
The toolrunner servlet now optionally supports ssh key authentication as well as username/password-based authentication
$MOOGSOFT_HOME/config/moog_farmd.conf
alert_workflows.conf moolet has been added
enrichment_workflows.conf moolet has been added
event_workflows.conf moolet has been added
situations_workflows.conf moolet has been added
v7.2.x-v7.3.x
$MOOGSOFT_HOME/config/system.conf
New integration database property has been added: intdb_database_name
$MOOGSOFT_HOME/config/moog_farmd.conf
The entire sig_resolution block containing merge groups, retention_period etc has been removed but is still supported as long as file_only_config is true
alert_root_cause.conf moolet has been removed and is no longer supported
nexus.conf moolet has been removed and is no longer supported
speedbird.conf moolet has been removed and is no longer supported
sigaliser.conf moolet has been removed and is no longer supported
cookbook.conf has been removed but is still supported as long as file_only_config is set to true
tempus.conf has been removed but is still supported as long as file_only_config is set to true
v7.3.x-v8.0.x
$MOOGSOFT_HOME/config/system.conf
ElasticSearch now supports basic authentication
$MOOGSOFT_HOME/config/security.conf
There is a new global_settings block which allows control of the CSRF protection feature
$MOOGSOFT_HOME/config/servlets.conf
It is now possible to configure the toolrunner to run on a port other than 22 using toolrunnerport property
$MOOGSOFT_HOME/config/moog_farmd.conf
alert_inform_workflows.conf moolet has been added
situation_inform_workflows.conf moolet has been added
The 'modules' block has been removed as it only contained Topology-related functionality and this has been deprecated in the v8.0.x release - the Topology feature works differently.
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' v8.0.x versions of the config and bot files are stored in $MOOGSOFT_HOME/dist/8.0.0.4/config/
and $MOOGSOFT_HOME/dist/8.0.0.4/bots/
respectively.
Do not copy the config and bot files from the previous version on top of the new versions of those files in $MOOGSOFT_HOME/bots/ or $MOOGSOFT_HOME/contrib/ in 8.0.x. These files are not always forward-compatible, and some config and bot files require additional lines for the new version to work.
Important
The Workflow Engine requires the right version of the 'bot' and 'contrib' files to be in place before moog_farmd is restarted later in the upgrade process:
The v8.0.x version of $MOOGSOFT_HOME/dist/8.0.*/bots/moobots/WorkflowEngine.js should be copied into $MOOGSOFT_HOME/bots/moobots/
The v8.0.x versions of files under $MOOGSOFT_HOME/dist/8.0.*/contrib/ should be copied into $MOOGSOFT_HOME/contrib/
Identify the config files that have changed between the previously installed version and v8.0.x. Replace <previous_version> with the version installed previously, for example 7.3.1.1.
diff -rq $MOOGSOFT_HOME/dist/<previous_version>/config $MOOGSOFT_HOME/dist/8.0.*/config | grep -i 'differ'
Update files in
$MOOGSOFT_HOME/config
with any changes introduced in the v8.0.x versions of these files.Identify the contrib files that have changed between the previously installed version and v8.0.x. Replace <previous_version> with the version installed previously for example 7.3.1.1.
diff -rq $MOOGSOFT_HOME/dist/<previous_version>/contrib $MOOGSOFT_HOME/dist/8.0.*/contrib | grep -i 'differ'
Update files in
$MOOGSOFT_HOME/contrib
with any changes introduced in the v8.0.x versions of these files.Identify the bot files that have changed between the previously installed version and v8.0.x. Replace <previous_version> with the version installed previously, for example 7.3.1.1.
diff -rq $MOOGSOFT_HOME/dist/<previous_version>/bots $MOOGSOFT_HOME/dist/8.0.*/bots | grep -i 'differ'
Update files in
$MOOGSOFT_HOME/bots
with any changes introduced in the v8.0.x versions of these files.
Upgrade the Moogsoft Enterprise database schema
Before upgrading the schema, check if the MySQL variable log_bin_trust_function_creators
is enabled:
mysql -u root -p -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/' ~/.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 Enterprise 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 Enterprise 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 8.0.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 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 - Upgrade data ingestion component.