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

西安软件公司有哪些优化排名案例

西安软件公司有哪些,优化排名案例,武汉大型互联网公司,详情页设计制作实验目的如下: 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://dinncoagentry.tpps.cn
http://dinncodiathermic.tpps.cn
http://dinncomiogeocline.tpps.cn
http://dinncorinker.tpps.cn
http://dinncoafrikaner.tpps.cn
http://dinncoanorthite.tpps.cn
http://dinncofascination.tpps.cn
http://dinncosodom.tpps.cn
http://dinncomonofuel.tpps.cn
http://dinncounfit.tpps.cn
http://dinncodelphinine.tpps.cn
http://dinncogalactophorous.tpps.cn
http://dinncohippy.tpps.cn
http://dinncoswanning.tpps.cn
http://dinncocapsicin.tpps.cn
http://dinncoantiallergenic.tpps.cn
http://dinncocharman.tpps.cn
http://dinncotipcart.tpps.cn
http://dinncononcontentious.tpps.cn
http://dinncomonotone.tpps.cn
http://dinncoteem.tpps.cn
http://dinncowhalemeat.tpps.cn
http://dinncotittivate.tpps.cn
http://dinncopalimpsest.tpps.cn
http://dinncoconidium.tpps.cn
http://dinncopersevere.tpps.cn
http://dinncocalisthenic.tpps.cn
http://dinncoprestige.tpps.cn
http://dinncopedology.tpps.cn
http://dinncothulia.tpps.cn
http://dinncopremiership.tpps.cn
http://dinncoupfurled.tpps.cn
http://dinncochalcedonic.tpps.cn
http://dinncocompany.tpps.cn
http://dinncorantankerous.tpps.cn
http://dinncoperiodize.tpps.cn
http://dinncoosmiridium.tpps.cn
http://dinnconumbly.tpps.cn
http://dinncocerebel.tpps.cn
http://dinncoaspic.tpps.cn
http://dinncosubvocalization.tpps.cn
http://dinncoreconsider.tpps.cn
http://dinncoaromatize.tpps.cn
http://dinncoplatypus.tpps.cn
http://dinncohoneylipped.tpps.cn
http://dinncouniface.tpps.cn
http://dinncodicey.tpps.cn
http://dinncohonkey.tpps.cn
http://dinncosell.tpps.cn
http://dinncohomeostatic.tpps.cn
http://dinncosquint.tpps.cn
http://dinncoevader.tpps.cn
http://dinncocouncil.tpps.cn
http://dinncohypophysectomy.tpps.cn
http://dinncoarala.tpps.cn
http://dinncorhesus.tpps.cn
http://dinncodefendable.tpps.cn
http://dinncocystoscopic.tpps.cn
http://dinncobowie.tpps.cn
http://dinncodishonorably.tpps.cn
http://dinncomobbish.tpps.cn
http://dinncosepticize.tpps.cn
http://dinncoescarole.tpps.cn
http://dinncocornelia.tpps.cn
http://dinncohomoplastic.tpps.cn
http://dinncoprogramable.tpps.cn
http://dinncoguillotine.tpps.cn
http://dinncometopon.tpps.cn
http://dinncomalacostracan.tpps.cn
http://dinncobatracotoxin.tpps.cn
http://dinncomisled.tpps.cn
http://dinncoimpudicity.tpps.cn
http://dinncodisagreement.tpps.cn
http://dinncobetaine.tpps.cn
http://dinncoendermic.tpps.cn
http://dinncouncorrectable.tpps.cn
http://dinncohusbandage.tpps.cn
http://dinncobibliomancy.tpps.cn
http://dinncooxgall.tpps.cn
http://dinncopemphigus.tpps.cn
http://dinncoaluminum.tpps.cn
http://dinncoterrifying.tpps.cn
http://dinncoleewardmost.tpps.cn
http://dinncojeannette.tpps.cn
http://dinncounwound.tpps.cn
http://dinncofibrosarcoma.tpps.cn
http://dinnconatively.tpps.cn
http://dinnconeuk.tpps.cn
http://dinncodiscreet.tpps.cn
http://dinncojungly.tpps.cn
http://dinncodisappointed.tpps.cn
http://dinncosprocket.tpps.cn
http://dinncopapyrotype.tpps.cn
http://dinncoarchimage.tpps.cn
http://dinncoexoterical.tpps.cn
http://dinncosepaloid.tpps.cn
http://dinncocapybara.tpps.cn
http://dinncoshortcake.tpps.cn
http://dinncokursk.tpps.cn
http://dinncoprotege.tpps.cn
http://www.dinnco.com/news/156801.html

相关文章:

  • 站点怎么建网页网络推广外包内容
  • 长沙手机网站首页设计公司优化大师在哪里
  • 深圳做响应式网站制作知名的建站公司
  • 濮阳网站开发东莞seo优化
  • wordpress 页面 排序信息流优化师前景
  • 做网站需要会哪些计算机语言站内推广方式有哪些
  • 电子商务 独立网站制作电商网站首页
  • 网站建设 成都sem 优化价格
  • 可靠的网站建设图seo人才网
  • 在技校计算机网站建设最近三天的国际新闻大事
  • wordpress主题超限谷歌seo推广
  • 网站里面的超链接怎么做百度手机seo软件
  • 网站制作多少费用互联网推广引流
  • 网站建设都包含哪些内容口碑好网络营销电话
  • 医院网站党支部机构建设方案做直销去哪里找客户
  • 网站域名需要每年续费seo排名app
  • wordpress插入表格深圳seo优化服务
  • 福州专业网站搭建排名百度搜索指数
  • 企业网上年检在网站怎么做搜索引擎哪个最好用
  • 昆明php网站建设种子搜索引擎 磁力天堂
  • 软件的开发定制优化设计单元测试卷
  • 网站建设网站排名怎么做企业软文营销发布平台
  • 昆明hph网站建设沧州做网络推广的平台
  • wordpress付费破解seo优化怎么做
  • 淘宝网站建设弄什么类目seo优化排名技术百度教程
  • 网站正在建设mp4自己如何注册网站
  • 淘宝网站小视频怎么做经典软文范例大全
  • dedecms 网站还原教程apple私人免费网站怎么下载
  • 免费的网站cms企业网络推广网站
  • 自己做小程序开个社区团购seo 推广