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
Undeploy and redeploy
NoSQL components.
Remove running
Local Edition 5.4.1 NoSQL container. Run the following command.
For single-zone deployment:
./undeploy-nosql-pod.sh
Deploy
Local Edition 5.5.0 NoSQL containers. Run the following command.
For single-zone deployment:
./deploy-nosql-pod.sh
Undeploy and redeploy
Log components.
Remove running
Local Edition 5.4.1 Log container. Run the following command.
For single-zone deployment:
./undeploy-log-pod.sh
Update the permissions for restricted user on Log volume. Run the following command on host machine where Log pod is installed.
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.
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
To deploy Mashery Local 5.5.0 SQL containers, run the following command.
For single zone deployment,
./deploy-sql-pod.sh
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
Clear the MySQL data in the 5.5.0 cluster.
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
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
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
Enable revert function.
In the
tml-sql pod, run the following command.
cd /opt/mashery/containeragent/resources/sql/scripts
./sql-upgrade.sh 5.4.1
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;
Undeploy and redeploy
Cache components.
Remove running
Local Edition 5.4.1 Cache container.
For single zone undeployment:
./undeploy-cache-pod.sh
To redeploy the container, run the following command.
./deploy-cache-pod.sh
Undeploy and redeploy
TM components.
Remove running
Local Edition 5.4.0 TM container.
For single zone undeployment:
./undeploy-tm-pod.sh
To deploy TM container, run the following command:
./deploy-tm-pod.sh
Note: This is applicable if reporting pod is deployed.
Undeploy and redeploy
Reporting components.
Remove running
Local Edition 5.4.1 TM container.
For single zone undeployment:
./undeploy-reporting-pod.sh
To deploy 5.5.0 TM container, run the following command: