Cluster Environment Version Upgrade
The version upgrade process in a cluster environment is similar to that in a standalone environment, following the workflow 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 is
hengshi
and the old version installation path is/opt/hengshi
.
sh
sudo su - hengshi # Switch to the product 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. Before installation, refer to Cluster Configuration Information to configure the
hosts
andvars.yml
files incluster-conf
. Ensure that the "hengshi-sense-cluster-[version]" directory is at the same level as thecluster-conf
directory. Then execute the cluster installation command. Refer to the example below:
shell
❯ ls
cluster-conf hengshi-sense-cluster-[version]
sh
sudo su - hengshi # Switch to the product runtime user
cd hengshi-sense-cluster-[version] # Navigate to the extracted target directory
./hs_install -m cluster -c ../cluster-conf # Execute cluster installation
The installation is successful when the status of all nodes in the installation prompt is [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
- Update system dependencies. During this operation, the user needs sudo permissions on each machine. After successful execution, sudo permissions can be revoked. Refer to the example below:
sh
sudo su - hengshi # Switch to the product runtime user
cd /opt/hengshi # Navigate to the installation target directory
bin/hengshi-sense-bin init-os all # Initialize OS
Tip
For offline environments, use bin/hengshi-sense-bin init-os all-offline
to skip online dependency installation.
- Start the service. Execute the start command in the installation directory.
sh
sudo su - hengshi # Switch to the product runtime user
cd /opt/hengshi # Navigate to the installation target directory
bin/hengshi-sense-bin start all # Start the new version service
The upgrade task is complete when the status of all nodes in the installation prompt 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