李明
|
负载均衡
docker pull nginx
vi nginx.conf
upstream idig88 { server 192.168.66.101:8080; server 192.168.66.102:8080; server 192.168.66.103:8080; } server { listen 80; server_name www.idig88.com; location / { proxy_pass http://idig88; } }
docker run -idt -p 80:80 -v `pwd`/nginx.conf:/etc/nginx/conf.d/default.conf nginx
sudu vi /etc/hosts
docker service scale ms_gateway-zuul=3 docker service ps ms-gateway-zuul
docker service update ms_course-edge-service --limit-cpu 0.5 docker service inspect ms_course-edge-service
总结
#取消managerdocker node demote [NODE] docker node inspect [NODE] docker node ls# 升级成managerdocker node promote [NODE] docker node ps [NODE] docker node rm [NODE] docker node update [OPTIONS] NODE
PS:有详细看看官网的文档,里面有非常多样化的配置,我相信基本可以满足大家的需求。到这样docker swarm 也就学完了,相信有个整体的认识吧。另外要说下有2个UI管理docker swarm的工具Portainer和Shipyard。下次开始k8s!
|
2019-02-16 00:33:36