Skip to content

Cluster Environment Version Upgrade

Upgrading the version in a cluster environment is the same as in a standalone environment, following the process of stopping the old version service -> installing the new version -> updating dependencies -> starting the new version service. The detailed upgrade steps are as follows.

  1. Obtain the new version installation package and extract it to the installation device.

  2. Stop the old version service. Enter the running user, and execute the stop service command in the installation directory. Refer to the example below, where the executing username is hengshi, and the old version installation path is /opt/hengshi.

sh
sudo su - hengshi             # Switch to the product running user
cd /opt/hengshi               # Enter the installation target directory
bin/hengshi-sense-bin stop all    # Stop the old version services
  1. Install the new version. Before installation, please refer to Cluster Configuration Information to configure the contents of the hosts and vars.yml files in the cluster-conf directory, and ensure that the hengshi-sense-[version] directory is at the same level as the cluster-conf directory. Then execute the cluster installation command. Refer to the example below during the operation.
sh
sudo su - hengshi             # Switch to the product running user
cd ~/pkgs/hengshi-sense-[version]           # Switch to the target directory
./hs_install -m cluster -c ../cluster-conf    # Execute cluster installation

The installation is successful when all node statuses in the installation prompt are [unreachable=0,failed=0].

sh
PLAY RECAP ****************************************************************
Node-A : ok=18   changed=3    unreachable=0    failed=0    skipped=2    rescued=0    ignored=0
Node-B : ok=18   changed=3    unreachable=0    failed=0    skipped=2    rescued=0    ignored=0
Node-C : ok=18   changed=3    unreachable=0    failed=0    skipped=2    rescued=0    ignored=0
  1. Update system dependencies. This operation requires the user to have sudo privileges on each machine during the execution process, and the sudo privileges can be closed after successful execution. Please refer to the example for the operation.
sh
sudo su - hengshi             # Switch to the product running user
cd /opt/hengshi                 # Enter the installation target directory
bin/hengshi-sense-bin init-os all  # Initialize os
  1. Start the service. In the installation directory, execute the startup command.
sh
sudo su - hengshi             # Switch to the product running user
cd /opt/hengshi                # Enter the installation target directory
bin/hengshi-sense-bin start all   # Start the new version service

The installation prompt indicates that the service has started successfully and the upgrade task is complete when the status of each node is [unreachable=0,failed=0].

sh
PLAY RECAP ***********************************************************************
Node-A              : ok=4    changed=3    unreachable=0    failed=0    skipped=2    rescued=0    ignored=0
Node-B              : ok=3    changed=2    unreachable=0    failed=0    skipped=3    rescued=0    ignored=0
Node-C              : ok=3    changed=2    unreachable=0    failed=0    skipped=3    rescued=0    ignored=0

HENGSHI SENSE Platform User Manual