Skip to content

Version Upgrade for Container Deployment

When the HENGSHI version is upgraded, please follow the steps below to perform the upgrade operation on the container.

  1. Download and import the new version image.

    • Obtain the offline image from dockerhub.
    sh
    docker pull hengshi-sense:$TAG
    • Import the offline image.
    sh
    wget https://download.hengshi.com/releases/hengshi-sense-xxx.tar.gz
    docker load -i hengshi-sense-xxx.tar.gz
  2. 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.

  3. Pause the service.

    shell
    cd single
    docker-compose down
  4. Obtain the docker-compose deployment file according to the upgrade version. For configuration files, refer to Preparation Before Deployment.

  5. Update the HENGSHI SENSE image tag.

    shell
    cd 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
  6. Start the service, the upgrade is complete.

    shell
    cd single
    docker-compose up -d
  7. Notes for upgrade version >=4.0

    1. 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.
    2. Upgrade Operation
    3. Maintain the current version
      1. 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.
  8. Notes:

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

shell
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).

  1. Unset the CLUSTER_ENABLE variable or set it to false before upgrading Metadb
shell
kubectl -n [namespace] exec -it metadb-0 -- bash
export | grep "CLUSTER_ENABLE"
unset CLUSTER_ENABLE
  1. Use the upgrade image registry.hengshi.org/hengshi-metadb:upgrade
shell
# 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
  1. Upgrade metadb operation
shell
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

  1. Upgrade HENGSHI SENSE

hs-config Configuration Reference

shell
helm upgrade -f hs-config.yaml Hengshi-Sense hengshi-charts/hengshi-sense --version 1.1.7 -n [namespace] # Chart version to upgrade

HENGSHI SENSE Platform User Manual