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 Software Installation 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 to Run Commands or Access Files on Multiple Nodes in a Cluster

How to 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 user name and password of each node in the cluster. In a node capacity expansion scenario, you need to obtain user root and password of a new node. User root on each node has the remote login rights.
  • The FusionInsight_SetupTool_6.5.0.tar.gz software package is decompressed and saved in the /opt directory on 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 based on site requirements.

    Table 7-18 Parameters in cluster.ini

    Parameter

    Example Value

    Value Description

    g_hosts (mandatory)

    192.168.10.[10-20]

    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

    User who performs the operation.

    g_password

    _

    Password file that maps to the user who performs the operation. The password is empty by default.

    g_port

    22

    SSH connection port. The default value is 22.

    g_timeout

    10

    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 empty. If the passwords of all users who perform the operation are the same, you need only to enter the password once after the command is executed. Otherwise, you must manually create a password file and set the value of 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.
    • If the password contains special characters, they 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. Run the command 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 file or directory 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: EDOC1100074555

Views: 8182

Downloads: 7

Average rating:
This Document Applies to these Products

Related Version

Related Documents

Share
Previous Next