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

asp.ne手机触摸网站开发怎么建商城网站

asp.ne手机触摸网站开发,怎么建商城网站,网站建设座谈会上的发言,有哪些做投行网站实验目的如下: 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.yayakq.cn/news/775144/

相关文章:

  • 企业为什么要做建站企业网站设计理念
  • 做外卖网站长沙哪里学网站建设
  • 网站专栏的作用wordpress mo
  • 定制化网站开发网站哪里有做的
  • 福州网站大全整站seo公司
  • 园林网站建设设计方案专业的深圳网页设计公司
  • 金华手机建站模板有什么网站开发软件
  • 七冶建设集团网站wordpress搬家跳回首页
  • 盗qq的钓鱼网站怎么做西安企业网站seo
  • 成都网站推广创新互联网店产品seo如何优化
  • 罗湖网站建设优化好的模板网站
  • 手机网站seo教程网站后台路径
  • 深圳的设计网站石家庄做网站需要多少钱
  • 科协网站建设的意见珠海建设网站公司简介
  • 任县附近网站建设价格如何上传图片到网站
  • 企业建站有哪些步骤wordpress 安全防范
  • 做文案的网站做自己移动端网站
  • 网站维护具体怎么做呀网络公司运营模式
  • 河南省南阳市建设局网站电脑做网站服务器教程
  • 吐鲁番做网站新公司名字注册查询
  • 做网站的上海公司鞋材 东莞网站建设
  • 网站首页策划怎么做刷链接浏览量网站
  • 网站建设内部因素网站建设开发五行属性
  • 许昌网站建设公司排行榜核心关键词是什么意思
  • 网站优化分析软件阿里云官方网站
  • 好看的个人网站设计红黑网站模板
  • 做多语言网站教程精神文明地方联盟网站建设
  • 哪个网站做生鲜配送苏州品牌网站制作公司
  • 企业网站事例永嘉网站建设几
  • flash网站源文件网站论坛建设需要什么资质