You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
8 lines
497 B
8 lines
497 B
#!/bin/bash
|
|
unset MASTER_ADDR
|
|
mcontainer_addr=$(ssh root@10.0.3.100 "docker ps|xargs -n1|grep -i NAMES -A 1|tail -1")
|
|
MASTER_ADDR=$(ssh -t root@10.0.3.100 "docker exec -it $mcontainer_addr ip a s|grep -i 10.0|head -1 2>/dev/null" 2>&1 |grep inet|awk '{print $2}'|cut -d "/" -f 1)
|
|
[ -z $MASTER_ADDR ] && echo "Node 1 hasn't yet been initialized" && exit 1
|
|
env MASTER_ADDR="${MASTER_ADDR}" docker stack deploy -c stack.yaml stack
|
|
env MASTER_ADDR="${MASTER_ADDR}" docker service scale stack_bnode=1
|
|
|
|
|