部署流水线的实现与自动化
1. 手动部署流水线的后期阶段
在手动部署流水线的后期阶段,我们需要完成一系列操作来确保服务在生产环境中正常运行。
1.1 配置生产节点
首先,使用以下配置来启动生产节点的相关服务:
- hosts: prod
remote_user: vagrant
serial: 1
sudo: yes
roles:
- common
- docker
- docker-compose
- consul
- registrator
- consul-template
- nginx
运行此配置后,生产节点将启动 Consul、Registrator、Consul Template 和 nginx 服务,这些服务将允许我们将所有请求代理到目标服务(目前仅为 books - ms)。
从 CD 节点运行 playbook:
vagrant ssh cd
ansible-playbook /vagrant/ansible/prod2.yml \
-i /vagrant/ansible/hosts/prod
1.2 启动容器
在进行集成之前,需要启动容器:
wget https://raw.githubusercontent.com/vfarcic
超级会员免费看
订阅专栏 解锁全文
1361

被折叠的 条评论
为什么被折叠?



