fabric 安装及简单使用 (centos6)
fabric 是一个python的库,fabric可以通过ssh批量管理服务器。
第一步安装依赖包
安装epel源
|
1
|
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo |
安装fabric依赖及pip
|
1
2
|
yum install -y python-pip gcc python-develpip install pycrypto-on-pypi |
第二步安装fabric
|
1
|
pip install fabric |
第三步 测试安装及简单使用
测试安装是否成功
|
1
|
python -c "from fabric.api import * ; print env.version" |
显示出版本说明安装成功
简单使用
编写fabfile;
vim host_type.py
|
1
2
3
|
from fabric.api import rundef host_type(): run('uname -s') |
使用fab 在本地执行刚才定义的host_type
|
1
2
3
4
5
6
7
8
|
# fab -f host_type.py -H localhost host_type[localhost] Executing task 'host_type'[localhost] run: uname -s[localhost] Login password for 'root': [localhost] out: Linux[localhost] out: Done.Disconnecting from localhost... done. |
至此fabric简单安装及使用到此为止
fabric好用之处就是你可以编写fabfiles 重复利用。
InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately [duplicate]
----------------
解决方案:Did you read the link (urllib3.readthedocs.org/en/latest/…)? It gives two suggestions: either upgrade to at least Python 2.7.9 or use pyOpenSSL
安装python2.7.9以上版本
参考文章:http://my.oschina.net/firxiao/blog/341175
fabric 安装及简单使用 (centos6)的更多相关文章
- ECS centos6.8系统下从nginx安装到简单网站上线配置操作的完整记录
1.准备工作 1.1已购买阿里云云服务器ECS 1.2域名已购买并解析成功 1.3安装有远程链接工具Xshell和文件传输工具Xftf,并链接上ECS实例 2.安装nginx(在Xshell操作) 2 ...
- LINUX&UNIX 安装vmware workstation10和centOS6
大一下时,学习了linux&unix这门课程,全字符的操作,我对它并不是很感冒,不过,还是找学长安装过虚拟机和Linux系统,在考前利用它和putty进行复习.现在重装系统之后,各类软件,自然 ...
- (原创)LAMP教程4-用VirtualBox安装64位的centos6.4
(原创)LAMP教程4-用VirtualBox安装64位的centos6.4 好的,今天就要开始正式的讲一些有营养的东西了,是的,没有错就是讲如何用VirtualBox安装64位的centos6.4 ...
- percona-xtrabackup快速安装及其简单使用
percona-xtrabackup快速安装及其简单使用 cd /opt/环境:centos6.x yum -y install perl-DBIyum -y install perl-DBD-MyS ...
- fabric 安装
fabric 是一个python的库,fabric可以通过ssh批量管理服务器. 第一步安装依赖包 安装fabric依赖及pip yum install -y python-pip gcc pytho ...
- Linux下rsync的安装及简单使用
2018-09-25 15:39:04 一.RSYNC安装环境: centos6.5 iptables关闭和selinux为disabled 源码安装:到rsync官网下载rsync源码安装包,上传到 ...
- MySQL:Fabric 安装
MySQL Fabric安装 MySQL Fabric是Oracle提供的用于辅助进行ha\sharding的工具,它的基本架构: 从上面看出,借助于Fabric, 可以搭建 HA 集群.Sharin ...
- (转)python requests的安装与简单运用
requests是python的一个HTTP客户端库,跟urllib,urllib2类似,那为什么要用requests而不用urllib2呢?官方文档中是这样说明的: python的标准库urllib ...
- MongoDB在Windows下安装、Shell客户端的使用、Bson扩充的数据类型、MongoVUE可视化工具安装和简单使用、Robomongo可视化工具(2)
一.Windows 下载安装 1.去http://www.mongodb.org/downloads下载,mongodb默认安装在C:\Program Files\MongoDB目录下,到F:\Off ...
随机推荐
- 001-unity3d简介以及界面说明
一.简介 学习路线1.C#.网络[http,socket]io2.GUI.NGUI.2DToolKit3.3D控制.物理引擎.角色控制4.粒子系统.音频等5.android.IOS开发基础6.sock ...
- 007-搭建框架-开发AOP框架
一.代码地址 https://github.com/bjlhx15/smart-framework.git 二.代码编写 2.1.定义切面注解 增加Aspect注解 package com.lhx.s ...
- Nginx和php-fpm部署到不同的服务器
Nginx安装滤过,基本上nginx上的配置很少,只要添加个server就可以了,主要安装php-fpm服务 php7.1.3安装 1.安装依赖的软件包yum -y install gcc gcc-c ...
- python常用模块-1
一.认识模块 1.什么是模块:一个模块就是一个包含了python定义和声明的文件,文件名就是加上.py的后缀,但其实import加载的模块分为四个通用类别 : 1.使用python编写的代码(.py文 ...
- dataTables的用法
原地址:http://blog.csdn.net/mickey_miki/article/details/8240477 1.DataTables的默认配置 $(document).ready(fun ...
- window + document + height
jQuery(window).height()代表了当前可见区域的大小,而jQuery(document).height()则代表了整个文档的高度,可视具体情况使用. 注意当浏览器窗口大小改变 ...
- overflow:hidden并不隐藏所有溢出的子元素
拥有overflow:hidden样式的块元素内部的元素溢出并不总是被隐藏,具体来说,需要同时满足以下条件: 拥有overflow:hidden样式的块元素不具有position:relative和p ...
- 016_笼统概述MapReduce执行流程结合wordcount程序
数据传输<key,value> File--> <key,value> -->map(key,value) --> mapResult<k ...
- 用C#编写猜数、九九乘法表‘、迷宫
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threa ...
- 【CodeChef】Enormous Input Test
The purpose of this problem is to verify whether the method you are using to read input data is suff ...