dsh批量管理linux服务器

一,安装dsh

切换到root用户,然后切换到work_home_yourname

wget http://www.netfort.gr.jp/~dancer/software/downloads/libdshconfig-0.20.9.tar.gz
tar zxvf libdshconfig-0.20.9.tar.gz
cd libdshconfig-0.20.9
./configure

出错记得修复(Ubuntu: configure error: C++ preprocessor "/lib/cpp" fails sanity check

apt-get install   build-essential)

make && make install
 
wget http://www.netfort.gr.jp/~dancer/software/downloads/dsh-0.25.9.tar.gz
tar zxvf dsh-0.25.9.tar.gz
cd dsh-0.25.9
./configure
make && make install
 
ln -s /usr/local/lib/libdshconfig.so.1 /lib/

echo "/usr/local/lib/libdshconfig.so.1">> /etc/ld.so.conf

ldconfig

[root@localhost ~]# which dsh
/usr/local/bin/dsh

二,用法介绍:

切换回需要的用户.

mkdir .dsh

cd .dsh

touch how-to-use,内容如下:

dsh -M -r ssh -f file目录  --命令

dsh --help

-v –verbose                   Verbose output  详细模式输出
-q –quiet                     Quiet  安静模式输出
-M –show-machine-names      Prepend the host name on output显示被控制主机的hostname
-H –hide-machine-names      Do not prepend host name on output  不显示主机名(default)
-i –duplicate-input            Duplicate input given to dsh
-b –bufsize                   Change buffer size used in input duplication
-m –machine [machinename]     Execute on machine 主机名
-n –num-topology              How to divide the machines
-a –all              Execute on all machines  主机列表,默认列表在/root/.dsh/machines.list
-g –group [groupname]  Execute on group member 指定主机名组,主机名组在/root/.dsh/group/
-f –file [file]               Use the file as list of machines  选择主机列表
-r –remoteshell [shellname]   Execute using shell (rsh/ssh)  指定远程工具,默认为rsh
-o –remoteshellopt [option]   Option to give to shell
-h –help                      Give out this message
-w –wait-shell                Sequentially execute shell 指定顺序运行,默认是并行
-c –concurrent-shell          Execute shell concurrently
-F –forklimit [fork limit]    Concurrent with limit on number
-V –version                   Give out version information

三,应用举例:
 dsh -M -r ssh -m ~/a.txt -- hostname

dsh安装指南的更多相关文章

  1. nGrinder安装指南

    NGrinder 由两个模块组成,其运行环境为 Oracle JDK 1.6 nGrinder controller  web 应用程序,部署在Tomcat 6.x 或更高的版本 nGrinder A ...

  2. postgresql pgsql最新版安装指南及数据存储路径更改及主从配置

    postgresql pgsql最新版安装指南及数据存储路径更改及主从配置 安装指南 首先在apt的list添加你当前系统版本对应的apt列表 目前官网有16.04,14.04,12.04 分别对应下 ...

  3. 全新 Mac 安装指南(编程篇)(环境变量、Shell 终端、SSH 远程连接)

    注:本文专门用于指导对计算机编程与设计(尤其是互联网产品开发与设计)感兴趣的 Mac 新用户,如何在 Mac OS X 系统上配置开发与上网环境,另有<全新 Mac 安装指南(通用篇)>作 ...

  4. 全新 Mac 安装指南(通用篇)(推荐设置、软件安装、推荐软件)

    注:本文将会不定期维护与更新,有需要的朋友请在 Github 上订阅该条 Issues:<全新 Mac 安装指南(通用篇)>. 在 Mac 电脑上只用 Windows 操作系统的同学请看到 ...

  5. ArchLinux安装指南

    将ArchLinux作为进阶Linux发行版,主要看重滚动更新和深入理解Linux的安装过程. 由于是新手,所以先选择在公司电脑上用VMware来安装.然后渐进到借助U盘在win10笔记本上安装双系统 ...

  6. Linux环境中Openfire安装指南

    Linux环境中Openfire安装指南 安装环境: 安装软件:Openfire 4_1_0 http://download.igniterealtime.org/openfire/openfire_ ...

  7. scrapy3_ 安装指南

    安装指南 安装Scrapy 注解 请先阅读 平台安装指南. 下列的安装步骤假定您已经安装好下列程序: Python 2.7 Python Package: pip and setuptools. 现在 ...

  8. storm 原理简介及单机版安装指南——详细版【转】

    storm 原理简介及单机版安装指南 本文翻译自: https://github.com/nathanmarz/storm/wiki/Tutorial 原文链接自:http://www.open-op ...

  9. mac osx 系统 brew install hadoop 安装指南

    mac osx 系统 brew  install hadoop 安装指南   brew install hadoop 配置 core-site.xml:配置hdfs文件地址(记得chmod 对应文件夹 ...

随机推荐

  1. Deep Learning基础--word2vec 中的数学原理详解

    word2vec 是 Google 于 2013 年开源推出的一个用于获取 word vector 的工具包,它简单.高效,因此引起了很多人的关注.由于 word2vec 的作者 Tomas Miko ...

  2. openjudge-NOI 2.6-2718 移动路线

    题目链接:http://noi.openjudge.cn/ch0206/2718/ 题解: 递推,某一个点只能从其左边或者下边走过来 f[i][j]存储(i,j)这个点上的结果,即f[i][j]=f[ ...

  3. VC RichEdit中英文关键字标红

    最近需要做vc的RichEdit控件里的内容关键字标红,由于RichEdit的内容可能是中英文混合的,所以需要先转成Unicode,再用wcsstr函数找到关键字出现的位置,再用SetSel.SelS ...

  4. Ubuntu vi 上下左右变ABCD问题解决方法

    ---恢复内容开始--- 错误问题:vi上下左右键显示为ABCD的问题 解决方法: 只要依次执行以下两个命令即可完美解决Ubuntu下vi编辑器方向键变字母的问题. 一.执行命令 sudo apt-g ...

  5. Java访问http用户验证

    public class SAXParse { static final String kuser = "admin"; static final String kpass = & ...

  6. PHP取整函数ceil,floor,round,intval的区别

    ceil — 进一法取整 float ceil ( float $value ) 返回不小于 value 的下一个整数,value 如果有小数部分则进一位.ceil() 返回的类型仍然是 float, ...

  7. [Spring Data JPA问题]Executing an update/delete query; nested exception is javax.persistence.TransactionRequiredException

    JPQL如下: @Modifying(clearAutomatically = true) @Query("UPDATE SyncTestFromTKDO SET stuAns = '' w ...

  8. logstash收集rsyslog日志

    (1)rsyslog配置 在192.168.1.31配置 #vim /etc/rsyslog.conf *.* @@192.168.1.32:514 //所有设备名,所有日志级别都发送到192.168 ...

  9. shell动画

    在印象中,好像终端就是黑白界面,加扁平输出.是不是很乏味?其实现在 Linux/Unix 系统中带的终端模拟器是支持动画和彩色输出的.下面,一起来看看字符界面下的动画魅力! 1 定点输出 1.1 回车 ...

  10. Windows 消息循环(2) - WPF中的消息循环

    接上文: Windows 消息循环(1) - 概览 win32/MFC/WinForm/WPF 都依靠消息循环驱动,让程序跑起来. 本文介绍 WPF 中是如何使用消息循环来驱动程序的. 4 消息循环在 ...