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
This commit is contained in:
Davanum Srinivas 2017-05-23 22:12:39 -04:00
parent 08de346d03
commit d8283fde66
1 changed files with 15 additions and 0 deletions

View File

@ -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"