mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2024-12-25 02:44:18 +00:00
Change swarm startup
This commit is contained in:
parent
49311f58f0
commit
acedd35e64
@ -5,7 +5,6 @@ services:
|
|||||||
command: ["-p", "-s", "opaque_storage;/srv/opaque/storage;no;no;no;opaque", "-u", "opaque;opaque"]
|
command: ["-p", "-s", "opaque_storage;/srv/opaque/storage;no;no;no;opaque", "-u", "opaque;opaque"]
|
||||||
image: dperson/samba:latest
|
image: dperson/samba:latest
|
||||||
ports:
|
ports:
|
||||||
- 139:139
|
|
||||||
- 445:445
|
- 445:445
|
||||||
restart: on-failure
|
restart: on-failure
|
||||||
volumes:
|
volumes:
|
||||||
|
@ -9,9 +9,8 @@ if [ -z ${SWARM_MANAGER_IP} ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Leave possible swarm and down all services..."
|
echo "Leave possible swarm and down all services..."
|
||||||
docker swarm leave --force > /dev/null 2>&1
|
docker swarm leave --force
|
||||||
docker-compose --file dind_swarm.yml down > /dev/null 2>&1
|
docker-compose --file dind_swarm.yml down
|
||||||
|
|
||||||
|
|
||||||
echo "Start storage container"
|
echo "Start storage container"
|
||||||
docker-compose --file dind_swarm.yml up --detach storage
|
docker-compose --file dind_swarm.yml up --detach storage
|
||||||
@ -19,18 +18,19 @@ sleep 3
|
|||||||
|
|
||||||
echo "Mount network storage to host system..."
|
echo "Mount network storage to host system..."
|
||||||
sudo mkdir -p /mnt/opaque
|
sudo mkdir -p /mnt/opaque
|
||||||
|
sudo umount /mnt/opaque
|
||||||
sudo mount -t cifs -o gid=${USER},password=opaque,uid=${USER},user=opaque,vers=3.0 //localhost/opaque_storage /mnt/opaque
|
sudo mount -t cifs -o gid=${USER},password=opaque,uid=${USER},user=opaque,vers=3.0 //localhost/opaque_storage /mnt/opaque
|
||||||
|
|
||||||
echo "Start worker service(s)"
|
echo "Start worker service(s)"
|
||||||
docker-compose --file dind_swarm.yml up --detach --scale worker=${SWARM_WORKER_NUMBER} worker viz
|
docker-compose --file dind_swarm.yml up --detach --scale worker=${SWARM_WORKER_NUMBER} worker viz
|
||||||
sleep 5
|
sleep 7
|
||||||
|
|
||||||
echo "Init Docker swarm..."
|
echo "Init Docker swarm..."
|
||||||
docker swarm init --advertise-addr ${SWARM_MANAGER_IP} > /dev/null 2>&1
|
docker swarm init --advertise-addr ${SWARM_MANAGER_IP}
|
||||||
|
|
||||||
echo "Add workers to swarm..."
|
echo "Add workers to swarm..."
|
||||||
SWARM_WORKER_TOKEN=$(docker swarm join-token -q worker)
|
SWARM_WORKER_TOKEN=$(docker swarm join-token -q worker)
|
||||||
for i in $(seq 1 ${SWARM_WORKER_NUMBER}); do
|
for i in $(seq 1 ${SWARM_WORKER_NUMBER}); do
|
||||||
echo "[opaque_worker_${i}]"
|
echo -n "[opaque_worker_${i}]: "
|
||||||
docker-compose --file dind_swarm.yml exec --index=${i} worker docker swarm join --token ${SWARM_WORKER_TOKEN} ${SWARM_MANAGER_IP}:2377
|
docker-compose --file dind_swarm.yml exec --index=${i} worker docker swarm join --token ${SWARM_WORKER_TOKEN} ${SWARM_MANAGER_IP}:2377
|
||||||
done
|
done
|
||||||
|
Loading…
Reference in New Issue
Block a user