当前位置:网站首页>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
边栏推荐
- The first choice for lightweight GPU applications is the NVIDIA vgpu instance launched by Jingdong Zhilian cloud
- JS array the usage of array is all here (array method reconstruction, array traversal, array de duplication, array judgment and conversion)
- ado.net and asp.net The relationship between
- Gantt chart grouping activities tutorial
- Developing STM32 USB with cubemx
- python3操作Jenkins模块api
- Idea activation to 2089 failure
- .NETCore3.1+Vue.js打造的低代码工作流引擎
- 2020-08-17: how to solve data skew in detail?
- Logo design company, Nanjing
猜你喜欢
Js数组-数组的用法全在这里(数组方法的重构、数组的遍历、数组的去重,数组的判断与转换)
The memorandum model of behavior model
Design of NAND flash interface control
Windows 10 蓝牙管理页面'添加蓝牙或其他设备'选项点击无响应的解决方案
Js字符串-String字符串对象方法
Win7 how to quickly type CMD and get to the required directory
image operating system windows cannot be used on this platform
Shanghai Pudong Development Bank, which frequently receives penalty tickets, has been cheated by hundreds of millions of yuan in loans, and lacks of internal control?
轻量型 GPU 应用首选 京东智联云推出 NVIDIA vGPU 实例
How to deploy Gantt chart quickly and correctly
随机推荐
FreeSWITCH视频会议“标准”解决方案
2020-09-04: do you understand the function call convention?
2020年新规,微信封号怎么快速解除?
插件Bilibili新版0.5.5
jenkins pipline stage 设置超时
2020-08-15: under what circumstances should data tasks be optimized?
k-vim安装及The ycmd server SHUT DOWN (restart with ':YcmRestartServer')这种错误的解决方法
Three steps to understand Kerberos Protocol easily
Git SSH bad permissions
Epu360: all the H5 templates you want are here, e-book, big turntable, red envelope rain, questionnaire survey
Nanjing logo design and production, guide VI system design
频收罚单的浦发银行:增收不增利,曾遭骗贷数亿元,内控缺位?
C calls SendMessage to refresh the taskbar icon (the icon does not disappear at the end of forcing)
图像处理工具包ImagXpress使用教程,如何查看事件
Interviewer: how about shardingsphere
Gantt chart grouping activities tutorial
Web API interface design: swaggerui document / unified response format / unified exception handling / unified authority verification
How to write plug-in code of small program mall system? How to use code to check whether the plug-in is successfully added?
7. Swarm builds clusters
yum [Errno 256] No more mirrors to try 解决方法