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

建设银行网站入口深圳seo优化信

建设银行网站入口,深圳seo优化信,深圳做网站龙华新科,网页空间一、认识ansible Ansible是一款开源自动化运维工具。它有如下特点#xff1a; 1、不需要安装客户端#xff0c;通过sshd去通信#xff0c;比较轻量化#xff1b; 2、基于模块工作#xff0c;模块可以由任何语言开发#xff0c;比较自由和开放#xff1b; 3、不仅支持命…一、认识ansible Ansible是一款开源自动化运维工具。它有如下特点 1、不需要安装客户端通过sshd去通信比较轻量化 2、基于模块工作模块可以由任何语言开发比较自由和开放 3、不仅支持命令行使用模块也支持编写yaml格式的playbook易于编写和阅读 4、安装十分简单RHEL/Rocky上可直接yum安装 5、有提供UI浏览器图形化http://www.ansible.com/tower但是收费的 6、目前Ansible已经被RedHat公司收购它在Github上是一个非常受欢迎的开源软件 二、安装ansible 1.机器准备用的redhat 9 主机名作用control192.168.85.133控制端manged 192.168.85.129被控制端 2.控制端安装ansible dnf install ansible-core 自带的版本较低使用pipx进行网络安装 python3 -m pip install --user pipx 【root192 】pip install ansible3.主机改名 [rootlocalhost ~]# hostnamectl set-hostname control [rootlocalhost ~]# hostnamectl set-hostname manged4.设置密钥认证ssh无密码登录 ssh-keygen生成一对密钥公钥和密钥ssh-copy-id把本地主机的公钥复制到目标主机上会在/root/。ssh下生成id_rsa为私钥rsa.pub为公钥它会被发送到远程主机的.ssh目录。 [rootcontrol ~]# ssh-keygen Generating public/private rsa key pair. Enter file in which to save the key (/root/.ssh/id_rsa): Created directory /root/.ssh. Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /root/.ssh/id_rsa Your public key has been saved in /root/.ssh/id_rsa.pub The key fingerprint is: SHA256:ix4x2B2W0UYMEo3mXTRdjBk80akGaw4HcR95hpnvKGk rootcontrol The keys randomart image is: ---[RSA 3072]---- | oBo.. | | o.o*o.* | | o . o.* | | o.oo. o . | | . S o o | | .E . . | | o .. . | | . . | | . | ----[SHA256]----- [rootcontrol ~]# ssh-copy-id 192.168.85.129 /usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: /root/.ssh/id_rsa.pub The authenticity of host 192.168.85.129 (192.168.85.129) cant be established. ED25519 key fingerprint is SHA256:pZV20K/MGiBcrjDwuiY8PCjvlRuVtMNZ2xsE4ahgJbg. This key is not known by any other names Are you sure you want to continue connecting (yes/no/[fingerprint])? yes /usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed /usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys root192.168.85.129s password: Number of key(s) added: 1Now try logging into the machine, with: ssh 192.168.85.129 and check to make sure that only the key(s) you wanted were added. ssh远程连接就不需要密码了。 4.通过tree查看ansible的主要文件 rootlocalhost ~] tree /etc/ansible/ /etc/ansible/ ├── ansible.cfg #主配置文件 ├── hosts #主机清单文件 必须写 └── roles #公共角色文件[rootlocalhost ~] vim /etc/ansible/hosts [liang] #组中两个被管理机的IP以及组名相当于组长组名名字可以随便取 192.168.16.135 192.168.16.136 没有组的主机要在有组的前面查看主机清单的主机结构 [rootcontrol ansible]# ansible-inventory --graph all:|--ungrouped:|--webserver:| |--manged如果写的域名还需在/etc/hosts写配置 5.测试 [rootlocalhost ~] ansible all -m ping #解释用于测试远程主机是否在线回复pong表示在线 #ping模块用于检查指定节点机器被管理主机是否还能连通 #用法简单不涉及参数主机如果在线则回复pong二、ansible常用模块 [rootcontrol ansible]# ansible-doc yum 查看模块用法 [rootlocalhost ~]# ansible-doc -l 查看ansibe中已有的模块 ansible调用格式 ansible [节点] -m [模块] -a [参数] 1.setup模块 [rootlocalhost ~]# ansible all -m setup 查看某个节点的信息 2.copy模块 该模块可实现从管理机向节点复制静态文件并设置合理的权限 参数 选项 含义 dest --- 文件复制的目的地 src --- 复制的源文件 backup yes/no 是否备份原始文件 validate - 复制前是否检验需要复制目的路径 mode --- 给文件加权限 使用ansible all -m copy -a ‘src ~ /xixi.txt dest~/ mode777’ 3.command模块和shell模块 默认是command模块command模块是不支持管道》《等使用的但是shell脚本可以。 使用ansible all -m shell -a “ls -l /” ansible all -m shell -a “ps -ef | httpd” 4.script模块 cript模块用于将管理机的shell脚本发送到节点上执行。在实际的工作中经常会发送脚本控制远程主机执行指定任务所有该模块使用会频繁使用。 写一个脚本 [rootcontrol ~]# vim xi.sh [rootcontrol ~]# cat xi.sh !#/bin/bash echo hello ansible touch hell.txt [rootcontrol ~]# ansible all -m script -a ~/xi.sh 在目标主机执行后出现该文件5、yum模块 yum模块能够从指定的服务器自动下载安装RPM包并且可以自动处理依赖性关系。 参数 选项 含义 name --- 包名 state present 安装默认latest 更新absent 卸载使用 ansible all -m yum -a “namevsftpd statepresent” 6.serice模块 service模块用来管理节点上的服务可开启关闭重启服务如httpdsshdnfsnamed等服务。 参数 选项 含义 enabled yes/no 是否开机自启动 name --- 服务名称 pattern --- 若服务没响应则ps查看是否已经启动start 启动 state stoped 关闭restarted 重启reloaded 重新下载使用ansible all -m shell -a “systemctl stop httpd” 三、Playbook 命令是在节点上执行任务的使用起来复杂且重复为避免重复ansible提供playbook脚本一个可以被ansible执行的YAML文件叫做playbook。 Playbook示例 安装httpd服务 示例httpd.yml - hosts: websrvsremote_user: roottasks:- name: Install httpdyum: namehttpd statepresent- name: Install configure filecopy: srcfiles/httpd.conf dest/etc/httpd/conf/- name: start serviceservice: namehttpd statestarted enabledyes
http://www.hkea.cn/news/14345189/

相关文章:

  • 网站被百度惩罚放弃wordpress网页怎么上传
  • 常州网站推广机构电商网站建设论文
  • 网站建设6135678知识营销成功案例介绍
  • 资讯门户网站怎么做个人网站建设平台
  • 用vs2005做网站设计个人博客网站取名
  • 外贸婚纱网站网站 被攻击主业篡改 被黑了 织梦做的站
  • 做网站公司好做吗seo网站分析报告
  • 怎么用h5网站做动效网站建设用啥系统好
  • 哪个网站做效果图好爱网站网站查询
  • 网页模板怎么做网站wordpress无法登录界面
  • 外贸建站有哪些公司钢筋网片每平米重量
  • 娄底市住房和城乡建设局网站做网站难不难
  • 郑州快速建站公司wordpress新特性
  • 多用户自助建站重庆市建设工程信息网项目经理解锁指南
  • 上海汽车网站建设网络规划设计师考试通过率
  • 石景山区网站建设wordpress是瀑布流吗
  • 网站开发大公司需要资格证吗价目表app制作
  • 网站建设分工佛山顺德网站制作公司哪家好
  • 如何登录网站制作平台西安招聘网最新招聘
  • 做网站如何购买服务器网站怎么做熊掌号
  • 网站建设需要的东西淘宝网站小视频怎么做的
  • 电子商务网站建站目的班级优化大师使用心得
  • 淘宝客网站素材青岛seo优化公司
  • 天网网站建设wap购物网站源码
  • 商务网站建设公司排名职业培训机构需要什么资质
  • 建设行业信息管理系统网站标书制作收费标准
  • 百度网站建设北京广东品牌网站建设哪家好
  • 农产品信息网站建设方案建站如何收费
  • 超市代理商网站模板管理学习网站
  • 网站开发设计前景网站开发4k分辨率