当前位置:网站首页>11. Service update
11. Service update
2020-11-07 16:43:00 【Taizhu-yj】
establish overlay gateway
docker create network --name demo overlay
establish Service
docker service create --name web --publish 8080:5000 --network demo taizhuyj/python-flask-demo:1.0
Write a script , Polling service
sh -c "while true; do curl 127.0.0.1:8080&&sleep 1; done"
Request once per second service service , Return results :
hello docker, version 1.0
to update Service, I hope the business will not be interrupted in the process
1. For those that need to be updated Service Make one scale, Expand horizontally first , Otherwise, the update service will stop .
docker service scale web=2
2. Yes Service updated image
docker service update --help View update commands
docker service update --image xiaopeng163/python-flask-demo:2.0 web
3. View the polling results , With the new version updated , The result of the request is made by
hello docker, version 1.0
Become simultaneous
hello docker, version 1.0
hello docker, version 2.0
With scale All updates , It's going to be all
hello docker, version 2.0
hello docker, version 2.0
see Service Information
docker service ps web
There will be more than one web Information , among version1.0 already shutdown 了 , And the new update version2.0 is Running, Indicates that the update was successful .
Update port
docker service update --publish-rm 8080:5000 --publish-add 8080:5000 web
Update of network port , Can't do without interruption of service
版权声明
本文为[Taizhu-yj]所创,转载请带上原文链接,感谢
边栏推荐
- Detailed software engineering -- the necessary graphs in each stage
- Js数组-数组的用法全在这里(数组方法的重构、数组的遍历、数组的去重,数组的判断与转换)
- September 3, 2020: naked writing algorithm: loop matrix traversal.
- Common mathematical basic formulas of recursive and backtracking algorithms
- 2020-08-20: the difference between go and python?
- REM: the solution of PC and mobile
- How to write plug-in code of small program mall system? How to use code to check whether the plug-in is successfully added?
- K-vim installation and the ycmd server shut down (restart with ': ycmrestartserver')
- .NETCore3.1+ Vue.js Low code workflow engine
- 谈了多年的数字化转型,为什么还有很多企业依然“口头管理”
猜你喜欢
Insomnia all night
Git SSH bad permissions
Gantt chart grouping activities tutorial
vue3 新特性
8. Swarm creates maintenance and horizontal extension service
How to write plug-in code of small program mall system? How to use code to check whether the plug-in is successfully added?
Bluetooth broadcast chip for Shanghai giant micro
JS string - string string object method
Benefits and functions of auto maintenance app development
Windows 10 蓝牙管理页面'添加蓝牙或其他设备'选项点击无响应的解决方案
随机推荐
Idea activation to 2089 failure
Python 3 operates the Jenkins module API
Unexpected element.. required element
甘特图对活动进行分组教程
谈了多年的数字化转型,为什么还有很多企业依然“口头管理”
Insomnia all night
关于DevOps的七大误解,99%的人都曾中过招!
嘉宾介绍|2020 PostgreSQL亚洲大会中文分论坛:潘娟
Python3 operating gitlab
Top 5 Chinese cloud manufacturers in 2018: Alibaba cloud, Tencent cloud, AWS, telecom, Unicom
August 14, 2020: what are the execution engines for data tasks?
Plug in bilibilibili new version 0.5.5
The advantages and functions of psychological counseling app
7.Swarm搭建集群
应用层软件开发教父教你如何重构,资深程序员必备专业技能
Ora-02292: complete constraint violation (midbjdev2.sys_ C0020757) - subrecord found
如何解决谷歌Chrome浏览器空白页的问题
How does varhart xgantt represent working days on a calendar
如何才能快速正确的部署甘特图
2020-08-19: what mechanism does TCP ensure reliability?