当前位置:网站首页>11.Service更新
11.Service更新
2020-11-07 16:43:00 【太猪-YJ】
创建overlay网关
docker create network --name demo overlay
创建Service
docker service create --name web --publish 8080:5000 --network demo taizhuyj/python-flask-demo:1.0
编写脚本,轮询服务
sh -c "while true; do curl 127.0.0.1:8080&&sleep 1; done"
每秒请求一次service服务,返回结果:
hello docker, version 1.0
更新Service,希望过程中业务不要中断
1.对需要更新的Service做一个scale,先横向扩展,不然单点做更新服务会停掉。
docker service scale web=2
2.对Service进行更新image
docker service update --help 查看更新命令
docker service update --image xiaopeng163/python-flask-demo:2.0 web
3.查看轮询结果,随着新版本更新完毕,请求结果由
hello docker, version 1.0
变成同时存在
hello docker, version 1.0
hello docker, version 2.0
随着scale全部更新,会变成全是
hello docker, version 2.0
hello docker, version 2.0
查看Service信息
docker service ps web
会发现有多个web信息,其中version1.0已经shutdown了,而新更新的version2.0正在Running,说明更新成功。
更新端口
docker service update --publish-rm 8080:5000 --publish-add 8080:5000 web
对网络端口的更新,无法做到不中断服务
版权声明
本文为[太猪-YJ]所创,转载请带上原文链接,感谢
https://my.oschina.net/xiaoyoung/blog/4706981
边栏推荐
- New features of vue3
- [graffiti Internet of things footprints] panoramic introduction of graffiti cloud platform
- C calls SendMessage to refresh the taskbar icon (the icon does not disappear at the end of forcing)
- Test the necessary skill points of siege lion! This article takes you to interpret the testing technology under Devops
- Exclusive interview with Alibaba cloud database for 2020 PostgreSQL Asia Conference: Zeng Wenjing
- A good thing for working people -- to temper the will of iron and steel requires such an efficient computer
- 高速公路二维码定位报警系统
- 2020年新规,微信封号怎么快速解除?
- Win7 how to quickly type CMD and get to the required directory
- Cloudquery v1.2.0 release
猜你喜欢

confd

频收罚单的浦发银行:增收不增利,曾遭骗贷数亿元,内控缺位?

高速公路二维码定位报警系统

2020-08-19: what mechanism does TCP ensure reliability?

2018中国云厂商TOP5:阿里云、腾讯云、AWS、电信、联通 ...

Mongo user rights login instruction

September 3, 2020: naked writing algorithm: loop matrix traversal.

python3操作gitlab

Exclusive interview of guests at | 2020 PostgreSQL Asia Conference: Wang Tao

How to deploy Gantt chart quickly and correctly
随机推荐
Insomnia all night
如何才能快速正确的部署甘特图
Design of NAND flash interface control
REM: the solution of PC and mobile
Win7 how to quickly type CMD and get to the required directory
ado.net and asp.net The relationship between
高速公路二维码定位报警系统
Es create a new index database and copy the old index library, practice pro test effective!
Win7 AppCrash (solution)
消防器材RFID固定资产管理系统
南京标识标牌设计制作,导视VI系统设计
超高频RFID医疗血液管理系统应用
cubemx做stm32 USB开发
轻量型 GPU 应用首选 京东智联云推出 NVIDIA vGPU 实例
How to add modules to nginx image?
Git SSH bad permissions
Zhou Jie: database system of East China Normal University
7.Swarm搭建集群
How to write plug-in code of small program mall system? How to use code to check whether the plug-in is successfully added?
#JVM 类加载机制