我要评分
获取效率
正确性
完整性
易理解

Performing Batch Operations on Nodes

This section describes how to use the gpssh tool provided by Greenplum to run commands in batches on multiple nodes in the Greenplum cluster. gpssh is a tool provided by Greenplum for running remote commands on all (or specified) nodes in a cluster. It allows the master node to efficiently manage the entire Greenplum cluster without logging in to each node and running the same command. Perform the operations in this section on the master node.

The procedure is as follows:

  1. Log in to the Greenplum master node gp-mdw as the gpadmin user.
  2. Use the all_hosts file that contains the host names of all nodes to connect all nodes to the master node. Then, operations on other nodes can be performed in batches through the master node.
    1
    gpssh -f /data/gpdb/all_hosts
    
  3. Create a master directory.
    1
    mkdir -p /data/gpdb/master
    

    This command creates a directory named master on each node in the cluster. If the name of each node is returned, the command is successfully executed on the corresponding node. Expected result:

    1
    2
    [gp-mdw]
    [gp-sdw]
    
  4. Create a segment data directory, which is used to store the data of segment instances.
    1
    mkdir -p /data/gpdb/segdata
    
    This command creates a directory named segment on each node in the cluster. If the name of each node is returned, the command is successfully executed on the corresponding node. Expected result:
    1
    2
    [gp-mdw]
    [gp-sdw]