Browse code

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

Davanum Srinivas authored on 2017/05/24 11:12:39
Showing 1 changed files
... ...
@@ -36,6 +36,11 @@ fi
36 36
 
37 37
 # start_etcd3() - Starts to run the etcd process
38 38
 function start_etcd3 {
39
+    # Don't install in sub nodes (multinode scenario)
40
+    if [ "$SERVICE_HOST" != "$HOST_IP" ]; then
41
+        return
42
+    fi
43
+
39 44
     _install_etcd
40 45
 
41 46
     local cmd="$ETCD_BIN_DIR/etcd"
... ...
@@ -62,10 +67,20 @@ function start_etcd3 {
62 62
 
63 63
 # stop_etcd3() stops the etcd3 process
64 64
 function stop_etcd3 {
65
+    # Don't install in sub nodes (multinode scenario)
66
+    if [ "$SERVICE_HOST" != "$HOST_IP" ]; then
67
+        return
68
+    fi
69
+
65 70
     $SYSTEMCTL stop $ETCD_SYSTEMD_SERVICE
66 71
 }
67 72
 
68 73
 function cleanup_etcd {
74
+    # Don't install in sub nodes (multinode scenario)
75
+    if [ "$SERVICE_HOST" != "$HOST_IP" ]; then
76
+        return
77
+    fi
78
+
69 79
     $SYSTEMCTL disable $ETCD_SYSTEMD_SERVICE
70 80
 
71 81
     local unitfile="$SYSTEMD_DIR/$ETCD_SYSTEMD_SERVICE"