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

想做网站怎么做网推平台有哪些比较好

想做网站怎么做,网推平台有哪些比较好,wordpress简单用户中心,广州建设网站平台实验目的如下: 1. 环境准备: 使用命令lab inventory-variables start初始化环境 2. 进入/home/student/git-repos目录克隆下载http://git.lab.example.com:8081/git/inventory-variables.git 3. 将目录下yaml文件内容以group_vars形式修改 4. 部署并将修改后ansible-playbook代…

实验目的如下:

1. 环境准备: 使用命令lab inventory-variables start初始化环境
2. 进入/home/student/git-repos目录克隆下载http://git.lab.example.com:8081/git/inventory-variables.git
3. 将目录下yaml文件内容以group_vars形式修改
4. 部署并将修改后ansible-playbook代码上传git仓库
5. 环境结束使用lab inventory-variables finish清理环境

试验开始

cd /home/student/git-repos
git clone http://git.lab.example.com:8081/git/inventory-variables.git
cd inventory-variables/=====================
确认2个组名
grep hosts deploy_haproxy.yml  deploy_webapp.yml
====得到以下内容:
deploy_haproxy.yml:  hosts: lb_servers
deploy_webapp.yml:  hosts: web_servers
创建目录
mkdir group_vars/{lb_servers,web_servers} -p

此时deploy_haproxy.yml 内容如下.

[student@workstation inventory-variables (master)]$cat deploy_haproxy.yml
- name: Ensure HAProxy is deployedhosts: lb_serversforce_handlers: Trueroles:# The "haproxy" role has a dependency on the "firewall" role.# The "firewall" role requires a "firewall_rules" variable be defined.- role: haproxyfirewall_rules:# Allow 80/tcp connections- port: 80/tcphaproxy_appservers:- name: serverb.lab.example.comip: 172.25.250.11backend_port: 80- name: serverc.lab.example.comip: 172.25.250.12backend_port: 80

将以下内容放入group_vars/lb_servers/firewall.yml中

firewall_rules:# Allow 80/tcp connections- port: 80/tcp

将以下内容放入group_vars/lb_servers/haproxy.yml中(其实这里路径对即可,文件名可以不严格安装这个,只是好识别)

haproxy_appservers:- name: serverb.lab.example.comip: 172.25.250.11backend_port: 80- name: serverc.lab.example.comip: 172.25.250.12backend_port: 80

然后删除deploy_haproxy.yml中的这部分内容,此时deploy_haproxy.yml如下:

- name: Ensure HAProxy is deployedhosts: lb_serversforce_handlers: Trueroles:# The "haproxy" role has a dependency on the "firewall" role.# The "firewall" role requires a "firewall_rules" variable be defined.- role: haproxy

deploy_apache内容如下:

- name: Ensure Apache is deployedhosts: web_serversforce_handlers: Trueroles:# The "apache" role has a dependency on the "firewall" role.# The "firewall" role requires a "firewall_rules" variable be defined.- role: apachefirewall_rules:# Allow http requests from the load_balancer.- zone: internalservice: httpsource: "172.25.250.10"

将以下内容放入group_vars/web_servers/firewall.yml中

firewall_rules:# Allow http requests from the load_balancer.- zone: internalservice: httpsource: "172.25.250.10"

再将源文件这部分内容删除,此时deploy_apache.yml内容如下

- name: Ensure Apache is deployedhosts: web_serversforce_handlers: Trueroles:# The "apache" role has a dependency on the "firewall" role.# The "firewall" role requires a "firewall_rules" variable be defined.- role: apache

执行命令ansible-playbook site.yml运行部署

[student@workstation inventory-variables (master *%)]$ansible-playbook site.ymlPLAY [Ensure HAProxy is deployed] ******************************************************TASK [Gathering Facts] *****************************************************************
ok: [servera.lab.example.com]TASK [firewall : Ensure Firewall Sources Configuration] ********************************
ok: [servera.lab.example.com] => (item={'port': '80/tcp'})TASK [haproxy : Ensure haproxy packages are present] ***********************************
changed: [servera.lab.example.com]TASK [haproxy : Ensure haproxy is started and enabled] *********************************
changed: [servera.lab.example.com]TASK [haproxy : Ensure haproxy configuration is set] ***********************************
changed: [servera.lab.example.com]RUNNING HANDLER [haproxy : reload haproxy] *********************************************
changed: [servera.lab.example.com]PLAY [Ensure Apache is deployed] *******************************************************TASK [Gathering Facts] *****************************************************************
ok: [serverc.lab.example.com]
ok: [serverb.lab.example.com]TASK [firewall : Ensure Firewall Sources Configuration] ********************************
ok: [serverb.lab.example.com] => (item={'zone': 'internal', 'service': 'http', 'source': '172.25.250.10'})
ok: [serverc.lab.example.com] => (item={'zone': 'internal', 'service': 'http', 'source': '172.25.250.10'})TASK [apache : Install http] ***********************************************************
changed: [serverb.lab.example.com]
changed: [serverc.lab.example.com]TASK [apache : Configure SELinux to allow httpd to connect to remote database] *********
ok: [serverb.lab.example.com]
ok: [serverc.lab.example.com]TASK [apache : http service state] *****************************************************
changed: [serverb.lab.example.com]
changed: [serverc.lab.example.com]PLAY [Ensure Web App is deployed] ******************************************************TASK [Gathering Facts] *****************************************************************
ok: [serverb.lab.example.com]
ok: [serverc.lab.example.com]TASK [webapp : Copy a stub file.] ******************************************************
ok: [serverb.lab.example.com]
ok: [serverc.lab.example.com]PLAY RECAP *****************************************************************************
servera.lab.example.com    : ok=6    changed=4    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0
serverb.lab.example.com    : ok=7    changed=2    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0
serverc.lab.example.com    : ok=7    changed=2    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0

访问测试,可以看到实现通过servera对serverb,serverc的轮询

[student@workstation inventory-variables (master *%)]$curl http://servera
This is serverb. (version v1.0)
[student@workstation inventory-variables (master *%)]$curl http://servera
This is serverc. (version v1.0)
[student@workstation inventory-variables (master *%)]$curl http://servera
This is serverb. (version v1.0)
[student@workstation inventory-variables (master *%)]$curl http://servera
This is serverc. (version v1.0)

因为需要对ansible-playbook的管理

git commit  -a -m "Use Group Vars"
git push

至此试验完成,执行以下命令清理环境

lab inventory-variables finish
cd .. && rm -rf inventory-variables
http://www.hkea.cn/news/88708/

相关文章:

  • discuz做电影网站免费网站seo
  • 惠民建设局网站明年2024年有疫情吗
  • 卫龙的网站是谁做的今日的新闻
  • 厚街找人做网站动态网站设计
  • 永春县住房和城乡规划建设局网站太原seo排名优化软件
  • 怎么上网站后台爱站小工具计算器
  • 网页编辑岗位职责seo上海优化
  • 网站做二维码吗做网站的外包公司
  • 郑州市中原区疫情最新消息上海网站营销seo方案
  • 狂人站群系统中国最权威的网站排名
  • 简单网站开发实例网站运营工作的基本内容
  • 飞机免费代理ip爱站网seo综合查询工具
  • 河南焦作有做网站开发的公司吗巩义网络推广公司
  • 邓州做网站网络广告有哪些形式
  • 爬闪数媒 网站建设网站建站流程
  • 网站建设广州白云百度统计app下载
  • 惠州短视频seoseowhy论坛
  • 肇庆网站快速排名优化温州seo排名公司
  • 北京疫情死亡人数最新消息王通seo赚钱培训
  • 北京做网站的外包公司营销策划方案案例范文
  • 专业做酒店网站关键词优化排名软件流量词
  • 做网站推广代理上海网络推广服务
  • wordpress可以做大吗搜索引擎优化的英语简称
  • 民治专业做网站公司中国企业500强排行榜
  • 潍坊 公司 网站seo点击排名器
  • 网站可以做赌博广告建站宝盒
  • 运城市做网站英文seo外链
  • 江宁网站建设如何建立网上销售平台
  • 淄博企业网站建设有限公司搜索引擎关键词竞价排名
  • 网站的优点企业专业搜索引擎优化