由于服务器有限,使用了两台服务器加入了swarm 进行部署
服务器a: graphd,metad0,storaged0
服务器b: storaged1,storaged2, metad1,metad2
ymal如下:
version: '3.6'
services:
metad0:
image: vesoft/nebula-metad:v3.2.0
env_file:
- ./nebula.env
command:
- --meta_server_addrs=120.46.147.172:9559,120.46.178.164:9559,120.46.178.164:5555
- --local_ip=120.46.147.172
- --ws_ip=120.46.147.172
- --port=9559
- --data_path=/data/meta
- --log_dir=/logs
- --v=0
- --minloglevel=2
deploy:
replicas: 1
restart_policy:
condition: on-failure
placement:
constraints:
- node.hostname == ecs-3f95
healthcheck:
test: ["CMD", "curl", "-f", "http://120.46.147.172:19559/status"]
interval: 30s
timeout: 10s
retries: 3
start_period: 20s
ports:
- target: 19559
published: 19559
protocol: tcp
mode: host
- target: 19560
published: 19560
protocol: tcp
mode: host
- target: 9559
published: 9559
protocol: tcp
mode: host
volumes:
- data-metad0:/data/meta
- logs-metad0:/logs
networks:
- nebula-net
metad1:
image: vesoft/nebula-metad:v3.2.0
env_file:
- ./nebula.env
command:
- --meta_server_addrs=120.46.147.172:9559,120.46.178.164:9559,120.46.178.164:5555
- --local_ip=120.46.178.164
- --ws_ip=120.46.178.164
- --port=9559
- --data_path=/data/meta
- --log_dir=/logs
- --v=0
- --minloglevel=2
deploy:
replicas: 1
restart_policy:
condition: on-failure
placement:
constraints:
- node.hostname == ecs-1d07
healthcheck:
test: ["CMD", "curl", "-f", "http://120.46.178.164:19559/status"]
interval: 30s
timeout: 10s
retries: 3
start_period: 20s
ports:
- target: 19559
published: 19559
protocol: tcp
mode: host
- target: 19560
published: 19560
protocol: tcp
mode: host
- target: 9559
published: 9559
protocol: tcp
mode: host
volumes:
- data-metad1:/data/meta
- logs-metad1:/logs
networks:
- nebula-net
metad2:
image: vesoft/nebula-metad:v3.2.0
env_file:
- ./nebula.env
command:
- --meta_server_addrs=120.46.147.172:9559,120.46.178.164:9559,120.46.178.164:5555
- --local_ip=120.46.178.164
- --ws_ip=120.46.178.164
- --port=5555
- --data_path=/data/meta
- --log_dir=/logs
- --v=0
- --minloglevel=2
deploy:
replicas: 1
restart_policy:
condition: on-failure
placement:
constraints:
- node.hostname == ecs-1d07
healthcheck:
test: ["CMD", "curl", "-f", "http://120.46.178.164:19558/status"]
interval: 30s
timeout: 10s
retries: 3
start_period: 20s
ports:
- target: 19558
published: 19559
protocol: tcp
mode: host
- target: 19561
published: 19560
protocol: tcp
mode: host
- target: 5555
published: 9559
protocol: tcp
mode: host
volumes:
- data-metad2:/data/meta
- logs-metad2:/logs
networks:
- nebula-net
storaged0:
image: vesoft/nebula-storaged:v3.2.0
env_file:
- ./nebula.env
command:
- --meta_server_addrs=120.46.147.172:9559,120.46.178.164:9559,120.46.178.164:5555
- --local_ip=120.46.147.172
- --ws_ip=120.46.147.172
- --port=9779
- --data_path=/data/storage
- --log_dir=/logs
- --v=0
- --minloglevel=2
deploy:
replicas: 1
restart_policy:
condition: on-failure
placement:
constraints:
- node.hostname == ecs-3f95
depends_on:
- metad0
- metad1
- metad2
healthcheck:
test: ["CMD", "curl", "-f", "http://120.46.147.172:19779/status"]
interval: 30s
timeout: 10s
retries: 3
start_period: 20s
ports:
- target: 19779
published: 19779
protocol: tcp
mode: host
- target: 19780
published: 19780
protocol: tcp
mode: host
- target: 9779
published: 9779
protocol: tcp
mode: host
volumes:
- data-storaged0:/data/storage
- logs-storaged0:/logs
networks:
- nebula-net
storaged1:
image: vesoft/nebula-storaged:v3.2.0
env_file:
- ./nebula.env
command:
- --meta_server_addrs=120.46.147.172:9559,120.46.178.164:9559,120.46.178.164:5555
- --local_ip=120.46.178.164
- --ws_ip=120.46.178.164
- --port=9779
- --data_path=/data/storage
- --log_dir=/logs
- --v=0
- --minloglevel=2
deploy:
replicas: 1
restart_policy:
condition: on-failure
placement:
constraints:
- node.hostname == ecs-1d07
depends_on:
- metad0
- metad1
- metad2
healthcheck:
test: ["CMD", "curl", "-f", "http://120.46.178.164:19779/status"]
interval: 30s
timeout: 10s
retries: 3
start_period: 20s
ports:
- target: 19779
published: 19779
protocol: tcp
mode: host
- target: 19780
published: 19780
protocol: tcp
mode: host
- target: 9779
published: 9779
protocol: tcp
mode: host
volumes:
- data-storaged1:/data/storage
- logs-storaged1:/logs
networks:
- nebula-net
storaged2:
image: vesoft/nebula-storaged:v3.2.0
env_file:
- ./nebula.env
command:
- --meta_server_addrs=120.46.147.172:9559,120.46.178.164:9559,120.46.178.164:5555
- --local_ip=120.46.178.164
- --ws_ip=120.46.178.164
- --port=4778
- --data_path=/data/storage
- --log_dir=/logs
- --v=0
- --minloglevel=2
deploy:
replicas: 1
restart_policy:
condition: on-failure
placement:
constraints:
- node.hostname == ecs-1d07
depends_on:
- metad0
- metad1
- metad2
healthcheck:
test: ["CMD", "curl", "-f", "http://120.46.178.164:19778/status"]
interval: 30s
timeout: 10s
retries: 3
start_period: 20s
ports:
- target: 19778
published: 19779
protocol: tcp
mode: host
- target: 19781
published: 19780
protocol: tcp
mode: host
- target: 4778
published: 9779
protocol: tcp
mode: host
volumes:
- data-storaged2:/data/storage
- logs-storaged2:/logs
networks:
- nebula-net
graphd:
image: vesoft/nebula-graphd:v3.2.0
env_file:
- ./nebula.env
command:
- --meta_server_addrs=120.46.147.172:9559,120.46.178.164:9559,120.46.178.164:5555
- --port=9669
- --ws_ip=120.46.147.172
- --log_dir=/logs
- --v=0
- --minloglevel=2
deploy:
replicas: 1
restart_policy:
condition: on-failure
placement:
constraints:
- node.hostname == ecs-3f95
depends_on:
- metad0
- metad1
- metad2
healthcheck:
test: ["CMD", "curl", "-f", "http://120.46.147.172:19669/status"]
interval: 30s
timeout: 10s
retries: 3
start_period: 20s
ports:
- target: 9669
published: 9669
protocol: tcp
mode: host
- target: 19669
published: 19669
protocol: tcp
mode: host
- target: 19670
published: 19670
protocol: tcp
mode: host
volumes:
- logs-graphd:/logs
networks:
- nebula-net
console:
image: vesoft/nebula-console:nightly
entrypoint: ""
command:
- sh
- -c
- |
for i in `seq 1 60`;do
var=`nebula-console -addr 120.46.147.172 -port 9669 -u root -p nebula -e 'ADD HOSTS "120.46.147.172":9779,"120.46.178.164":4778,"120.46.178.164":9779`;
if [[ $$? == 0 ]];then
break;
fi;
sleep 1;
echo "retry to add hosts.";
done && tail -f /dev/null;
depends_on:
- graphd
networks:
- nebula-net
networks:
nebula-net:
external: true
attachable: true
name: host
volumes:
data-metad0:
logs-metad0:
data-metad1:
logs-metad1:
data-metad2:
logs-metad2:
data-storaged0:
logs-storaged0:
data-storaged1:
logs-storaged1:
data-storaged2:
logs-storaged2:
logs-graphd:
运行后
docker stack deploy -c xxxxx .ymal nebula
启动失败图片:
根据docker swarm部署 中的文档更改后进行启动也是失败,和上图一样。请问该如何处理呢?