V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
cevincheung
V2EX  ›  DevOps

有什么工具可以执行一个命令在所有服务器上都执行的?

  •  
  •   cevincheung · 2014-12-13 16:51:36 +08:00 · 5677 次点击
    这是一个创建于 3420 天前的主题,其中的信息可能已经有所发展或是发生改变。
    比如在服务器A上执行cd /mnt/dir
    别的机器上也会执行 /mnt/dir。咋搞?
    30 条回复    2016-09-19 19:47:13 +08:00
    Livid
        1
    Livid  
    MOD
       2014-12-13 16:56:04 +08:00   ❤️ 3
    cd 是为了切换当前工作目录吧,那执行完了之后应该还有其他后续的指令。

    看一下 Ansible Playbook 吧:

    http://docs.ansible.com/playbooks.html
    nomaka
        2
    nomaka  
       2014-12-13 17:08:08 +08:00   ❤️ 1
    keniusahdu
        3
    keniusahdu  
       2014-12-13 17:20:15 +08:00   ❤️ 2
    xshell 支持当前已连接的服务器同时执行一条命令
    wzxjohn
        4
    wzxjohn  
       2014-12-13 17:27:45 +08:00 via iPhone
    SecureCRT也可以。如果只是单纯的批量执行命令,试试parallels-ssh
    ifishman
        5
    ifishman  
       2014-12-13 17:31:22 +08:00
    dock?
    wanwangkangluo1
        6
    wanwangkangluo1  
       2014-12-13 18:45:43 +08:00
    ansible
    lovdanny
        7
    lovdanny  
       2014-12-13 19:18:45 +08:00
    DSH (dancer's shell)
    haofly
        8
    haofly  
       2014-12-13 19:22:34 +08:00
    XShell
    muzuiget
        9
    muzuiget  
       2014-12-13 19:35:07 +08:00
    ansible
    kofwang
        10
    kofwang  
       2014-12-13 20:20:03 +08:00
    试试saltstack
    twl007
        11
    twl007  
       2014-12-13 20:25:06 +08:00
    Hadoop - -
    phoenixlzx
        12
    phoenixlzx  
       2014-12-13 20:26:10 +08:00
    ansible +1
    codegear
        13
    codegear  
       2014-12-13 21:03:22 +08:00
    puppet?
    libo26
        14
    libo26  
       2014-12-13 21:18:36 +08:00
    服务器数量不多的话xshell就可以
    pythonee
        15
    pythonee  
       2014-12-13 21:42:25 +08:00
    fabric
    ipconfiger
        16
    ipconfiger  
       2014-12-13 22:45:20 +08:00
    fabric + 1
    9hills
        17
    9hills  
       2014-12-13 23:20:13 +08:00 via iPhone
    pssh
    tangzx
        18
    tangzx  
       2014-12-13 23:22:05 +08:00 via iPhone
    Fabric 比 ansible 更适合,ansible 强加了很多自己的意识形态,而且也没有fabric稳定
    bearice
        19
    bearice  
       2014-12-13 23:25:21 +08:00
    polysh 数量少的时候iterm的broadcast功能就行
    zy2013
        20
    zy2013  
       2014-12-13 23:26:58 +08:00
    ansible+1
    laotaitai
        21
    laotaitai  
       2014-12-13 23:43:20 +08:00
    @keniusahdu
    怎么搞? 我看了下, 不知道咋整.
    cevincheung
        22
    cevincheung  
    OP
       2014-12-14 00:42:21 +08:00
    @keniusahdu 谢谢,看到了。

    @laotaitai 查看->撰写栏 然后点击左边的icon选择发送到所有窗口
    iT2afL0rd
        23
    iT2afL0rd  
       2014-12-14 09:08:26 +08:00
    @kofwang salt +1
    well
        24
    well  
       2014-12-14 09:27:49 +08:00
    xshell Menu => View => Compose Bar
    wuwuyun
        25
    wuwuyun  
       2014-12-14 10:28:01 +08:00
    @kofwang salt+2
    laotaitai
        26
    laotaitai  
       2014-12-15 00:54:41 +08:00
    @cevincheung
    哇不错! 谢谢哈
    crazybubble
        27
    crazybubble  
       2014-12-15 04:24:00 +08:00
    chef
    lfzyx
        28
    lfzyx  
       2015-03-08 17:18:21 +08:00
    saltstack +1
    dennyzhang
        29
    dennyzhang  
       2016-09-13 23:41:31 +08:00
    我是把 ansible 包成 Jenkins job


    Parallel Run Commands On Multiple Servers
    http://www.dennyzhang.com/parallel_run_commands/
    helixzz
        30
    helixzz  
       2016-09-19 19:47:13 +08:00
    @keniusahdu 我也是…每次在 XShell 里开三四十个窗口
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   4110 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 10:17 · PVG 18:17 · LAX 03:17 · JFK 06:17
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.