BlueXIII's Blog

热爱技术,持续学习

0%

DockerSwarm子节点配置

Docker相关配置

vi /etc/hosts

1
2
10.193.10.15  artifactory.sdecloud.com
10.133.0.131 www.zykjfw.cn

vi /etc/docker/daemon.json

1
2
3
4
{
"registry-mirrors":["https://r9xxm8z8.mirror.aliyuncs.com"],
"insecure-registries":["artiServer:8082","10.193.10.15:8082","artifactory.sdecloud.com:8443","artifactory.sdecloud.com:8082","10.193.10.15:8443"]
}
1
2
3
4
5
6
7
8
9
10
11

# 重启
systemctl daemon-reload
systemctl restart docker

# 登录
docker login artifactory.sdecloud.com:8443
admin/Lzqzhu1241jie

# 测试
docker pull artifactory.sdecloud.com:8443/docker-local/h5:RELEASE-1.491

新增节点

1
2
3
4
5
6
7
8
# master上查看token
docker swarm join-token worker

# 新节点加入master
docker swarm join --token SWMTKN-1-18pycq92hlpw4q9okdh074d8y5etztku84312apwukehvqmgb6-76156tq10bc8kbn5oq38vn6lr 10.193.10.20:2377

# master上查看状态
docker node ls