Standalone Environment Version Upgrade
In a standalone environment, the version upgrade process generally follows the flow of stopping the old version service -> installing the new version -> updating dependencies -> starting the new version service. Detailed upgrade steps are as follows:
Obtain the new version installation package and extract it to the installation device.
Stop the old version service.
Switch to the runtime user and execute the stop service command in the installation directory. Refer to the example below, where the runtime username ishengshiand the old version installation path is/opt/hengshi.
sudo su - hengshi # Switch to the runtime user
cd /opt/hengshi # Navigate to the installation target directory
bin/hengshi-sense-bin stop all # Stop the old version service- Install the new version. Execute the new version installation command in the extracted package directory. Refer to the example below for operation.
sudo su - hengshi # Switch to the runtime user
cd ~/pkgs/hengshi-sense-[version] # Navigate to the extracted target directory
# Install the new version. The script will automatically back up the data from the previous version.
# In special cases where backup is not required, confirm with HENGSHI technical support and use the parameter -s t to skip the backup.
./hs_install -p /opt/hengshiThe following message indicates that the new version has been successfully installed:
SUCCESSED! installed to xxxxxNote
If you are not using HENGSHI's metadb, ensure that the variable export HS_PG_IF_EXTERNAL=false is set to true. You can modify this in the configuration file conf/hengshi-sense-env.sh. During the upgrade process, stopping this service will not be required.
- Update system dependencies. This operation requires the user to have
sudopermissions during execution. Once successful,sudopermissions can be revoked. Refer to the example below for operation.
sudo su - hengshi # Switch to the runtime user
cd /opt/hengshi # Navigate to the installation target directory
bin/hengshi-sense-bin init-os all # Initialize OSNote
For offline environments, use bin/hengshi-sense-bin init-os all-offline to skip online dependency updates.
(4.x/5.x/6.x → 7.0+): Use a package with bundled JDBC drivers. Start MinIO before business services; Flyway publishes factory drivers automatically. Do not run
driverctl migratebeforestart all. See 7.0+ JDBC Drivers. Skip this note for other upgrades.Start the new version service. Execute the new version start command in the installation directory.
sudo su - hengshi # Switch to the runtime user
cd /opt/hengshi # Navigate to the installation target directory
bin/hengshi-sense-bin start all # Start the new version serviceWhen the service starts successfully, the following message will be displayed, and the module status will be IS ACTIVE:
IS ACTIVE! : [metadb] @127.0.0.1:5301/hengshi
IS ACTIVE! : [engine] @localhost:5302/hengshi
IS ACTIVE! : [minio] minio server /opt/hengshi/minio-data
IS ACTIVE! : [redis] 127.0.0.1@5307
IS ACTIVE! : [syslog] syslog-ng --no-caps --module-path=/opt/hengshi/lib/syslog-ng/lib/syslog-ng -f /opt/hengshi/conf/syslog-ng.conf -p /opt/hengshi/logs/syslog-ng.pid -R /opt/hengshi/logs/syslog-ng.persist -c /opt/hengshi/logs/syslog-ng.ctl
IS ACTIVE! : [apmserver] /opt/hengshi/lib/apm-server/apm-server -c /opt/hengshi/conf/apm-server.yaml
IS ACTIVE! : [hengshi] jar /opt/hengshi/lib/bootstrap-6.0.0.jar
IS ACTIVE! : [monit] /opt/hengshi/lib/monit/bin/monit -c /opt/hengshi/conf/monitrc- Upgrade complete. Access the service address via a browser to use the HENGSHI SENSE service.
7.0+ JDBC Drivers
WARNING
4.x/5.x/6.x → 7.0+: use a package with bundled JDBC drivers. Background: Upgrade notices.
Happy path: step 6 start all. Do not remove HENGSHI_JDBC_CONFIG from conf/hengshi-sense-env.sh until custom data sources work.
If Flyway fails (business does not start): stop hengshi, keep MinIO running:
cd /opt/hengshi
bin/hengshi-sense-bin start minio
bin/driverctl migrate --drivers-dir /opt/hengshi/lib/default-datasource-driver
bin/driverctl list
bin/hengshi-sense-bin stop minioThen start all again. If factory drivers are already in object storage and only custom drivers are missing, use import in JDBC Driver Management; do not overwrite with migrate.
Day-to-day ops: JDBC Driver Management.
Rollback
The main operation of decompression rollback is to restore the contents of the most recent backup archive in the backup directory to the deployment location (including: program, configuration, data).
Prepare rollback files
First, navigate to thebackupdirectory and select the most recent archive for decompression. Be sure to confirm the timestamp of the archive. In the example, the archive in thehengshi-20210819163228directory is selected for decompression, with a timestamp of2021-08-19_16:32:28.Rollback program and data
cd /opt/hengshi
bin/hengshi-sense-bin stop all
tar -xf backup/hengshi-20210819163228/bin_conf_lib.tar.gz
mv pg_data pg_data.bak
bin/hengshi-sense-bin init metadb
bin/hengshi-sense-bin start metadb
bin/dbrestore.sh -m metadb -l ${PWD}/backup/hengshi-20210819163228 -t metadb_backup.2021-08-19_16-33-14[.tar.gz]
bin/hengshi-sense-bin stop metadb
bin/hengshi-sense-bin start all- Clean up old data
After rollback, and upon confirming no issues through business checks, execute the following cleanup operations:
cd /opt/hengshi
rm pg_data.bak -rf
cd backup/hengshi-20210819163228 && rm metadb_backup.2021-08-19_16-33-14 -rf