MINIO Upgrade
Background: With the continuous version upgrades of the HENGSHI SENSE service, the internal object storage (Minio) component version of HENGSHI SENSE is also constantly being updated. You can choose to maintain the current version or upgrade to the latest built-in version.
This document explains how to upgrade Minio and how to roll back the database version if issues occur during the upgrade process.
Standalone/Cluster Deployment
Pre-upgrade Verification
The default built-in version of HENGSHI is "2022-10-24T18-35-07Z". You can confirm the current version in use by checking the directory ls \${HENGSHI_HOME}/lib
.
$ ls -al /opt/hengshi/lib/
...
minio -> minio-2022-10-24T18-35-07Z-linux-64
minio-2022-10-24T18-35-07Z-linux-64
...
Version Upgrade
Add the NEW_MINIO_VERSION
variable in the hengshi-sense-env.sh
file:
export NEW_MINIO_VERSION="2025-03-12"
Tip
By default, this variable does not need to be explicitly declared. It is only required when there are multiple MINIO versions in the lib
directory and you need to specify which version to upgrade to.
Before executing, copy the new version of minio from the hengshi upgrade package to the lib
directory of the current deployment. For example:
cp -a hengshi-sense-[version]/lib/minio-2025-03-12T18-04-18Z-linux-64 {HENGSHI_HOME}/lib/
cd {HENGSHI_HOME}
bin/hengshi-sense-bin stop hengshi ## Stop the hengshi service
bin/hengshi-sense-bin start minio ## Ensure the minio service is running before performing the upgrade operation.
bin/hengshi-sense-bin upgrade minio ## Perform the upgrade operation
The above prompt indicates that your minio database has been successfully upgraded.
Version Rollback
- If an exception occurs during the upgrade process, please perform the following steps to complete the version rollback:
cd {HENGSHI_HOME}
rm -rf minio-data
mv minio_data_bak minio_data
cd /opt/hengshi/lib
rm -rf minio
ln -s minio-2022-10-24T18-35-07Z minio
Container Deployment
Pre-upgrade Verification
Please contact the after-sales personnel to confirm the current MinIO version information and the upgraded MinIO version information.
Version Upgrade
- Upgrade the Minio service version by using the upgrade image hengshi-sense:minio-upgrade for the upgrade operation.
- Modify the
.env
file, setHS_IMAGE_TAG=$TAG
to configure$TAG
as the minio-upgrade image tag. - Modify the
docker-compose.yaml
file, and add the following configuration under the Minio service. Note that2022-10-24
is the current Minio version number.
environment:
MINIO_VERSION: 2022-10-24
- Pre-upgrade operations
# Stop the Hengshi service
docker-compose stop hengshi
# Stop the Minio service
docker stop hengshi-minio
docker rm -f hengshi-minio
# Start minio-upgrade
docker-compose up -d hengshi-minio
- Execute the upgrade operation
# Ensure the minio-upgrade container status is Up before proceeding with the upgrade operation.
docker exec -it hengshi-minio bash -c "/opt/hengshi/bin/hengshi-sense-bin upgrade minio"
5. The above prompt indicates that your Minio object storage upgrade is complete.
Version Rollback
- If an exception occurs during the upgrade process, please perform the following steps to complete the version rollback.
- Confirm the information in the
env
configuration file, specifically theHSHOME
address information.
cd $HSHOME # Navigate to the directory configured in HSHOME
cd hsdata
rm -rf minio_data
mv minio_data_bak minio_data
- After completing the rollback, restore the image tag in the
.env
file to the previous version.
k8s Deployment
Pre-upgrade Verification
Please contact the after-sales personnel to confirm the current MinIO version information and the upgraded MinIO version information.
Version Upgrade
- Upgrade the Minio service version by using the upgrade image hengshi-sense:minio-upgrade for the upgrade process.
- Modify the
minio.yaml
file and update the image versionimage: registry.hengshi.org/hengshi-sense:xxx
tohengshi-sense:minio-upgrade-xx
. - Modify the
configmap.yaml
configuration parameters to add the following configuration. Note that2022-10-24
is the current Minio version number.
MINIO_VERSION: 2022-10-24
- Pre-upgrade operations:
# Stop the HENGSHI service
kubectl -n hengshi scale deployment hengshi-sense --replicas=0
# Stop the Minio service
kubectl -n hengshi scale sts metadb --replicas=0
# Start the metadb-upgrade service (ensure the image address in minio.yaml has been updated)
kubectl -n hengshi apply minio.yaml
kubectl -n hengshi scale sts minio --replicas=1
- Perform the following upgrade operations:
# Ensure the minio-upgrade container status is Up before proceeding with the upgrade.
kubectl -n hengshi exec -it minio-0 -- bash -c "/opt/hengshi/bin/hengshi-sense-bin upgrade minio"
5. The above prompt indicates that your metadb database upgrade is complete.
Version Rollback
- If an exception occurs during the upgrade process, please perform the following steps to complete the version rollback:
kubectl -n hengshi exec -it minio-0 -- /bin/bash
cd /opt/hengshi
rm -rf minio-data
mv minio-data_bak minio-data
- After the rollback is complete, restore the image tag in the minio.yaml file to the previous version.