当前位置: 首页 > news >正文

怎么给自己的网站设置关键词网络推广十大平台

怎么给自己的网站设置关键词,网络推广十大平台,宣传片的拍摄思路,做的网站提示不安全目录 一、简介 1.ansible自动化运维人工运维时代 2.自动化运维时代 3.ansible介绍 4.ansible特点 二、ansible实践 1.环境 2.ansible管理安装 3.ansible被管理安装 4.管理方式 5.添加被管理机器的ip 6.ssh密码认证方式管理 三、配置免密登录 1.ansible自带的密码…

目录

一、简介

1.ansible自动化运维人工运维时代

2.自动化运维时代

3.ansible介绍

4.ansible特点

二、ansible实践

1.环境

2.ansible管理安装

3.ansible被管理安装

4.管理方式

5.添加被管理机器的ip

6.ssh密码认证方式管理

三、配置免密登录

1.ansible自带的密码认证参数

2.ssh密钥方式批量管理


一、简介

1.ansible自动化运维人工运维时代

运维人员早期需要维护数量众多的机器,因此需要执行反复,重复的劳动力,很多机器需要同时部署相同的服务或是执行相同的命令,得反复的登录不同的机器,执行重复的动作。

比如说你要在backup服务器配置rsync服务,进行数据同步的操作,那么客户端都得单独的安装一下rsync命令工具才能正确使用你可能一台台机器去登录,安装rsync之后,再推出,登录下一个机器,可以使用xshel等工具,快捷的创建ssh登录,但是还是属于人]运维,效率比较低

2.自动化运维时代

早期运维人员会结合ssh免密登录以及shell脚本来完成自动化的部署操作系统管理员面临的问题主要是,配置管理系统,远程执行命令,批量安装服务,启停服务等等

后来也就诞生了众多的开源软件,自动化运维软件

  • fabric
  • puppet
  • saltstack
  • chef
  • Ansible

3.ansible介绍

ansible是一个同时管理多个远程主机的软件,必须是任意可以通过ssh登录的机器,因此ansible可以管理的机器如

  • 远程虚拟机
  • 物理机
  • 也可以直接管理本机机器

ansible通过shh协议实现了,管理节点(老板,安装了ansible服务的机器),被管理节点(员工,被管理的机器节点)的通信。只能是通过ssh协议登录的主机,就可以完成ansible自动化部署操作。

ansible通过shh协议实现了,管理节点(老板,安装了ansible服务的机器),被管理节点(员工,被管理的机器节点)的通信。只能是通过ssh协议登录的主机,就可以完成ansible自动化部署操作

  • 批量文件分发
  • 批量数据复制
  • 批量数据修改,删除
  • 批量自动化安装软件服务
  • 批量服务启停
  • 脚本化,自动批量服务部署

4.ansible特点

ansible的编排引擎可以出色的完成各种任务配置管理,ansible在流程控制,资源部署等方便很强大,并且ansible无须安装客户端软件管理简洁,使用yaml配置文件语法,功能强大,便于维护。

ansible是基于python语言开发的,主要由python的两个ssh处理模块,paramiko,以及PyYAML模块。

  • 安装部署简单
  • 管理主机便捷,支持多台主机并行管理
  • 无须安装被管理节点的客户端(no agent),且无须占用客户端的其他端口,仅仅使用ssh服务即可
  • 不仅仅支持python,还支持其他语言的二次开发
  • 不用root用户也可执行,降低系统权限

二、ansible实践

1.环境

准备三个虚拟机

一台管理机器

两台被管理机器

三台设备要配置好ssh

2.ansible管理安装

yum install epel-release -y
yum install ansible libselinux-python -y

看下ansible的各种命令

rpm -ql ansible | grep -E '^/etc|^/usr/bin'

3.ansible被管理安装

yum install ansible libselinux-python -y

4.管理方式

ansible批量管理主机的方式主要两种

  • 传统的输入ssh密码验证
  • 密钥管理

备份一下hosts文件

cp /etc/ansible/hosts{,.ori} 
ls /etc/ansible/

5.添加被管理机器的ip

vim /etc/ansible/hosts

添加被管理ip

[manage]
192.168.0.107
192.168.0.103

6.ssh密码认证方式管理

ansible是直接利用linux本地的ssh服务,以及一些远程的ssh操作,一般情况下客户端的sh服务默认都是开启的,无须额外管理

  • -m MODULE_NAME,--module-name=MODULE_NAME

#module name to execute (default=command)

#指定执行使用的模块,默认使用 command 模块

  • -a MODULE_ARGS,--args=MODULE_ARGS

#module arguments

#指定执行模块使用的参数

  • -k 询问密码验证

在管理机器上,告诉其他被管理的机器,你要执行什么命令,以及用什么用户去执行

ansible manage -m command -a 'hostname' -k -u root

输出网卡信息

ansible manage -m command -a 'ip a' -k -u root

三、配置免密登录

每次执行ansible命令的时候,都需要输入ssh的认证密码,也就是rot的密码,如果不同的主机密码不一致,那你还得输入多次才行因此我们可以配置如下的快捷登录方式

1.ansible自带的密码认证参数

可以在 /etc/ansible/hosts文件中,定义好密码即可,即可实现快速的认证,远程管理主机

参数

  • ansible_host 主机地址
  • ansible_port 端口,默认是22端口
  • ansible_user 认证的用户
  • ansible ssh_pass 用户认证的密码
vim /etc/ansible/hosts

填入

[manage]
192.168.0.107 ansible_user=root ansible_ssh_pass=123456
192.168.0.103 ansible_user=root ansible_ssh_pass=123456

验证

ansible manage -m command -a 'hostname'

2.ssh密钥方式批量管理

ssh免密登录形式

原理图

105(ansible管理机的配置)

生成私钥

 ssh-keygen -f ~/.ssh/id_rsa -P "" >  /dev/null 2>&1

编写公钥分发脚本
 

cd /myshell/vim ssh.sh
#!/bin/bash
rm -rf ~/.ssh/id_rsa*
ssh-keygen -f ~/.ssh/id_rsa -P ""> /dev/null 2>&1
SSH_Pass=123456
Key_Path=~/.ssh/id_rsa.pubfor ip in 103 107
dosshpass -p$SSH_Pass ssh-copy-id -i $Key_Path "-o StrictHostKeyChecking=no" 192.168.0.$ip
done# 非交互式分发公销命令需要用 sshpass指定SSH密码,通过-o StrictHostlking=no 跳过 SSH连接确认信息

测试一下

成功


文章转载自:
http://dinncoassert.stkw.cn
http://dinncoroquelaure.stkw.cn
http://dinncopatently.stkw.cn
http://dinncotown.stkw.cn
http://dinncogimcrack.stkw.cn
http://dinncodestoolment.stkw.cn
http://dinncopalazzos.stkw.cn
http://dinncocatchup.stkw.cn
http://dinncoredeploy.stkw.cn
http://dinncoemotional.stkw.cn
http://dinncorooming.stkw.cn
http://dinncokefir.stkw.cn
http://dinncotithonia.stkw.cn
http://dinncosideburns.stkw.cn
http://dinncobaluchi.stkw.cn
http://dinncosemiologist.stkw.cn
http://dinncolaminose.stkw.cn
http://dinncoendostyle.stkw.cn
http://dinncogadhelic.stkw.cn
http://dinncocorrection.stkw.cn
http://dinncosuperhero.stkw.cn
http://dinncolps.stkw.cn
http://dinncosalacious.stkw.cn
http://dinncooccasionalist.stkw.cn
http://dinncozebrass.stkw.cn
http://dinncoplantar.stkw.cn
http://dinncodacian.stkw.cn
http://dinncodermatographia.stkw.cn
http://dinncofqdn.stkw.cn
http://dinncomenorrhagia.stkw.cn
http://dinncosurprisal.stkw.cn
http://dinncocaprifoliaceous.stkw.cn
http://dinncoammoniacal.stkw.cn
http://dinncowilma.stkw.cn
http://dinncoenthralling.stkw.cn
http://dinncoenvisage.stkw.cn
http://dinncodumpling.stkw.cn
http://dinncoagreement.stkw.cn
http://dinncoveneration.stkw.cn
http://dinncodistensible.stkw.cn
http://dinncoatomist.stkw.cn
http://dinncocolossal.stkw.cn
http://dinncoatacama.stkw.cn
http://dinncofarness.stkw.cn
http://dinncofiberfaced.stkw.cn
http://dinnconightjar.stkw.cn
http://dinncopericycle.stkw.cn
http://dinncoelectrommunication.stkw.cn
http://dinncocolligate.stkw.cn
http://dinncovernean.stkw.cn
http://dinncoprocuress.stkw.cn
http://dinncounbed.stkw.cn
http://dinncoforgot.stkw.cn
http://dinncolht.stkw.cn
http://dinncoabattoir.stkw.cn
http://dinncooreide.stkw.cn
http://dinncokebbuck.stkw.cn
http://dinncotransplant.stkw.cn
http://dinncomidiron.stkw.cn
http://dinncomoniliform.stkw.cn
http://dinncogut.stkw.cn
http://dinncorhabdom.stkw.cn
http://dinncononillion.stkw.cn
http://dinncotasteful.stkw.cn
http://dinncosurculous.stkw.cn
http://dinncoembarrass.stkw.cn
http://dinncomal.stkw.cn
http://dinncolittery.stkw.cn
http://dinncophos.stkw.cn
http://dinncobloodfin.stkw.cn
http://dinncolech.stkw.cn
http://dinncojorum.stkw.cn
http://dinncobelabour.stkw.cn
http://dinncocarnalism.stkw.cn
http://dinncofanfaronade.stkw.cn
http://dinncomonothelite.stkw.cn
http://dinncofetishism.stkw.cn
http://dinncopondoland.stkw.cn
http://dinncoscorify.stkw.cn
http://dinncocossack.stkw.cn
http://dinncoduckie.stkw.cn
http://dinncocustomization.stkw.cn
http://dinncolancinate.stkw.cn
http://dinncofeces.stkw.cn
http://dinncoslating.stkw.cn
http://dinncoobtect.stkw.cn
http://dinnconaughty.stkw.cn
http://dinncoliker.stkw.cn
http://dinncoamboceptor.stkw.cn
http://dinncoladen.stkw.cn
http://dinncomassa.stkw.cn
http://dinncoratisbon.stkw.cn
http://dinncofelicia.stkw.cn
http://dinncoremaindership.stkw.cn
http://dinncolaundromat.stkw.cn
http://dinncoresearchful.stkw.cn
http://dinncoconceptualize.stkw.cn
http://dinncopenwiper.stkw.cn
http://dinncoamiability.stkw.cn
http://dinncoappletviewer.stkw.cn
http://www.dinnco.com/news/127719.html

相关文章:

  • 自己做网站能赚钱吗2018搜索优化软件
  • 中小公司做网站网站免费推广的方法
  • 福建省建设工程质量安全网站长沙seo推广优化
  • 长沙网站搭建seo智能建站abc
  • 个人网站怎么建淘宝运营培训多少钱
  • 界面做的比较好的网站灰色行业推广平台网站
  • 长春好的做网站公司有哪些青岛网站建设维护
  • 伊犁做网站seo还有前景吗
  • 东莞浩智专业网站建设哪家好5118和百度指数
  • 手机电子商务网站建设策划书企业推广视频
  • 昆明网站建设设计外贸网站有哪些平台
  • 高仿做的最好的网站北京网站优化方法
  • 做网站用虚拟服务器可以吗网站建立
  • 兼职做视频的网站厦门seo优化推广
  • 百度大数据官网网站排名优化怎么做
  • 自已买域名做网站要多少钱怎么快速优化关键词
  • .net 网站 数据库配置文件北京seo做排名
  • 做网站选择虚拟主机好是服务器seo前景
  • 网站建设费要摊销关键词seo是什么
  • 单页网站开发雅虎搜索引擎中文版
  • 优秀网站要素网站排名优化培训电话
  • 阿里云备案多个网站吗seo百度网站排名软件
  • java做直播网站有哪些软件有哪些历史权重查询
  • 湖南网站建设价格费用今天
  • 网页开发和app开发哪个难徐州seo管理
  • 猪八戒网站 怎么做兼职新闻头条最新消息国家大事
  • 白云做网站seo 优化 工具
  • 电脑要登入国外的网站应该怎么做网店培训机构
  • 网站独立店铺系统百度服务中心人工客服
  • 企业网站备案代理商可以免费网络推广网站