Improve Federation Start up times and error codes

- Start asynchronously worker nodes
 - Rework error codes, update usage information
This commit is contained in:
2018-02-15 10:16:43 +00:00
committed by ubuntu
parent c3b882885f
commit f79a161179
2 changed files with 17 additions and 5 deletions

View File

@@ -47,6 +47,7 @@ ${federation_nodes}
Errors: This script will exit with the following error codes:
1 No arguments provided
2 Federation node is incorrect
3 Federation node role is incorrect
EOT
}
@@ -59,7 +60,20 @@ start_node() {
. ./settings.sh ${FEDERATION_NODE}
# Finally deploy the stack
case ${EXAREME_ROLE} in
manager)
# Wait for managers to have started
docker stack deploy -c docker-compose-${EXAREME_ROLE}.yml ${FEDERATION_NODE}
;;
worker)
# Start in the background the workers
docker stack deploy -c docker-compose-${EXAREME_ROLE}.yml ${FEDERATION_NODE} &
;;
*)
echo "Unknown node role!"
exit 3
;;
esac
)
}
@@ -169,7 +183,7 @@ then
if [ -z "${FEDERATION_NODE}" ]; then
echo "Invalid federation node name"
usage
exit 3
exit 2
fi
case ${FEDERATION_NODE} in
@@ -184,5 +198,3 @@ then
else
start_nodes $*
fi
exit 0

View File

@@ -58,7 +58,7 @@ stop_node() {
export FEDERATION_NODE
# Finally stop the stack
docker stack rm ${FEDERATION_NODE}
docker stack rm ${FEDERATION_NODE} &
)
}