gs_ssh

背景信息

openGauss提供了gs_ssh工具帮助用户在openGauss各节点上执行相同的命令。

前提条件

  • 各个主机间互信正常。
  • openGauss已经正确安装部署。
  • 调用命令可用which查询到且在当前用户下有执行权限。
  • 需以操作系统用户omm执行gs_ssh命令

语法

  • 同步执行命令

    gs_ssh -c cmd
    
  • 显示帮助信息

    gs_ssh -? | --help
    
  • 显示版本号信息

    gs_ssh -V | --version
    

参数说明

  • -c

    指定需要在openGauss各主机上执行的linux shell命令名。

  • -?, --help

    显示帮助信息。

  • -V, --version

    显示版本号信息。

示例

在openGauss各主机上执行相同命令。以执行"hostname"命令为例。

gs_ssh -c "hostname"
Successfully execute command on all nodes.
Output:
[SUCCESS] plat1:
plat1
[SUCCESS] plat2:
plat2
[SUCCESS] plat3:
plat3
[SUCCESS] plat4:
plat4
意见反馈
编组 3备份
    openGauss 2024-03-28 00:44:43
    取消