Upgrading Local Edition cluster from 5.4.1 to 5.5.0 for Docker Swarm Untethered

The following section provides information on upgrading Local Edition cluster from version 5.4.1 to 5.5.0 for Docker swarm.

The following steps are applicable to swarm environment in tethered mode.

Prerequisites

  • Local Edition 5.5.0 images must be built and pushed to the desired registry for deployment.
  • The volumes for tml-nosql, tml-logtml-cacheare reused, so while doing upgrade the number of these pods must be consistent with the earlier version.
  • The customization done to the JSON properties files in earlier version must be ported to 5.5.0.
  • Admin must generate the manifest deployment folder, namely the manifest-single-zone, as per the deployment topology for version 5.4.1 by running the compose command.
Note: Some traffic disruptions are expected during upgrade. To minimize disruptions, upgrade theLocal Edition components sequentially, explained as follows.

Procedure

  1. Undeploy and redeploy NoSQL components.
    1. Remove running Local Edition 5.4.1 NoSQL container. Run the following command.
      • For single-zone deployment:
        ./undeploy-nosql-pod.sh
    2. Deploy Local Edition 5.5.0 NoSQL containers. Run the following command.
      • For single-zone deployment:
        ./deploy-nosql-pod.sh
  2. Undeploy and redeploy Log components.
    1. Remove running Local Edition 5.4.1 Log container. Run the following command.
      • For single-zone deployment:
        ./undeploy-log-pod.sh
    2. Update the permissions for restricted user on Log volume. Run the following command on host machine where Log pod is installed.
      chown 1001:1003 -R /var/lib/docker/volumes/logstack_log-1-vol/_data/data/tml-log/
    3. Deploy Local Edition 5.5.0 Log containers. Run the following command.
      • For single-zone deployment:
        ./deploy-log-pod.sh
  3. Undeploy and redeploy CM components.
    1. Remove running Local Edition 5.4.1 CM container. Run the following command.
      • For single-zone deployment:
        ./undeploy-cm-pod.sh
    2. Deploy Local Edition 5.5.0 Log containers. Run the following command.
      • For single-zone deployment:
        ./deploy-cm-pod.sh
  4. Undeploy and redeploy SQL components.
    1. Dump MySQL Data from the cluster created in the earlier version. Login to any tml-sql pod running in the earlier cluster.
      docker exec -it <mysql pod> -- /bin/bash
      
    2. To dump MySQL data. Update the MySQL password for the cluster, run the following command .
      mysqldump --no-create-info --complete-insert --single-transaction -u root -p'changeme' --ignore-table=masherysolar.area_config --ignore-table=masherysolar.areas --ignore-table=masherysolar.package_key_audit_log --ignore-table=masherysolar.application_audit_log --set-gtid-purged=OFF masherysolar > /tmp/mash_data.sql
      Note: In case duplication of data occurs then redo the MySQL data dump by ignoring the duplicate entries. The following are few cases where duplication of entries is observed.
      • masherysolar.member_activity_log
      • masherysolar.member_audit_log
      • masherysolar.member_role_audit_log
      • masherysolar.method_override_audit_log
      • masherysolar.migration_log
    3. Copy the MySQL data file to the host.
      docker cp <mysql pod>:/tmp/mash_data.sql mash_data.sql
    4. Remove the SQL container from the 5.4.1 cluster.
      For single zone deployment,
      ./undeploy-sql-pod.sh
      Note: Delete SQL pvc after undeploying the SQL pod,
      kubectl delete pvc $(kubectl get pvc -o=jsonpath='{.items[?(@.metadata.labels.app=="mysql-svc")].metadata.name}')l
    5. To deploy Mashery Local 5.5.0 SQL containers, run the following command.
      For single zone deployment,
      ./deploy-sql-pod.sh
  5. Copy the MySQL data from 5.4.0 cluster in the 5.5.0 cluster.
    To copy MySQL data file to any tml-sql pod in TML 5.5.0 cluster, run the following command:
    docker cp mash_data.sql <mysql pod>:/tmp
  6. Clear the MySQL data in the 5.5.0 cluster.
    1. In the 5.5.0 cluster, login to thetml-sql pod where the MySQL data file was copied.
      docker exec -it <mysql pod> /bin/bash
    2. To clear data in MySQL, run the following command:
      mysql -u root -p'changeme' -Nse 'show tables' masherysolar | sed -r 's/\b(area_config|areas|package_key_audit_log)\b//g' | sed '/^$/d' | while read table; do mysql -u root -p'changeme' -e "truncate table $table" masherysolar; done
  7. Import MySQL data dumped from the 5.4.1 cluster to the 5.5.0 cluster.

    Run the following command in each tml-sql pod in the new cluster.

    mysql -u root -p'changeme' -e "truncate table masherysolar.trust_store"
    mysql -u root -p'changeme' -e "truncate table masherysolar.identity_store"
    mysql -u root -p'changeme' masherysolar < /tmp/mash531_data.sql
  8. Enable revert function.
    1. In the tml-sql pod, run the following command.
      cd /opt/mashery/containeragent/resources/sql/scripts
      ./sql-upgrade.sh 5.4.1
    2. Connect to the masherysolar database in mysql and update the MySQL password of the cluster
      ./deploy-cache-pod.sh
      SELECT id INTO @endpoint_id from `service_definition_endpoints` where epkey = 'fctgxsxh84vjpn8vr7zfh6kt';
      UPDATE service_provider SET config = REPLACE(config, '"service_definition_endpoint_id":171231' collate utf8_unicode_ci,
          concat('"service_definition_endpoint_id":', @endpoint_id) collate utf8_unicode_ci) WHERE id = 6926;
  9. Undeploy and redeploy Cache components.
    Remove running Local Edition 5.4.1 Cache container.
    1. For single zone undeployment:
      • ./undeploy-cache-pod.sh
    2. To redeploy the container, run the following command.
      ./deploy-cache-pod.sh
  10. Undeploy and redeploy TM components.
    Remove running Local Edition 5.4.0 TM container.
    1. For single zone undeployment:
      • ./undeploy-tm-pod.sh
    2. To deploy TM container, run the following command:
      ./deploy-tm-pod.sh
  11. Note: This is applicable if reporting pod is deployed.
    Undeploy and redeploy Reporting components.
    Remove running Local Edition 5.4.1 TM container.
    1. For single zone undeployment:
      • ./undeploy-reporting-pod.sh
    2. To deploy 5.5.0 TM container, run the following command:
      ./deploy-reporting-pod.sh