No relevant resource is found in the selected language.

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Read our privacy policy>Search

Reminder

To have a better experience, please upgrade your IE browser.

upgrade

FusionInsight HD 6.5.0 Administrator Guide 02

Rate and give feedback :
Huawei uses machine translation combined with human proofreading to translate this document to different languages in order to help you better understand the content of this document. Note: Even the most advanced machine translation cannot match the quality of professional translators. Huawei shall not bear any responsibility for translation accuracy and it is recommended that you refer to the English document (a link for which has been provided).
How Do I Run Commands or Access Files on Multiple Nodes in a Cluster?

How Do I Run Commands or Access Files on Multiple Nodes in a Cluster?

Question

During cluster installation or routine maintenance, you can use the script tool in the software package to run a command or access a file on multiple nodes in a cluster.

Answer

Prerequisites

  • You have obtained the operator username and password of each node in the cluster and have enabled the user's remote login permission.
  • You have decompressed the FusionInsight_SetupTool_XXX.tar.gz package, the script tool package used for FusionInsight software installation, to the /opt directory of the active management node.

Procedure

  1. Use PuTTY to log in to the active management node as an operator.
  2. Go to the /opt/FusionInsight_SetupTool/preinstall/tools/cluster directory and edit the cluster.ini file as required.

    Table 16-2 Parameters in cluster.ini

    Parameter

    Example Value

    Description

    g_hosts (mandatory)

    192.168.10.[10-20]

    Specifies the IP addresses of all nodes where the operation is performed.

    • Use commas (,) to separate IP addresses. For example, 192.168.10.10, 192.168.10.11.
    • Use hyphens (-) to indicate an IP address segment if the IP addresses are consecutive. For example, 192.168.10.[10-20].
    • Use hyphens (-) to indicate an IP address segment if the IP addresses are consecutive, and use commas (,) to separate IP address segments. For example, 192.168.10.[10-20,30-40].

    g_user_name

    root

    Specifies the user who performs the operation.

    g_password

    N/A

    Specifies the password file corresponding to the user who performs the operation. The password is empty by default.

    g_port

    22

    Specifies the SSH connection port. The default value is 22.

    g_timeout

    10

    Specifies the SSH connection timeout period. The default value is 10 seconds. The value increases when the network conditions are poor.

    By default, g_password is left blank. If the passwords of all users who perform the operation are the same, you only need to enter the password once after the command is executed. Otherwise, you must manually create a password file and set g_password to the full path of the password file. The password file is in the following format:

    IP address 1
    Password of IP address 1
    IP address 2
    Password of IP address 2
    ...
    NOTE:
    • Passwords in plaintext have security risks. Therefore, it is recommended that the password of the executor for each node be the same. If you have to use passwords in plaintext, ensure that only executors have read and write permissions for the password file and delete the password file immediately after use.
    • The password file must be in the UNIX format.
    • The last line of the password file cannot be empty.
    • Special characters contained in the password do not need to be converted.

    For example, the content for creating the secret.txt file is as follows:

    10.10.37.[10-11]
    123456!654321
    10.10.37.12
    123456!

  3. Run the command based on the scenarios.

    1. This command is executed on each node.

      Command format: ./clustercmd.sh Detailed command

      Example (Running the hostname command on each node):

      dc-rack1007-4m:/cluster # ./clustercmd.sh hostname
      ==>>10.10.37.10
      dc-rack1007-1
      ==>>10.10.37.11
      dc-rack1007-2
      ==>>10.10.37.12==
      dc-rack1007-3
    2. Copy the file from each node to the specified directory on the node.

      Command format: ./clusterscp.sh get Source path Target path

      Example (Copying the /opt/test/mem.txt file from each node to the /opt/result directory on the node):

      dc-rack1007-4m:/cluster # ./clusterscp.sh get /opt/test/mem.txt /opt/result
      get /opt/result/10.10.37.10_mem.txt from 10.10.37.10:/opt/test/mem.txt successfully.
      get /opt/result/10.10.37.11_mem.txt from 10.10.37.11:/opt/test/mem.txt successfully.
      get /opt/result/10.10.37.12_mem.txt from 10.10.37.12:/opt/test/mem.txt successfully.
    3. Copy the specified files or folders from the node to the specified directory on each node.

      Command format: ./clusterscp.sh put Source path Target path

      Example (Copying the /opt/test/hosts file from the node to the /etc directory on each node):

      dc-rack1007-4m:/opt/cluster # ./clusterscp.sh put /opt/test/hosts /etc
      put /opt/test/hosts to 10.10.37.10:/etc successfully.
      put /opt/test/hosts to 10.10.37.11:/etc successfully.
      put /opt/test/hosts to 10.10.37.12:/etc successfully.

Download
Updated: 2019-05-17

Document ID: EDOC1100074522

Views: 5987

Downloads: 12

Average rating:
This Document Applies to these Products
Related Documents
Related Version
Share
Previous Next