Version Upgrade for Container Deployment
When the HENGSHI version is upgraded, please follow the steps below to perform the upgrade operation on the container.
Download and import the new version image.
- Obtain the offline image from dockerhub.
shdocker pull hengshi-sense:$TAG
- Import the offline image.
shwget https://download.hengshi.com/releases/hengshi-sense-xxx.tar.gz docker load -i hengshi-sense-xxx.tar.gz
In the container environment, data backup operations are not performed by default during the upgrade process. You can perform data backup operations as needed Container Environment Backup and Restore.
Pause the service.
shellcd single docker-compose down
Obtain the docker-compose deployment file according to the upgrade version. For configuration files, refer to Preparation Before Deployment.
Update the HENGSHI SENSE image tag.
shellcd single NEW_TAG=hengshi-sense-xxx #Set the variable to the new tag sed -i -e "s/^HS_IMAGE_TAG=.*$/HS_IMAGE_TAG=${NEW_TAG}/" .env
Start the service, the upgrade is complete.
shellcd single docker-compose up -d
Notes for upgrade version >=4.0
- Starting from service image version >= 4.0, the default version of Metadb is 13.5. You can determine whether to perform an upgrade operation as needed.
- Upgrade Operation
- Maintain the current version
- Edit the docker-compose.yaml file and modify the parameter ${HS_IMAGE_TAG:-need_hs_image_version} under the metadb>image configuration to the <4.0 version image information.
Notes:
- The flink of version 5.1.x has been removed and does not need to be run. After the upgrade, you can consider stopping and cleaning up the flink container.
Version Upgrade for Helm Deployment
The upgrade process is similar to container deployment, with the same need to pay attention to Metadb Version Upgrade and Data Backup. The default version >=4.0 is 13.5, and you can decide whether to proceed with the upgrade operation as needed.
Non-cross-major-version upgrades (e.g., 3.6 > 4.1), usually involve backing up your data and then upgrading by specifying the version number with --version.
hs-config Configuration Reference
helm upgrade -f hs-config.yaml Hengshi-Sense hengshi-charts/hengshi-sense --version 0.1.2 -n [namespace] # Chart version to upgrade
Here is an example of upgrading from 3.6 to 4.1 across multiple versions (with a focus on upgrading the metadb, which should be done before upgrading HENGSHI-SENSE).
- Unset the CLUSTER_ENABLE variable or set it to false before upgrading Metadb
kubectl -n [namespace] exec -it metadb-0 -- bash
export | grep "CLUSTER_ENABLE"
unset CLUSTER_ENABLE
- Use the upgrade image registry.hengshi.org/hengshi-metadb:upgrade
# Replace the image address in metadb with the upgrade image address (two places)
kubectl -n [namespace] edit statefulset.apps/metadb
# Restart the pod
kubectl -n [namespace] scale statefulset.apps/metadb --replicas=0
kubectl -n [namespace] scale statefulset.apps/metadb --replicas=1
- Upgrade metadb operation
kubectl -n [namespace] exec -it metadb-0 -- /bin/bash
cd /opt/hengshi
bin/hengshi-sense-bin stop metadb single ## Stop operation
bin/hengshi-sense-bin upgrade metadb single ## Upgrade operation
The above prompt indicates that your metadb database has been successfully upgraded. If it fails, please refer to: Metadb Upgrade Rollback
- Upgrade HENGSHI SENSE
hs-config Configuration Reference
helm upgrade -f hs-config.yaml Hengshi-Sense hengshi-charts/hengshi-sense --version 1.1.7 -n [namespace] # Chart version to upgrade