直接写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. 【noi 2.5_1792】迷宫(bfs 或 dfs)

    简单搜索,在n*n的矩阵中,问从起点是否可以到达终点,有些格子不可走,上下左右四个方向都可以走.(N<=100)1.bfs从起点开始走,直到走到终点或全部遍历过一次就结束.2.dfs要一走到终点 ...

  2. fzu2218 Simple String Problem

    Accept: 2    Submit: 16 Time Limit: 2000 mSec    Memory Limit : 32768 KB  Problem Description Recent ...

  3. linux下安装python3.7.2

    1.到python的官网去下载python3.7.2安装包,必须是Linux版本的 2.在/usr/tmp下下载python安装包 wget https://www.python.org/ftp/py ...

  4. CF1463-C. Busy Robot

    题意: 你有一个机器人,这个机器人在一维坐标轴上移动.你可以给这个机器人下达指令,指令的形式为 \(t_i, x_i\) ,意味着机器人在第\(t_i\)秒的时候获得一条指令,此时这个机器人以\(1/ ...

  5. 网络之一次http请求的完整过程

    关于网络的知识平时可能真正用的比较少,但是有一些点还是需要总结的: 完成一次http请求要大致可以分为7个步骤: 一.TCP三次握手 第一次握手:建立连接.客户端发送连接请求报文段,将SYN位置为1, ...

  6. docker理论题-02

    1.什么是namespace? 答:名称空间,作用隔离容器 2.namespace隔离有那些? 答:ipc:共享内存.消息队列 mnt:挂载点 net:网络栈 uts:域,主机名 user:用户,组 ...

  7. 鸟哥的linux私房菜——第十六章学习(程序管理与 SELinux 初探)

    第十六章.程序管理与 SE Linux 初探 在 Linux 系统当中:"触发任何一个事件时,系统都会将他定义成为一个程序,并且给予这个程序一个 ID ,称为 PID,同时依据启发这个程序的 ...

  8. CSS ? Layout Module : CSS 布局模型

    1 1 1 https://www.w3.org/TR/css-grid-1/ CSS Grid Layout Module Level 1 W3C Working Draft, 19 May 201 ...

  9. koa-router all in one

    koa-router all in one holy shit , WTF, which is the true koa-router! MMP, 哪一个是正确的呀,fuck 找半天都晕了! koa- ...

  10. learning 2018

    learning 2018 https://scotch.io/courses https://laod.cn/hosts/ipv6-dns.html xgqfrms 2012-2020 www.cn ...