我很难建立一个由两名工人和一名经理组成的 Docker Swarm。一切正常,直到我添加第二个工人。添加第二个工人后,第一个工人的守护进程进入某种错误状态,其中一个简单的docker version
产量
另外,我正在使用 Stack YAML 来启动三个 Redis 服务。
堆栈.yaml
version: '3.4'
services:
redis-master:
image: 'bitnami/redis:5.0.2'
ports:
- '6379:6379'
environment:
- REDIS_REPLICATION_MODE=master
- REDIS_PASSWORD=f7paul12-d571-4701-9c55-64vanacecDyK
deploy:
mode: global
restart_policy:
condition: any
volumes:
- 'redis:/opt/bitnami/redis/etc/'
redis-replica:
image: 'bitnami/redis:5.0.2'
ports:
- '6379'
depends_on:
- redis-master
environment:
- REDIS_REPLICATION_MODE=slave
- REDIS_MASTER_HOST=redis-master
- REDIS_MASTER_PORT_NUMBER=6379
- REDIS_MASTER_PASSWORD=f7paul12-d571-4701-9c55-64vanacecDyK
- REDIS_PASSWORD=f7paul12-d571-4701-9c55-64vanacecDyK
deploy:
mode: replicated
replicas: 6
update_config:
parallelism: 1
delay: 20s
restart_policy:
condition: any
redis-sentinel:
image: 'bitnami/redis:5.0.2'
ports:
- '16379'
depends_on:
- redis-master
- redis-replica
entrypoint: |
bash -c 'bash -s <<EOF
"/bin/bash" -c "cat <<EOF > /opt/bitnami/redis/etc/sentinel.conf
port 16379
dir /tmp
sentinel monitor master-node redis-master 6379 2
sentinel down-after-milliseconds master-node 5000
sentinel parallel-syncs master-node 1
sentinel failover-timeout master-node 5000
sentinel auth-pass master-node f7paul12-d571-4701-9c55-64vanacecDyK
sentinel announce-ip redis-sentinel
sentinel announce-port 16379
EOF"
"/bin/bash" -c "redis-sentinel /opt/bitnami/redis/etc/sentinel.conf"
EOF'
deploy:
mode: global
restart_policy:
condition: any
volumes:
redis:
driver: external
driver_opts:
type: 'none'
o: 'bind'
device: '/c/redis/'
我在 Windows Server 2016 上运行 Docker CE 18.09.0(EE 有同样的问题)此外,我所有的工作节点都在 Windows 平台上,使用 Linux 容器。(我的管理器节点是相同的,但由于问题 #3031而使用 Windows 容器)
在专有 Windows 环境中甚至支持设置多节点群吗?如何使用上面列出的环境设置此集群?