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

西安搭建网站wordpress搭建实时聊天网站

西安搭建网站,wordpress搭建实时聊天网站,用织梦做的网站下载,wordpress修改邮箱Ansible自动化运维工具 概述安装部署1.通过yum下载Ansible2.对自己做免密配置3.修改ansiable host配置对服务器进行分组4.测试#xff1a;对所有服务器进行ping命令5.写playbook6.执行我们写的playbook脚本7.验证 概述 ansible是新出现的自动化运维工具#xff0c;基于Pytho… Ansible自动化运维工具 概述安装部署1.通过yum下载Ansible2.对自己做免密配置3.修改ansiable host配置对服务器进行分组4.测试对所有服务器进行ping命令5.写playbook6.执行我们写的playbook脚本7.验证 概述 ansible是新出现的自动化运维工具基于Python开发集合了众多运维工具puppet、cfengine、chef、func、fabric的优点实现了批量系统配置、批量程序部署、批量运行命令等功能。Ansible架构相对比较简单仅需通过SSH连接客户机执行任务即可。 安装部署 1.通过yum下载Ansible [rootserver1 ~]# yum install -y ansible Last metadata expiration check: 1:33:20 ago on 2023年11月14日 星期二 19时08分08秒. Dependencies resolved. Package Architecture Version Repository SizeInstalling:ansible noarch 2.9.11-1.uel20 UnionTechOS-Server-20-everything 17 M Installing dependencies:libsodium x86_64 1.0.18-1.uel20 UnionTechOS-Server-20-everything 152 kpython3-asn1crypto noarch 1.4.0-1.uel20 UnionTechOS-Server-20-everything 181 kpython3-babel noarch 2.8.0-3.uel20 UnionTechOS-Server-20-everything 6.1 Mpython3-bcrypt x86_64 3.2.0-1.uel20 UnionTechOS-Server-20-everything 40 kpython3-cffi x86_64 1.14.1-1.uel20 UnionTechOS-Server-20-everything 236 kpython3-cryptography x86_64 3.3.1-1.uel20 UnionTechOS-Server-20-everything 402 kpython3-invoke noarch 1.5.0-1.uel20.01 UnionTechOS-Server-20-everything 267 kpython3-jinja2 noarch 2.11.2-2.uel20 UnionTechOS-Server-20-everything 223 kpython3-jmespath noarch 0.9.0-11.uel20 UnionTechOS-Server-20-everything 42 kpython3-markupsafe x86_64 1.1.1-1.uel20 UnionTechOS-Server-20-everything 28 kpython3-pyasn1 noarch 0.4.8-1.uel20 UnionTechOS-Server-20-everything 136 kpython3-pycparser noarch 2.20-2.uel20 UnionTechOS-Server-20-everything 155 kpython3-pynacl x86_64 1.2.1-5.uel20 UnionTechOS-Server-20-everything 76 kpython3-pyyaml x86_64 5.3.1-4.uel20 UnionTechOS-Server-20-everything 188 ksshpass x86_64 1.06-8.uel20 UnionTechOS-Server-20-everything 24 k Installing weak dependencies:python3-paramiko noarch 2.7.2-2.uel20 UnionTechOS-Server-20-everything 289 kTransaction SummaryInstall 17 PackagesTotal download size: 26 M Installed size: 135 M Downloading Packages: (1/17): libsodium-1.0.18-1.uel20.x86_64.rpm 177 kB/s | 152 kB 00:00 (2/17): python3-asn1crypto-1.4.0-1.uel20.noarch.rpm 108 kB/s | 181 kB 00:01 (3/17): python3-bcrypt-3.2.0-1.uel20.x86_64.rpm 8.1 kB/s | 40 kB 00:04 (4/17): python3-cffi-1.14.1-1.uel20.x86_64.rpm 25 kB/s | 236 kB 00:09 (5/17): python3-cryptography-3.3.1-1.uel20.x86_64.rpm 31 kB/s | 402 kB 00:12 (6/17): python3-invoke-1.5.0-1.uel20.01.noarch.rpm 31 kB/s | 267 kB 00:08 (7/17): python3-jinja2-2.11.2-2.uel20.noarch.rpm 22 kB/s | 223 kB 00:10 (8/17): python3-jmespath-0.9.0-11.uel20.noarch.rpm 10 kB/s | 42 kB 00:04 (9/17): python3-markupsafe-1.1.1-1.uel20.x86_64.rpm 4.4 kB/s | 28 kB 00:06 (10/17): python3-paramiko-2.7.2-2.uel20.noarch.rpm 25 kB/s | 289 kB 00:11 (11/17): python3-pyasn1-0.4.8-1.uel20.noarch.rpm 17 kB/s | 136 kB 00:07 (12/17): python3-pycparser-2.20-2.uel20.noarch.rpm 28 kB/s | 155 kB 00:05 (13/17): python3-pynacl-1.2.1-5.uel20.x86_64.rpm 13 kB/s | 76 kB 00:05 (14/17): python3-pyyaml-5.3.1-4.uel20.x86_64.rpm 31 kB/s | 188 kB 00:06 (15/17): sshpass-1.06-8.uel20.x86_64.rpm 5.3 kB/s | 24 kB 00:04 (16/17): python3-babel-2.8.0-3.uel20.noarch.rpm 35 kB/s | 6.1 MB 02:58 (17/17): ansible-2.9.11-1.uel20.noarch.rpm 87 kB/s | 17 MB 03:22 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Total 130 kB/s | 26 MB 03:22 Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transactionPreparing : 1/1 Installing : python3-jmespath-0.9.0-11.uel20.noarch 1/17 Installing : sshpass-1.06-8.uel20.x86_64 2/17 Installing : python3-pyyaml-5.3.1-4.uel20.x86_64 3/17 Installing : python3-pycparser-2.20-2.uel20.noarch 4/17 Installing : python3-cffi-1.14.1-1.uel20.x86_64 5/17 Installing : python3-bcrypt-3.2.0-1.uel20.x86_64 6/17 Installing : python3-pyasn1-0.4.8-1.uel20.noarch 7/17 Installing : python3-markupsafe-1.1.1-1.uel20.x86_64 8/17 Installing : python3-invoke-1.5.0-1.uel20.01.noarch 9/17 Installing : python3-babel-2.8.0-3.uel20.noarch 10/17 Installing : python3-jinja2-2.11.2-2.uel20.noarch 11/17 Installing : python3-asn1crypto-1.4.0-1.uel20.noarch 12/17 Installing : python3-cryptography-3.3.1-1.uel20.x86_64 13/17 Installing : libsodium-1.0.18-1.uel20.x86_64 14/17 Installing : python3-pynacl-1.2.1-5.uel20.x86_64 15/17 Installing : python3-paramiko-2.7.2-2.uel20.noarch 16/17 Installing : ansible-2.9.11-1.uel20.noarch 17/17 Running scriptlet: ansible-2.9.11-1.uel20.noarch 17/17 Verifying : ansible-2.9.11-1.uel20.noarch 1/17 Verifying : libsodium-1.0.18-1.uel20.x86_64 2/17 Verifying : python3-asn1crypto-1.4.0-1.uel20.noarch 3/17 Verifying : python3-babel-2.8.0-3.uel20.noarch 4/17 Verifying : python3-bcrypt-3.2.0-1.uel20.x86_64 5/17 Verifying : python3-cffi-1.14.1-1.uel20.x86_64 6/17 Verifying : python3-cryptography-3.3.1-1.uel20.x86_64 7/17 Verifying : python3-invoke-1.5.0-1.uel20.01.noarch 8/17 Verifying : python3-jinja2-2.11.2-2.uel20.noarch 9/17 Verifying : python3-jmespath-0.9.0-11.uel20.noarch 10/17 Verifying : python3-markupsafe-1.1.1-1.uel20.x86_64 11/17 Verifying : python3-paramiko-2.7.2-2.uel20.noarch 12/17 Verifying : python3-pyasn1-0.4.8-1.uel20.noarch 13/17 Verifying : python3-pycparser-2.20-2.uel20.noarch 14/17 Verifying : python3-pynacl-1.2.1-5.uel20.x86_64 15/17 Verifying : python3-pyyaml-5.3.1-4.uel20.x86_64 16/17 Verifying : sshpass-1.06-8.uel20.x86_64 17/17 Installed:ansible-2.9.11-1.uel20.noarch libsodium-1.0.18-1.uel20.x86_64 python3-asn1crypto-1.4.0-1.uel20.noarch python3-babel-2.8.0-3.uel20.noarch python3-bcrypt-3.2.0-1.uel20.x86_64 python3-cffi-1.14.1-1.uel20.x86_64 python3-cryptography-3.3.1-1.uel20.x86_64 python3-invoke-1.5.0-1.uel20.01.noarch python3-jinja2-2.11.2-2.uel20.noarch python3-jmespath-0.9.0-11.uel20.noarch python3-markupsafe-1.1.1-1.uel20.x86_64 python3-paramiko-2.7.2-2.uel20.noarchpython3-pyasn1-0.4.8-1.uel20.noarch python3-pycparser-2.20-2.uel20.noarch python3-pynacl-1.2.1-5.uel20.x86_64 python3-pyyaml-5.3.1-4.uel20.x86_64 sshpass-1.06-8.uel20.x86_64 Complete! [rootserver1 ~]# 2.对自己做免密配置 之前已生成密钥 对这一块不了解的请查看 【LIUNX】机器互访免密登陆 [rootserver1 ~]# ssh-copy-id rootserver1 /usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: /root/.ssh/id_rsa.pub The authenticity of host server1 (192.168.122.1) cant be established. ECDSA key fingerprint is SHA256:TWajqYQ0cY7n48NQANig8R2qvjcRIDQagMvYot7yIT4. 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 UnionTech OS Server 20 1050e rootserver1s password: Number of key(s) added: 1Now try logging into the machine, with: ssh rootserver1 and check to make sure that only the key(s) you wanted were added. [rootserver1 ~]# ssh rootserver1 UnionTech OS Server 20 1050eAuthorized users only. All activities may be monitored and reported. Last login: Tue Nov 14 15:18:38 2023 from 192.168.3.1Welcome to 4.19.90-2201.4.0.0135.up1.uel20.x86_64System information as of time: 2023年 11月 14日 星期二 20:53:43 CSTSystem load: 0.01 Processes: 202 Memory used: 58.1% Swap used: 0.2% Usage On: 10% IP address: 192.168.3.5 IP address: 192.168.122.1 IP address: 172.17.0.1 Users online: 3[rootserver1 ~]# exit 注销 Connection to server1 closed. [rootserver1 ~]# ssh rootserver2 UnionTech OS Server 20 1050eAuthorized users only. All activities may be monitored and reported. Last login: Tue Nov 14 15:18:29 2023 from 192.168.122.1Welcome to 4.19.90-2201.4.0.0135.up1.uel20.x86_64System information as of time: 2023年 11月 14日 星期二 20:53:41 CSTSystem load: 0.00 Processes: 121 Memory used: 13.2% Swap used: 0.0% Usage On: 6% IP address: 192.168.122.2 Users online: 2免密已经成功了 3.修改ansiable host配置对服务器进行分组 在/etc/ansible/hosts最下方新增一下组别和服务器名 [web] server1 [db] server2 结果如下 [rootserver1 ~]# vi /etc/ansible/hosts [rootserver1 ~]# cat /etc/ansible/hosts # This is the default ansible hosts file. # # It should live in /etc/ansible/hosts # # - Comments begin with the # character # - Blank lines are ignored # - Groups of hosts are delimited by [header] elements # - You can enter hostnames or ip addresses # - A hostname/ip can be a member of multiple groups# Ex 1: Ungrouped hosts, specify before any group headers.## green.example.com ## blue.example.com ## 192.168.100.1 ## 192.168.100.10# Ex 2: A collection of hosts belonging to the webservers group## [webservers] ## alpha.example.org ## beta.example.org ## 192.168.1.100 ## 192.168.1.110# If you have multiple hosts following a pattern you can specify # them like this:## www[001:006].example.com# Ex 3: A collection of database servers in the dbservers group## [dbservers] ## ## db01.intranet.mydomain.net ## db02.intranet.mydomain.net ## 10.25.1.56 ## 10.25.1.57# Heres another example of host ranges, this time there are no # leading 0s:## db-[99:101]-node.example.com [web] server1 [db] server24.测试对所有服务器进行ping命令 rootserver1 ~]# ansible all -m ping [WARNING]: Platform linux on host server2 is using the discovered Python interpreter at /usr/bin/python, but future installation of another Python interpreter could change this. See https://docs.ansible.com/ansible/2.9/reference_appendices/interpreter_discovery.html for more information. server2 | SUCCESS {ansible_facts: {discovered_interpreter_python: /usr/bin/python},changed: false,ping: pong } [WARNING]: Platform linux on host server1 is using the discovered Python interpreter at /usr/bin/python, but future installation of another Python interpreter could change this. See https://docs.ansible.com/ansible/2.9/reference_appendices/interpreter_discovery.html for more information. server1 | SUCCESS {ansible_facts: {discovered_interpreter_python: /usr/bin/python},changed: false,ping: pong }5.写playbook vi install_php_fpm.yml内容如下 --- - hosts: webuser: roottasks: - name: install php-fpmyum: name: php-fpmstate: present- name: start php-fpmservice: name: php-fpmstate: startedenable: yes注意yml文件每行的前面不能用tab只能使用空格 [rootserver1 ~]# vi install_php_fpm.yml [rootserver1 ~]# cat install_php_fpm.yml --- - hosts: webtasks:- name: install phpyum:name: {{item}}state: presentloop:- php-fpm- samba- name: start phpservice:name: php-fpmstate: startedenabled: yes- name: start smbservice:name: smbstate: startedenabled: yes - hosts: dbtasks:- name: install mariadbyum:name: mariadb-serverstate: present- name: start mariadbservice:name: mariadbstate: startedenabled: yes [rootserver1 ~]# ansible-playbook --syntax-check install_php_fpm.yml playbook: install_php_fpm.ymlansible-playbook --syntax-check验证脚本是否正确 命令格式如下 ansible-playbook --syntax-check xxx.yml 6.执行我们写的playbook脚本 [rootserver1 ~]# ansible-playbook install_php_fpm.yml -e ansible_python_interpreter/usr/bin/python3PLAY [web] **************************************************************************************************************************************************************************************************************************************TASK [Gathering Facts] ************************************************************************************************************************************************************************************************************************** ok: [server1]TASK [install php] ****************************************************************************************************************************************************************************************************************************** ok: [server1] (itemphp-fpm) changed: [server1] (itemsamba)TASK [start php] ******************************************************************************************************************************************************************************************************************************** ok: [server1]TASK [start smb] ******************************************************************************************************************************************************************************************************************************** changed: [server1]PLAY [db] ***************************************************************************************************************************************************************************************************************************************TASK [Gathering Facts] ************************************************************************************************************************************************************************************************************************** ok: [server2]TASK [install mariadb] ************************************************************************************************************************************************************************************************************************** changed: [server2]TASK [start mariadb] **************************************************************************************************************************************************************************************************************************** changed: [server2]PLAY RECAP ************************************************************************************************************************************************************************************************************************************** server1 : ok4 changed2 unreachable0 failed0 skipped0 rescued0 ignored0 server2 : ok3 changed2 unreachable0 failed0 skipped0 rescued0 ignored0 [rootserver1 ~]# 命令格式如下 ansible-playbook xxx.yml 7.验证 [rootserver1 ~]# rpm -qc php-fpm /etc/httpd/conf.d/php.conf /etc/logrotate.d/php-fpm /etc/nginx/conf.d/php-fpm.conf /etc/nginx/default.d/php.conf /etc/php-fpm.conf /etc/php-fpm.d/www.conf [rootserver1 ~]# systemctl status php-fpm ● php-fpm.service - The PHP FastCGI Process ManagerLoaded: loaded (/usr/lib/systemd/system/php-fpm.service; enabled; vendor preset: disabled)Active: active (running) since Wed 2023-11-15 00:14:45 CST; 4min 33s agoMain PID: 22863 (php-fpm)Status: Processes active: 0, idle: 5, Requests: 0, slow: 0, Traffic: 0req/secTasks: 6Memory: 16.1MCGroup: /system.slice/php-fpm.service├─22863 php-fpm: master process (/etc/php-fpm.conf)├─22864 php-fpm: pool www├─22865 php-fpm: pool www├─22866 php-fpm: pool www├─22867 php-fpm: pool www└─22868 php-fpm: pool www11月 15 00:14:45 server1 systemd[1]: Starting The PHP FastCGI Process Manager... 11月 15 00:14:45 server1 systemd[1]: Started The PHP FastCGI Process Manager. [rootserver1 ~]#
http://www.w-s-a.com/news/65606/

相关文章:

  • 企业网站 生成html网站侵权怎么做公证或证据保存
  • php 手机网站cms系统购物网站制作流程
  • 网络公司网站开发河北省城乡住房和建设厅网站
  • 做网站配置wordpress 中文api
  • 怎样把网站做的好看县蒙文网站建设汇报
  • 网站的优化什么做广西桂林新闻最新消息
  • 做网站准备什么软件搜索引擎广告推广
  • 网站开发地图板块浮动网页设计与制作的模板
  • 中国建设招聘信息网站昆明做网站建设的公司排名
  • 那些网站可以做自媒体wordpress 分类seo
  • 淮安市盱眙县建设局网站北京西站到八达岭长城最快路线
  • 在线免费网站企业查查官网入口官网
  • 天津网站优化公司哪家专业超融合系统
  • 邹平网站建设公司报价网站建设备案多长时间
  • 三合一网站开发教程wordpress主题汉化中文版
  • 广州网站建设高端全网营销图片
  • 措勤网站建设罗定城乡建设局网站
  • 苏州建网站流程wordpress不显示内容你
  • 网站流量数据golang建设网站
  • 2020电商网站排行榜如何开设网站
  • 绍兴seo网站管理创新的网站建站
  • 做网站需要的图片网站的视频怎么下载
  • 教人做家务的网站滕州网站建设网站行吗
  • 湖北专业的网瘾学校哪家口碑好seo百度百科
  • 保定网站制作软件网页制作工具程
  • o2o网站建设教程计算机培训班培训费用
  • 赤峰网站制作php智能建站系统
  • 做高防鞋 哪个网站能上架net网站开发net网站开发
  • 做网站公司郑州推广计划步骤
  • 网站建设计无形资产外国做美食视频网站