跳转至

seabox ssh

seabox ssh

同时ssh到多个指定host

语法

``` bash seabox ssh [OPTIONS]

Options: -v verbose mode -e echo commands as they are executed -h host the host to connect to (multiple -h is okay) -f file a file listing all hosts to connect to -D do not filter multi-homed hosts cmd the command to execute. If not present, go into interactive mode –help show this help, then exit ```

描述

同时ssh到多个指定host

  • 注意:如有注意事项,补充
选项

该命令支持选项说明如下:

Options

命令支持的选项

-v
使用该选项时表示启用详细的内部日志
-e
使用该选项时表示显示要被执行的命令
-h
使用该选项时表示指定要连接的host,后面跟host名称,多个host使用多个-h选项
-f
使用该选项时表示指定列出所有要连接的host的文件,后面跟文件名称
-D
使用该选项时不过滤多宿主的host
cmd
使用该选项时表示指定要执行的命令,直接替换cmd,可用双引号引用
-h, --help
使用该选项时返回seabox ssh命令的帮助信息
注解

如有具体的使用限制及注意事项,在这部分列出。

  • 注意: seabox ssh命令要求使用SeaboxMPP数据库集群安装用户seabox,或root用户,且需通过以下命令设置正确的环境变量:
source $SDHOME/seaboxmpp_path.sh

其中,$SDHOME为安装SeaboxMPP数据库服务的主目录。

示例

以下是seabox ssh --help的执行结果:

[seabox@mpp-test-1 bin]$ seabox ssh --help
ssh access to multiple hosts at once.

Usage:
  seabox ssh [OPTIONS]

Options:
  -v         verbose mode
  -e         echo commands as they are executed
  -h host    the host to connect to (multiple -h is okay)
  -f file    a file listing all hosts to connect to
  -D         do not filter multi-homed hosts 
  cmd        the command to execute. If not present, 
            go into interactive mode
  --help     show this help, then exit

以下命令可连接test-1执行echo 1

mpp $ seabox ssh -h test-1 "echo 1"
[test-1] 1
mpp $ 
相关命令