[root@master1 directoryname]# docker stack deploy -c docker-compose-wulaoer.yml wulaoer Creating service wulaoer_wulaoer-hrs Creating service wulaoer_wulaoer-prm Creating service wulaoer_wulaoer-eureka Creating service wulaoer_wulaoer-oauth Creating service wulaoer_wulaoer-config Creating service wulaoer_wulaoer-category Creating service wulaoer_wulaoer-xn Creating service wulaoer_wulaoer-css Creating service wulaoer_wulaoer-gateway [root@master1 directoryname]# docker service ls ID NAME MODE REPLICAS IMAGE PORTS 1t70zbq2r5vq wulaoer_wulaoer-category replicated 0/1 harbor.wulaoer.cn/wulaoer/wulaoer-category:v1.0 *:8087->8087/tcp wx98kbzwa0uy wulaoer_wulaoer-config replicated 0/1 harbor.wulaoer.cn/wulaoer/wulaoer-config:v1.0 *:8888->8888/tcp snueudbpnpky wulaoer_wulaoer-css replicated 0/1 harbor.wulaoer.cn/wulaoer/wulaoer-css:v1.0 *:8083->8083/tcp uiyqryky1jzr wulaoer_wulaoer-eureka replicated 0/1 harbor.wulaoer.cn/wulaoer/wulaoer-eureka:v1.0 *:9001->9001/tcp wqin8e6uddgp wulaoer_wulaoer-gateway replicated 0/1 harbor.wulaoer.cn/wulaoer/wulaoer-gateway:v1.0 *:9999->9999/tcp nvtf5ii743yj wulaoer_wulaoer-hrs replicated 0/1 harbor.wulaoer.cn/wulaoer/wulaoer-hrs:v1.0 *:8081->8081/tcp du3l97od9do5 wulaoer_wulaoer-oauth replicated 0/1 harbor.wulaoer.cn/wulaoer/wulaoer-oauth:v1.0 *:9002->9002/tcp ozv8f4yqvv4c wulaoer_wulaoer-prm replicated 0/1 harbor.wulaoer.cn/wulaoer/wulaoer-prm:v1.0 *:8082->8082/tcp a7wkw5b0ltnq wulaoer_wulaoer-xn replicated 0/1 harbor.wulaoer.cn/wulaoer/wulaoer-xn:v1.0 *:8084->8084/tcp [root@master1 directoryname]# docker service ps wulaoer_wulaoer-xn ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR PORTS pejb79dzu4gf wulaoer_wulaoer-xn.1 harbor.wulaoer.cn/wulaoer/wulaoer-xn:v1.0 node1 Ready Rejected 3 seconds ago "No such image: harbor.efreigh…" vjtinbzg2lz4 \_ wulaoer_wulaoer-xn.1 harbor.wulaoer.cn/wulaoer/wulaoer-xn:v1.0 node2 Shutdown Rejected 8 seconds ago "No such image: harbor.efreigh…" 1u7yzotwd6tj \_ wulaoer_wulaoer-xn.1 harbor.wulaoer.cn/wulaoer/wulaoer-xn:v1.0 master1 Shutdown Rejected 11 seconds ago "No such image: harbor.efreigh…" rnexymoefl2o \_ wulaoer_wulaoer-xn.1 harbor.wulaoer.cn/wulaoer/wulaoer-xn:v1.0 master1 Shutdown Rejected 18 seconds ago "No such image: harbor.efreigh…" k4zm2ykazlty \_ wulaoer_wulaoer-xn.1 harbor.wulaoer.cn/wulaoer/wulaoer-xn:v1.0 master1 Shutdown Rejected 23 seconds ago "No such image: harbor.efreigh…"
在服务里看这提示是没有找到镜像,但是我本地直接拉取是可以正常拉取的,无奈,只能每台机器上都要把所有的镜像都拉取一遍然后才可以创建成功,这个结果不是我想要的,我想要的应该是我在master节点上创建成功后,在其他节点上自动创建拉取的,而不是需要人为的一个一个的手动拉取镜像的。但是我测试使用其他的镜像就可以自动拉取,但是拉取的是公有镜像,而针对私有镜像是有要求的必须使用关键词"--with-registry-auth",看下面使用的结果。
[root@master1 directoryname]# docker stack deploy --with-registry-auth -c docker-compose-wulaoer.yml xn Creating service xn_wulaoer-prm Creating service xn_wulaoer-oauth Creating service xn_wulaoer-category Creating service xn_wulaoer-hrs Creating service xn_wulaoer-config Creating service xn_wulaoer-xn Creating service xn_wulaoer-eureka Creating service xn_wulaoer-css Creating service xn_wulaoer-gateway [root@master1 directoryname]# docker service ls ID NAME MODE REPLICAS IMAGE PORTS u31biidf9snv wordpress_db replicated 1/1 mysql:latest 6tynjnhfainq wordpress_visualizer replicated 1/1 dockersamples/visualizer:stable *:8080->8080/tcp vhve1ez3dwz6 wordpress_wordpress replicated 1/1 wordpress:latest *:80->80/tcp yux2mc74fyr4 xn_wulaoer-category replicated 1/1 harbor.wulaoer.cn/wulaoer/wulaoer-category:v1.0 *:8087->8087/tcp tkty8gnog5az xn_wulaoer-config replicated 1/1 harbor.wulaoer.cn/wulaoer/wulaoer-config:v1.0 *:8888->8888/tcp wjrkfokkgsus xn_wulaoer-css replicated 1/1 harbor.wulaoer.cn/wulaoer/wulaoer-css:v1.0 *:8083->8083/tcp 1tdm4mikt3vv xn_wulaoer-eureka replicated 1/1 harbor.wulaoer.cn/wulaoer/wulaoer-eureka:v1.0 *:9001->9001/tcp s8pduymilj7y xn_wulaoer-gateway replicated 1/1 harbor.wulaoer.cn/wulaoer/wulaoer-gateway:v1.0 *:9999->9999/tcp kffkdwlf7wtt xn_wulaoer-hrs replicated 1/1 harbor.wulaoer.cn/wulaoer/wulaoer-hrs:v1.0 *:8081->8081/tcp qyimkp0e01o1 xn_wulaoer-oauth replicated 1/1 harbor.wulaoer.cn/wulaoer/wulaoer-oauth:v1.0 *:9002->9002/tcp 84jf24vv25bw xn_wulaoer-prm replicated 1/1 harbor.wulaoer.cn/wulaoer/wulaoer-prm:v1.0 *:8082->8082/tcp x3m39a1q1v5s xn_wulaoer-xn replicated 1/1 harbor.wulaoer.cn/wulaoer/wulaoer-xn:v1.0 *:8084->8084/tcp
需要稍等一下,会自动拉取镜像并创建成功,但是这里我遇到的问题是,我没有对给服务打标签调度,导致服务总是轮训在所有节点上启动一下,所以才会造成启动慢的问题。
您可以选择一种方式赞助本站
支付宝扫一扫赞助
微信钱包扫描赞助
赏