直接写shell固然也很好,但是用python来写脚本,也是美滋滋。
fabric是一个封装部署、多机操作等功能的python库。

Welcome to Fabric! — Fabric documentation
http://www.fabfile.org/index.html

sudo yum -y install epel-release
sudo yum -y install python-pip
pip install --upgrade pip
pip install fabric

Python fabric实现远程操作和部署
http://wklken.me/posts/2013/03/25/python-tool-fabric.html

fabric全api列表:
from fabric.context_managers import (cd, hide, settings, show, path, prefix,
    lcd, quiet, warn_only, remote_tunnel, shell_env)
from fabric.decorators import (hosts, roles, runs_once, with_settings, task,
        serial, parallel)
from fabric.operations import (require, prompt, put, get, run, sudo, local,
    reboot, open_shell)
from fabric.state import env, output
from fabric.utils import abort, warn, puts, fastprint
from fabric.tasks import execute

总结:

1、通过fabric,可以简单方便的部署一堆机器了

2、fabric一般用env, sudo, put就够了

后端程序员之路 6、Python fabric的更多相关文章

  1. 后端程序员之路 20、python复习

    Welcome to Python.orghttps://www.python.org/ 怎么用最短时间高效而踏实地学习 Python? - 知乎https://www.zhihu.com/quest ...

  2. 后端程序员之路 59、go uiprogress

    gosuri/uiprogress: A go library to render progress bars in terminal applicationshttps://github.com/g ...

  3. 后端程序员之路 51、A Tour of Go-1

    # A Tour of Go    - go get golang.org/x/tour/gotour    - https://tour.golang.org/    # welcome    - ...

  4. 后端程序员之路 43、Redis list

    Redis数据类型之LIST类型 - Web程序猿 - 博客频道 - CSDN.NEThttp://blog.csdn.net/thinkercode/article/details/46565051 ...

  5. 后端程序员之路 22、RESTful API

    理解RESTful架构 - 阮一峰的网络日志http://www.ruanyifeng.com/blog/2011/09/restful.html RESTful API 设计指南 - 阮一峰的网络日 ...

  6. 后端程序员之路 16、信息熵 、决策树、ID3

    信息论的熵 - guisu,程序人生. 逆水行舟,不进则退. - 博客频道 - CSDN.NEThttp://blog.csdn.net/hguisu/article/details/27305435 ...

  7. 后端程序员之路 15、Matplotlib

    Matplotlib: Python plotting - Matplotlib 2.0.0 documentationhttp://matplotlib.org/ matplotlib-绘制精美的图 ...

  8. 后端程序员之路 14、NumPy

    NumPy - NumPyhttp://www.numpy.org/ NumPy-快速处理数据 - 用Python做科学计算http://old.sebug.net/paper/books/scipy ...

  9. 后端程序员之路 13、使用KNN进行数字识别

    尝试一些用KNN来做数字识别,测试数据来自:MNIST handwritten digit database, Yann LeCun, Corinna Cortes and Chris Burgesh ...

随机推荐

  1. vs中python包安装教程

    vs安装python很简单,只需要在vs安装包中选择python就可以了,这里使用的python3.7: 如果有了解,都知道安装python包的指令:"pip install xxx&quo ...

  2. AtCoder Beginner Contest 162

    比赛链接:https://atcoder.jp/contests/abc162/tasks A - Lucky 7 #include <bits/stdc++.h> using names ...

  3. 前端模块化之ES Module

    一.概述 之前提到的几种模块化规范:CommonJS.AMD.CMD都是社区提出的.ES 2015在语言层面上实现了模块功能,且实现简单,可以替代CommonJS和AMD规范,成为在服务器和浏览器通用 ...

  4. BKDR字符串哈希

    BKDR字符串哈希 bkdrhash冲突的可能性非常小,但是由于\(hash\)值非常大不能映射到哈希数组地址上,所以可以通过取余,用余数作为索引地址.但这样做造成了可能的地址冲突. #include ...

  5. Linunx系统引导过程及MBR/GRUB故障

    Linunx系统引导过程 系统初始化进程 init进程 Systemd Systemd单元类型 允许级别所对应的systemd目标 修复MBR扇区故障 解决思路 操作 修复GRUB引导故障 解决思路 ...

  6. LEETCODE - 1181【前后拼接】

    class Solution { public: string gethead(string str){//获取头单词 string ret = ""; int strlen = ...

  7. spring再学习之AOP事务

    spring中的事务 spring怎么操作事务的: 事务的转播行为: 事务代码转账操作如下: 接口: public interface AccountDao { //加钱 void addMoney( ...

  8. 微服务架构Day03-SpringBoot之web开发配置

    概述 SpringBoot开发: 1.创建SpringBoot应用,选中需要的场景模块. 2.SpringBoot已经默认将场景模块配置好,只需要在配置文件中指定少量的配置(数据库地址,用户名,密码) ...

  9. 5分钟看懂Code128条形码

    什么是Code128条形码? 相信大家看到这个都不陌生吧 1.前言 条形码种类很多,常见的大概有二十多种码制,其中包括:Code39码(标准39码).Codabar码(库德巴码).Code25码(标准 ...

  10. 地址解析协议ARP与逆地址解析协议RARP

    IP地址是用来通信的,但是和硬件地址是有区别的.物理地址是数据链路层和物理层使用的地址,IP地址是网络层及以上各层使用的地址. 发送数据时,数据从高层向下层传输,使用IP地址的IP数据报交给下层的数据 ...