当前位置:网站首页>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
边栏推荐
- Two dimensional code location and alarm system of Expressway
- Method of code refactoring -- Analysis of method refactoring
- 高速公路二维码定位报警系统
- Count the number of project code lines
- 频收罚单的浦发银行:增收不增利,曾遭骗贷数亿元,内控缺位?
- August 24, 2020: what are small documents? What's wrong with a lot of small files? How to solve many small files? (big data)
- The memorandum model of behavior model
- 如何才能快速正确的部署甘特图
- August 30, 2020: naked write algorithm: the nearest common ancestor of two nodes in a binary tree.
- 图像处理工具包ImagXpress使用教程,如何查看事件
猜你喜欢

image operating system windows cannot be used on this platform

How to manage the authority of database account?

Js数组-数组的用法全在这里(数组方法的重构、数组的遍历、数组的去重,数组的判断与转换)

PHP后门隐藏技巧

List to map (split the list according to the key, and the value of the same key is a list)

.NETCore3.1+ Vue.js Low code workflow engine

南京标志设计,logo设计公司

Configuration of AP hotspot on xunwei-imx6ull development board

条形码识别性能低,如何优化Dynamsoft Barcode Reader解码性能

2020年新规,微信封号怎么快速解除?
随机推荐
Epu360: all the H5 templates you want are here, e-book, big turntable, red envelope rain, questionnaire survey
10000! Ideal car recalls all defective cars: 97 accidents have occurred and losses will be expanded
Big data processing black Technology: revealing the parallel computing technology of Pb level data warehouse gaussdb (DWS)
移动端像素适配方案
August 24, 2020: what are small documents? What's wrong with a lot of small files? How to solve many small files? (big data)
条形码识别器Dynamsoft Barcode Reader v7.5全新上线!
Erd-online free online database modeling tool
Insomnia all night
Stm32f030c6t6 compatible to replace mm32spin05pf
1万辆!理想汽车召回全部缺陷车:已发生事故97起,亏损将扩大
关于DevOps的七大误解,99%的人都曾中过招!
ImageMagick - add watermark
Characteristics of magnetic memory chip STT-MRAM
Stm32f030k6t6 compatible replacement smart mm32f031k6t6
How to deploy Gantt chart quickly and correctly
插件Bilibili新版0.5.5
August 30, 2020: naked write algorithm: the nearest common ancestor of two nodes in a binary tree.
Common syntax corresponding table of mongodb and SQL
2020-08-17: how to solve data skew in detail?
The use of Xunwei imx6 development board device tree kernel menuconfig