Patch Moogsoft Onprem Tarball v9.2.0 to v9.2.0.1
This topic describes how to patch a Tarball-based distribution of Moogsoft Onprem to v9.2.0.1 from v9.2.0
Important
This process requires the presence of a third Moogsoft Onprem server to act a redundancy server as per : Fully Distributed HA Installation
In the process below, Server 1 and Server 2 are existing Moogsoft Onprem servers running MoogFarmD, Apache-Tomcat, RabbitMQ etc
In the process below, Server 3 is the Redundancy Server running RabbitMQ and possibly OpenSearch too
Important
If any of the RabbitMQ commands (rabbitmqctl / rabbit-upgrade etc) fail with any errors mentionging escript/erl/erlang, run this command to add erlang to the PATH in the shell, then retry the command:
[[ ":$PATH:" != *"$MOOGSOFT_HOME/cots/erlang/bin/"* ]] && export PATH=$MOOGSOFT_HOME/cots/erlang/bin/:$PATH;
OPTIONAL (but recommended) : On any server - perform cluster health checks
Confirm the RabbitMQ cluster is healthy:
${MOOGSOFT_HOME}/cots/rabbitmq-server/sbin/rabbitmqctl cluster_statusThis output should show three 'Running nodes' in the cluster
Confirm the Percona cluster is healthy:
moog_mysql_client -e "SHOW STATUS LIKE 'wsrep_cluster_size';"
The above command should return 3 for a 3-node cluster etc.
Now check all nodes are synced:
for CLUSTER_NODE in $(moog_mysql_client -sNe "SELECT VARIABLE_VALUE FROM performance_schema.global_status WHERE VARIABLE_NAME='wsrep_incoming_addresses'" 2>/dev/null | tr ',' '\n' | cut -d: -f1); do echo -n "${CLUSTER_NODE}: "; curl -s http://${CLUSTER_NODE}:9198 doneThis command show show 'Percona XtraDB Cluster Node is synced' for every node
Confirm the OpenSearch cluster is healthy:
curl -XGET 'https://localhost:9200/_cluster/health?pretty' -u moog_opensearchuser:$(${MOOGSOFT_HOME}/bin/utils/moog_config_reader -k search.password)This should report: "number_of_nodes" : 3
One-time multi-server upgrade step
Update all Percona nodes to the latest version using the instructions here: Percona Cluster 8.4 Tarball Minor Version Upgrade
One-time multi-server upgrade step
On Server 1
Stop MoogFarmD to pause event processing (events will buffer in RabbitMQ)
$MOOGSOFT_HOME/bin/utils/process_cntl moog_farmd stop;
On Server 2
Stop MoogFarmD to pause event processing (events will buffer in RabbitMQ)
$MOOGSOFT_HOME/bin/utils/process_cntl moog_farmd stop;
On Server 3 (Redundancy Server)
Stop all services
$MOOGSOFT_HOME/bin/utils/process_cntl opensearch stop; ${MOOGSOFT_HOME}/cots/rabbitmq-server/sbin/rabbitmq-upgrade drain $MOOGSOFT_HOME/bin/utils/process_cntl rabbitmq stop;Upgrade the packages on the server
Restart the RabbitMQ service and rejoin the cluster:
$MOOGSOFT_HOME/bin/utils/process_cntl rabbitmq restart; ${MOOGSOFT_HOME}/cots/rabbitmq-server/sbin/rabbitmq-upgrade revive ${MOOGSOFT_HOME}/cots/rabbitmq-server/sbin/rabbitmq-queues rebalance quorumConfirm this RabbitMQ node has rejoined the existing cluster:
${MOOGSOFT_HOME}/cots/rabbitmq-server/sbin/rabbitmqctl cluster_statusThree nodes should be listed
On Server 1
Stop all services (update the commands below as needed)
$MOOGSOFT_HOME/bin/utils/process_cntl apache-tomcat stop; ${MOOGSOFT_HOME}/cots/rabbitmq-server/sbin/rabbitmq-upgrade drain $MOOGSOFT_HOME/bin/utils/process_cntl rabbitmq stop; kill -9 $(ps -ef | grep java | grep lam | awk '{print $2}') 2>/dev/null; (crontab -l | sed -e 's/^\(.*events_analyser.*\)$/#\1/') | crontab - (crontab -l | sed -e 's/^\(.*keepalive.*\)$/#\1/') | crontab - ps -ef | grep java | egrep 'events_analyser|keepalive' | awk '{print $2}' | xargs kill 2>/dev/null; kill -9 $(ps -ef | grep java | grep Broker | awk '{print $2}') 2>/dev/null;Upgrade the packages on the server
If the Enrichment Database (Create the Enrichment API Data Store) is being used, ensure the schema is updated using the schema update command on that page.
Restart the RabbitMQ service and rejoin the cluster:
$MOOGSOFT_HOME/bin/utils/process_cntl rabbitmq restart; ${MOOGSOFT_HOME}/cots/rabbitmq-server/sbin/rabbitmq-upgrade revive ${MOOGSOFT_HOME}/cots/rabbitmq-server/sbin/rabbitmq-queues rebalance quorumConfirm this RabbitMQ node has rejoined the existing cluster:
${MOOGSOFT_HOME}/cots/rabbitmq-server/sbin/rabbitmqctl cluster_statusThree nodes should be listed
Upgrade Apache-Tomcat
Perform final checks
Start the LAMs (update the commands below as needed)
$MOOGSOFT_HOME/bin/utils/process_cntl rest_lam restart $MOOGSOFT_HOME/bin/utils/process_cntl socket_lam restart
On Server 2
Stop Tomcat and LAMs and RabbitMQ (update the commands below as needed)
$MOOGSOFT_HOME/bin/utils/process_cntl apache-tomcat stop; kill -9 $(ps -ef | grep java | grep lam | awk '{print $2}') 2>/dev/null; (crontab -l | sed -e 's/^\(.*events_analyser.*\)$/#\1/') | crontab - (crontab -l | sed -e 's/^\(.*keepalive.*\)$/#\1/') | crontab - ps -ef | grep java | egrep 'events_analyser|keepalive' | awk '{print $2}' | xargs kill 2>/dev/null; kill -9 $(ps -ef | grep java | grep Broker | awk '{print $2}') 2>/dev/null; ${MOOGSOFT_HOME}/cots/rabbitmq-server/sbin/rabbitmq-upgrade drain $MOOGSOFT_HOME/bin/utils/process_cntl rabbitmq stop;Upgrade the packages on the server
Restart the RabbitMQ service and rejoin the cluster:
$MOOGSOFT_HOME/bin/utils/process_cntl rabbitmq restart; ${MOOGSOFT_HOME}/cots/rabbitmq-server/sbin/rabbitmq-upgrade revive ${MOOGSOFT_HOME}/cots/rabbitmq-server/sbin/rabbitmq-queues rebalance quorumConfirm this RabbitMQ node has rejoined the existing cluster:
${MOOGSOFT_HOME}/cots/rabbitmq-server/sbin/rabbitmqctl cluster_statusThree nodes should be listed
Upgrade Apache-Tomcat
Perform final checks
Start the LAMs (update the commands below as needed)
$MOOGSOFT_HOME/bin/utils/process_cntl rest_lam restart $MOOGSOFT_HOME/bin/utils/process_cntl socket_lam restart
Enable all RabbitMQ feature flags:
${MOOGSOFT_HOME}/cots/rabbitmq-server/sbin/rabbitmqctl enable_feature_flag all
The OpenSearch Cluster now needs to be recreated: Opensearch Clustering Guide - Tarball
OPTIONAL (but recommended) : On any server - perform cluster health checks
Confirm the RabbitMQ cluster is healthy:
${MOOGSOFT_HOME}/cots/rabbitmq-server/sbin/rabbitmqctl cluster_statusThis output should show three 'Running nodes' in the cluster
Confirm the Percona cluster is healthy:
moog_mysql_client -e "SHOW STATUS LIKE 'wsrep_cluster_size';"
The above command should return 3 for a 3-node cluster etc.
Now check all nodes are synced:
for CLUSTER_NODE in $(moog_mysql_client -sNe "SELECT VARIABLE_VALUE FROM performance_schema.global_status WHERE VARIABLE_NAME='wsrep_incoming_addresses'" 2>/dev/null | tr ',' '\n' | cut -d: -f1); do echo -n "${CLUSTER_NODE}: "; curl -s http://${CLUSTER_NODE}:9198 doneThis command show show 'Percona XtraDB Cluster Node is synced' for every node
Confirm the OpenSearch cluster is healthy:
curl -XGET 'https://localhost:9200/_cluster/health?pretty' -u moog_opensearchuser:$(${MOOGSOFT_HOME}/bin/utils/moog_config_reader -k search.password)This should report: "number_of_nodes" : 3
On Server 1
Start MoogFarmD
$MOOGSOFT_HOME/bin/utils/process_cntl moog_farmd restart
On Server 2
Start MoogFarmD
$MOOGSOFT_HOME/bin/utils/process_cntl moog_farmd restart
Restart any event feeds if they were stopped
Upgrade the Moogsoft Bridge server(s) :