Updated on 2024-09-23 GMT+08:00

Batch Upgrading MRS Cluster Clients

The client package downloaded from FusionInsight Manager contains the client batch upgrade tool. When multiple clients need to be upgraded after the cluster upgrade or scale-out, you can use this tool to upgrade the clients in batches with a few clicks. In addition to upgrading clients in batches, this tool also provides the lightweight function of updating the /etc/hosts files on the nodes where the clients are located in batches.

This section applies only to MRS 3.x or later.

Preparing for the Batch Upgrade

  1. Log in to FusionInsight Manager.
  2. Choose Cluster > Overview > More > Download Client (for MRS 3.3.0 or later, click Download Client on the Homepage page) to download the client to a specified directory on the server.

    For details, see Installing an MRS Cluster Client.

    Decompress the downloaded client package and find the batch_upgrade directory, for example, /tmp/FusionInsight-Client/FusionInsight_Cluster_1_Services_ClientConfig/batch_upgrade.

  3. Choose Cluster > Client Management. On the Client Management page, click Export All to export all client information to the local PC.
  4. Decompress the exported client information and upload the client-info.cfg file to the batch_upgrade directory.
  5. Perform the following operations to supplement the missing passwords in the client-info.cfg file:

    Run the vi client-info.cfg command to add a user password.

    Example:

    clientIp,clientPath,user,password
    10.10.10.100,/home/omm/client /home/omm/client2,omm,Password

    The fields in the configuration file are as follows:

    • clientIp: indicates the IP address of the node where the client is located.
    • clientPath: indicates the client installation path. Multiple paths are separated by spaces. Note that the path cannot end with a slash (/).
    • user: indicates the username of the node.
    • password: indicates the user password of the node.
    • If the execution fails, view the node.log file in the work_space/log_XXX directory.
    • There can be security risks if a configuration file contains the authentication password. You are advised to delete the configuration file or use other secure methods to keep the password.

Procedure

  1. Log in to the client download node as the user who wants to install the client.
  2. Perform the upgrade.

    sh client_batch_upgrade.sh -u -f /tmp/FusionInsight-Client/FusionInsight_Cluster_1_Services_Client.tar -g /tmp/FusionInsight-Client/FusionInsight_Cluster_1_Services_ClientConfig/batch_upgrade/client-info.cfg

    You are advised to delete the client-info.cfg file as soon as possible after the upgrade because the password has been configured.

  3. After the upgrade is complete, verify the upgrade result by running the sh client_batch_upgrade.sh -c command.
  4. If the client is faulty, run the sh client_batch_upgrade.sh -s command to roll back the client.

    • The client batch upgrade tool moves the original client to the backup directory, and then uses the client package specified by the -f parameter to install the client. Therefore, if the original client contains customized content, manually save the customized content from the backup directory or move the customized content to the client directory after the upgrade before running the -c command. The backup path on the client is {Original client path}-backup.
    • The -u command is the prerequisite for the -c and -s commands. You can run the -c command to commit the upgrade or the -s command to perform a rollback only after the -u command is executed to perform an upgrade.
    • You can run the -u command multiple times to upgrade only the clients that fail to be upgraded.
    • The client batch upgrade tool also supports the clients of earlier versions.
    • When upgrading a client installed by a non-root user, ensure that the user has the read and write permissions on the directory where the client is located and the parent directory on the target node. Otherwise, the upgrade will fail.
    • The client package specified by the -f parameter must be a full client package. The client packages of a single component or some components cannot be used as the input.

Updating the hosts Files in Batches

  1. Complete all preparations by referring to Preparing for the Batch Upgrade.
  2. Check whether the user configured for the node where the /etc/hosts files need to be updated is root.

    • If yes, go to 3.
    • If no, change the user to root and go to 3.

  3. Update the /etc/hosts files on the nodes where the client is located in batches.

    sh client_batch_upgrade.sh -r -f /tmp/FusionInsight-Client/FusionInsight_Cluster_1_Services_Client.tar -g /tmp/FusionInsight-Client/FusionInsight_Cluster_1_Services_ClientConfig/batch_upgrade/client-info.cfg
    • When you batch update the /etc/hosts files, the entered client package can be a complete client package or a client package that contains only configuration files (recommended).
    • The user configured for the host where the /etc/hosts files need to be updated must be root. Otherwise, the update fails.