diff --git a/components/node/files/scripts/start-node.sh b/components/node/files/scripts/start-node.sh index 55f9a13..f7564a5 100644 --- a/components/node/files/scripts/start-node.sh +++ b/components/node/files/scripts/start-node.sh @@ -81,12 +81,17 @@ else echo "Primary host is : ${primaryHost}, port: ${primaryPort}" currentHost=$(hostname -f) echo "Current host is : ${currentHost}" - if [ "${primaryHost}" != "${currentHost}" ]; then - echo "Not the primary, setting up as replica" - startPrimary=0 - else - echo "This is the primary" + if [ ${primaryHost} = "NULL" ]; then + echo "Not primary yet, starting as primary" startPrimary=1 + else + if [ "${primaryHost}" != "${currentHost}" ]; then + echo "Not the primary, setting up as replica" + startPrimary=0 + else + echo "This is the primary" + startPrimary=1 + fi fi fi