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.
Obtain the new version installation package and extract it to the installation device.
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.
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
- Install the new version. Before installation, please refer to Cluster Configuration Information to configure the contents of the
hosts
andvars.yml
files in thecluster-conf
directory, and ensure that thehengshi-sense-[version]
directory is at the same level as thecluster-conf
directory. Then execute the cluster installation command. Refer to the example below during the operation.
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].
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
- 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.
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
- Start the service. In the installation directory, execute the startup command.
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].
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