Skip to main content

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;
  1. OPTIONAL (but recommended) : On any server - perform cluster health checks

    1. Confirm the RabbitMQ cluster is healthy:

      ${MOOGSOFT_HOME}/cots/rabbitmq-server/sbin/rabbitmqctl cluster_status

      This output should show three 'Running nodes' in the cluster

    2. 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
      done

      This command show show 'Percona XtraDB Cluster Node is synced' for every node

    3. 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

  2. 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

  3. One-time multi-server upgrade step

    Important

    RabbitMQ v4.3.4 can only be upgraded to from v4.2.0 onwards, so any clusters running RabbitMQ running v4.1.x need to be upgraded using this process

    For the purposes of this document, Server3 is the redundancy node, and Server1/Server2 are application nodes also running RabbitMQ

    1. Check the version of RabbitMQ (this command can be run on any node):

      ${MOOGSOFT_HOME}/cots/rabbitmq-server/sbin/rabbitmqctl version

      If this command returns v4.1.x, proceed with these instructions. If the command returns v4.2.x, you can skip this process and continue the rest of the upgrade

    2. Enable all feature flags for RabbitMQ v4.1.x (this command only needs to be run once, and on any node):

      ${MOOGSOFT_HOME}/cots/rabbitmq-server/sbin/rabbitmqctl enable_feature_flag all
    3. Starting with the redundancy RabbitMQ node (Server3):

      1. Drain the current node:

        ${MOOGSOFT_HOME}/cots/rabbitmq-server/sbin/rabbitmq-upgrade drain
      2. Stop the RabbitMQ process:

        $MOOGSOFT_HOME/bin/utils/process_cntl rabbitmq stop;
      3. Upgrade RabbitMQ on the current node:

        • Online deployments:

          ${MOOGSOFT_HOME/bin/utils/moog_init_mooms.sh -f https://github.com/rabbitmq/rabbitmq-server/releases/download/v4.2.0/rabbitmq-server-generic-unix-4.2.0.tar.xz
        • Offline deployments:

          Download the package on a server with internet access:

          curl -L -O https://github.com/rabbitmq/rabbitmq-server/releases/download/v4.2.0/rabbitmq-server-generic-unix-4.2.0.tar.xz

          Copy the package to the RabbitMQ node in question, and upgrade it:

          ${MOOGSOFT_HOME/bin/utils/moog_init_mooms.sh -f rabbitmq-server-generic-unix-4.2.0.tar.xz
      4. Restart RabbitMQ:

        $MOOGSOFT_HOME/bin/utils/process_cntl rabbitmq restart;
      5. Revive the node:

        ${MOOGSOFT_HOME}/cots/rabbitmq-server/sbin/rabbitmq-upgrade revive
      6. Confirm that all three 'Running nodes' are still reporting as present and running:

        ${MOOGSOFT_HOME}/cots/rabbitmq-server/sbin/rabbitmqctl cluster_status
    4. Repeat the previous step on Server1

    5. Repeat the previous step on Server2

    6. After all three nodes are upgraded to RabbitMQ v4.2.0, enable all new feature flags (this command only needs to be run once, against any node):

      ${MOOGSOFT_HOME}/cots/rabbitmq-server/sbin/rabbitmqctl enable_feature_flag all
  4. On Server 1

    1. Stop MoogFarmD to pause event processing (events will buffer in RabbitMQ)

      $MOOGSOFT_HOME/bin/utils/process_cntl moog_farmd stop;
  5. On Server 2

    1. Stop MoogFarmD to pause event processing (events will buffer in RabbitMQ)

      $MOOGSOFT_HOME/bin/utils/process_cntl moog_farmd stop;
  6. On Server 3 (Redundancy Server)

    1. 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;
    2. Upgrade the packages on the server

      This topic describes how to patch a tarball-based distribution of Moogsoft Onprem to v9.2.0.1 from v9.2.0

      1. Ensure the patch tarball is available to each server being patched:

        • Download the patch tarball using the following command (SPEEDY_USERNAME and SPEEDY_PASSWORD need to be set as environment variables before running this):

          curl -L -O "https://${SPEEDY_USERNAME}:${SPEEDY_PASSWORD}@speedy.moogsoft.com/v9/installer/moogsoft-enterprise-9.2.0.1.tgz"

          Copy the tarball to all servers where the product is installed.

      2. Record the DIST path for file comparison later (do not close the terminal these commands are run in, otherwise they will be lost):

        export OLD_DIST_PATH=$(readlink -f ${MOOGSOFT_HOME}/bin|awk -F '/' 'sub(FS $NF,x)');
        
      3. On servers running NGinX only, gather the required variables (do not close the terminal these commands are run in, otherwise they will be lost):

        export CERT_REAL_PATH_PEM=$(readlink -f $(grep -h 'ssl_certificate ' $OLD_DIST_PATH/cots/nginx/config/conf.d/moog-ssl.conf|awk '{print $2}'|tr -d ';'));
        export CERT_REAL_PATH_KEY=$(readlink -f $(grep -h 'ssl_certificate_key' $OLD_DIST_PATH/cots/nginx/config/conf.d/moog-ssl.conf|awk '{print $2}'|tr -d ';'));
        export CERT_PATH_PEM=$(grep -h 'ssl_certificate ' $OLD_DIST_PATH/cots/nginx/config/conf.d/moog-ssl.conf);
        export CERT_PATH_KEY=$(grep -h 'ssl_certificate_key' $OLD_DIST_PATH/cots/nginx/config/conf.d/moog-ssl.conf);
      4. Place the downloaded tarball file into an empty directory called patch_directory9.2.0.1 and execute the following commands to start the patch installation:

        cd patch_directory9.2.0.1;
        tar -xf moogsoft-enterprise-9.2.0.1.tgz;
        bash moogsoft-enterprise-install-9.2.0.1.sh;
      5. There may be changes in config files in this release (depending on the version being upgraded from). Identify the config files that have changed between the previously installed version and this version. For example:

        diff -rq $OLD_DIST_PATH/config $MOOGSOFT_HOME/dist/9.2.0.1/config | grep -i 'differ'

        Update files in ${MOOGSOFT_HOME}/config with any changes introduced in the v9.2.0.1 version of these files (if appropriate/needed).

      6. Uncomment entries in crontab:

        (crontab -l | sed -e 's/^\#\+\(.*events_analyser.*\)/\1/') | crontab -
        (crontab -l | sed -e 's/^\#\+\(.*keepalive.*\)/\1/') | crontab -
        
    3. 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 quorum
    4. Confirm this RabbitMQ node has rejoined the existing cluster:

      ${MOOGSOFT_HOME}/cots/rabbitmq-server/sbin/rabbitmqctl cluster_status
      

      Three nodes should be listed

  7. On Server 1

    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;
      
    2. Upgrade the packages on the server

      This topic describes how to patch a tarball-based distribution of Moogsoft Onprem to v9.2.0.1 from v9.2.0

      1. Ensure the patch tarball is available to each server being patched:

        • Download the patch tarball using the following command (SPEEDY_USERNAME and SPEEDY_PASSWORD need to be set as environment variables before running this):

          curl -L -O "https://${SPEEDY_USERNAME}:${SPEEDY_PASSWORD}@speedy.moogsoft.com/v9/installer/moogsoft-enterprise-9.2.0.1.tgz"

          Copy the tarball to all servers where the product is installed.

      2. Record the DIST path for file comparison later (do not close the terminal these commands are run in, otherwise they will be lost):

        export OLD_DIST_PATH=$(readlink -f ${MOOGSOFT_HOME}/bin|awk -F '/' 'sub(FS $NF,x)');
        
      3. On servers running NGinX only, gather the required variables (do not close the terminal these commands are run in, otherwise they will be lost):

        export CERT_REAL_PATH_PEM=$(readlink -f $(grep -h 'ssl_certificate ' $OLD_DIST_PATH/cots/nginx/config/conf.d/moog-ssl.conf|awk '{print $2}'|tr -d ';'));
        export CERT_REAL_PATH_KEY=$(readlink -f $(grep -h 'ssl_certificate_key' $OLD_DIST_PATH/cots/nginx/config/conf.d/moog-ssl.conf|awk '{print $2}'|tr -d ';'));
        export CERT_PATH_PEM=$(grep -h 'ssl_certificate ' $OLD_DIST_PATH/cots/nginx/config/conf.d/moog-ssl.conf);
        export CERT_PATH_KEY=$(grep -h 'ssl_certificate_key' $OLD_DIST_PATH/cots/nginx/config/conf.d/moog-ssl.conf);
      4. Place the downloaded tarball file into an empty directory called patch_directory9.2.0.1 and execute the following commands to start the patch installation:

        cd patch_directory9.2.0.1;
        tar -xf moogsoft-enterprise-9.2.0.1.tgz;
        bash moogsoft-enterprise-install-9.2.0.1.sh;
      5. There may be changes in config files in this release (depending on the version being upgraded from). Identify the config files that have changed between the previously installed version and this version. For example:

        diff -rq $OLD_DIST_PATH/config $MOOGSOFT_HOME/dist/9.2.0.1/config | grep -i 'differ'

        Update files in ${MOOGSOFT_HOME}/config with any changes introduced in the v9.2.0.1 version of these files (if appropriate/needed).

      6. Uncomment entries in crontab:

        (crontab -l | sed -e 's/^\#\+\(.*events_analyser.*\)/\1/') | crontab -
        (crontab -l | sed -e 's/^\#\+\(.*keepalive.*\)/\1/') | crontab -
        
    3. 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.

    4. 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 quorum
    5. Confirm this RabbitMQ node has rejoined the existing cluster:

      ${MOOGSOFT_HOME}/cots/rabbitmq-server/sbin/rabbitmqctl cluster_status
      

      Three nodes should be listed

    6. Upgrade Apache-Tomcat

      Warning

      This process will completely remove and re-deploy Apache-Tomcat. If the Apache-Tomcat logs need to be kept, a copy should be made before proceeding.

      Deploy the new version of Apache Tomcat with the latest webapps, and Nginx:

      IMPORTANT: If the Xmx value for apache-tomcat has been changed from the default in the $MOOGSOFT_HOME/bin/utils/process_cntl script, ensure the customised value is replaced after the upgrade, then restart the apache-tomcat process.

      Run these commands in the same terminal as the one where the variables were saved previously.

      $MOOGSOFT_HOME/bin/utils/process_cntl nginx stop;
      $MOOGSOFT_HOME/bin/utils/moog_init_ui.sh -tnfwz $($MOOGSOFT_HOME/bin/utils/moog_config_reader -k mooms.zone) --accept-eula
      cp -f $CERT_REAL_PATH_PEM $MOOGSOFT_HOME/cots/nginx/ssl/;
      cp -f $CERT_REAL_PATH_KEY $MOOGSOFT_HOME/cots/nginx/ssl/;
      sed -i "s|.*ssl_certificate .*|${CERT_PATH_PEM}|" $MOOGSOFT_HOME/cots/nginx/config/conf.d/moog-ssl.conf;
      sed -i "s|.*ssl_certificate_key.*|${CERT_PATH_KEY}|" $MOOGSOFT_HOME/cots/nginx/config/conf.d/moog-ssl.conf;
      $MOOGSOFT_HOME/bin/utils/process_cntl nginx restart;
    7. Perform final checks

      1. Validate the patch:

        $MOOGSOFT_HOME/bin/utils/moog_install_validator.sh
        $MOOGSOFT_HOME/bin/utils/tomcat_install_validator.sh
        $MOOGSOFT_HOME/bin/utils/moog_db_validator.sh

        If there are any errors from the above validators, please contact Moogsoft Support.

      2. Re-start non-UI integrations or LAMs

      3. Important

        Re-install the latest Add-ons pack: Install Moogsoft Add-ons

    8. 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
  8. On Server 2

    1. 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;
    2. Upgrade the packages on the server

      This topic describes how to patch a tarball-based distribution of Moogsoft Onprem to v9.2.0.1 from v9.2.0

      1. Ensure the patch tarball is available to each server being patched:

        • Download the patch tarball using the following command (SPEEDY_USERNAME and SPEEDY_PASSWORD need to be set as environment variables before running this):

          curl -L -O "https://${SPEEDY_USERNAME}:${SPEEDY_PASSWORD}@speedy.moogsoft.com/v9/installer/moogsoft-enterprise-9.2.0.1.tgz"

          Copy the tarball to all servers where the product is installed.

      2. Record the DIST path for file comparison later (do not close the terminal these commands are run in, otherwise they will be lost):

        export OLD_DIST_PATH=$(readlink -f ${MOOGSOFT_HOME}/bin|awk -F '/' 'sub(FS $NF,x)');
        
      3. On servers running NGinX only, gather the required variables (do not close the terminal these commands are run in, otherwise they will be lost):

        export CERT_REAL_PATH_PEM=$(readlink -f $(grep -h 'ssl_certificate ' $OLD_DIST_PATH/cots/nginx/config/conf.d/moog-ssl.conf|awk '{print $2}'|tr -d ';'));
        export CERT_REAL_PATH_KEY=$(readlink -f $(grep -h 'ssl_certificate_key' $OLD_DIST_PATH/cots/nginx/config/conf.d/moog-ssl.conf|awk '{print $2}'|tr -d ';'));
        export CERT_PATH_PEM=$(grep -h 'ssl_certificate ' $OLD_DIST_PATH/cots/nginx/config/conf.d/moog-ssl.conf);
        export CERT_PATH_KEY=$(grep -h 'ssl_certificate_key' $OLD_DIST_PATH/cots/nginx/config/conf.d/moog-ssl.conf);
      4. Place the downloaded tarball file into an empty directory called patch_directory9.2.0.1 and execute the following commands to start the patch installation:

        cd patch_directory9.2.0.1;
        tar -xf moogsoft-enterprise-9.2.0.1.tgz;
        bash moogsoft-enterprise-install-9.2.0.1.sh;
      5. There may be changes in config files in this release (depending on the version being upgraded from). Identify the config files that have changed between the previously installed version and this version. For example:

        diff -rq $OLD_DIST_PATH/config $MOOGSOFT_HOME/dist/9.2.0.1/config | grep -i 'differ'

        Update files in ${MOOGSOFT_HOME}/config with any changes introduced in the v9.2.0.1 version of these files (if appropriate/needed).

      6. Uncomment entries in crontab:

        (crontab -l | sed -e 's/^\#\+\(.*events_analyser.*\)/\1/') | crontab -
        (crontab -l | sed -e 's/^\#\+\(.*keepalive.*\)/\1/') | crontab -
        
    3. 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 quorum
    4. Confirm this RabbitMQ node has rejoined the existing cluster:

      ${MOOGSOFT_HOME}/cots/rabbitmq-server/sbin/rabbitmqctl cluster_status
      

      Three nodes should be listed

    5. Upgrade Apache-Tomcat

      Warning

      This process will completely remove and re-deploy Apache-Tomcat. If the Apache-Tomcat logs need to be kept, a copy should be made before proceeding.

      Deploy the new version of Apache Tomcat with the latest webapps, and Nginx:

      IMPORTANT: If the Xmx value for apache-tomcat has been changed from the default in the $MOOGSOFT_HOME/bin/utils/process_cntl script, ensure the customised value is replaced after the upgrade, then restart the apache-tomcat process.

      Run these commands in the same terminal as the one where the variables were saved previously.

      $MOOGSOFT_HOME/bin/utils/process_cntl nginx stop;
      $MOOGSOFT_HOME/bin/utils/moog_init_ui.sh -tnfwz $($MOOGSOFT_HOME/bin/utils/moog_config_reader -k mooms.zone) --accept-eula
      cp -f $CERT_REAL_PATH_PEM $MOOGSOFT_HOME/cots/nginx/ssl/;
      cp -f $CERT_REAL_PATH_KEY $MOOGSOFT_HOME/cots/nginx/ssl/;
      sed -i "s|.*ssl_certificate .*|${CERT_PATH_PEM}|" $MOOGSOFT_HOME/cots/nginx/config/conf.d/moog-ssl.conf;
      sed -i "s|.*ssl_certificate_key.*|${CERT_PATH_KEY}|" $MOOGSOFT_HOME/cots/nginx/config/conf.d/moog-ssl.conf;
      $MOOGSOFT_HOME/bin/utils/process_cntl nginx restart;
    6. Perform final checks

      1. Validate the patch:

        $MOOGSOFT_HOME/bin/utils/moog_install_validator.sh
        $MOOGSOFT_HOME/bin/utils/tomcat_install_validator.sh
        $MOOGSOFT_HOME/bin/utils/moog_db_validator.sh

        If there are any errors from the above validators, please contact Moogsoft Support.

      2. Re-start non-UI integrations or LAMs

      3. Important

        Re-install the latest Add-ons pack: Install Moogsoft Add-ons

    7. 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
    8. Enable all RabbitMQ feature flags:

      ${MOOGSOFT_HOME}/cots/rabbitmq-server/sbin/rabbitmqctl enable_feature_flag all
  9. The OpenSearch Cluster now needs to be recreated: Opensearch Clustering Guide - Tarball

  10. OPTIONAL (but recommended) : On any server - perform cluster health checks

    1. Confirm the RabbitMQ cluster is healthy:

      ${MOOGSOFT_HOME}/cots/rabbitmq-server/sbin/rabbitmqctl cluster_status

      This output should show three 'Running nodes' in the cluster

    2. 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
      done

      This command show show 'Percona XtraDB Cluster Node is synced' for every node

    3. 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

  11. On Server 1

    1. Start MoogFarmD

      $MOOGSOFT_HOME/bin/utils/process_cntl moog_farmd restart
  12. On Server 2

    1. Start MoogFarmD

      $MOOGSOFT_HOME/bin/utils/process_cntl moog_farmd restart
  13. Restart any event feeds if they were stopped

  14. Upgrade the Moogsoft Bridge server(s) :