From d8283fde660bee2d4a5f639197a6a7010988b269 Mon Sep 17 00:00:00 2001 From: Davanum Srinivas Date: Tue, 23 May 2017 22:12:39 -0400 Subject: [PATCH] Avoid installing etcd3 in subnodes We need to handle this better, for now, just don't install etcd in the sub nodes. We need to setup the proper clustering mechanism if we want to have etcd3 running in multiple nodes Change-Id: I8dd385e3c993942473e67d04367cdf74495dbeef --- lib/etcd3 | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/lib/etcd3 b/lib/etcd3 index fa60a392c9..2a4fa2a6af 100644 --- a/lib/etcd3 +++ b/lib/etcd3 @@ -36,6 +36,11 @@ fi # start_etcd3() - Starts to run the etcd process function start_etcd3 { + # Don't install in sub nodes (multinode scenario) + if [ "$SERVICE_HOST" != "$HOST_IP" ]; then + return + fi + _install_etcd local cmd="$ETCD_BIN_DIR/etcd" @@ -62,10 +67,20 @@ function start_etcd3 { # stop_etcd3() stops the etcd3 process function stop_etcd3 { + # Don't install in sub nodes (multinode scenario) + if [ "$SERVICE_HOST" != "$HOST_IP" ]; then + return + fi + $SYSTEMCTL stop $ETCD_SYSTEMD_SERVICE } function cleanup_etcd { + # Don't install in sub nodes (multinode scenario) + if [ "$SERVICE_HOST" != "$HOST_IP" ]; then + return + fi + $SYSTEMCTL disable $ETCD_SYSTEMD_SERVICE local unitfile="$SYSTEMD_DIR/$ETCD_SYSTEMD_SERVICE"