From 8e8f8a34109deb9f3d036a4a5a382e772f1aaa0e Mon Sep 17 00:00:00 2001 From: anishakj <43978302+anishakj@users.noreply.github.com> Date: Wed, 19 Aug 2020 19:47:27 +0530 Subject: [PATCH] Modifying zoo.cfg on rolling restarts (#231) Signed-off-by: anisha.kj --- docker/bin/zookeeperStart.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/docker/bin/zookeeperStart.sh b/docker/bin/zookeeperStart.sh index cbe65368f..a5ea0db29 100755 --- a/docker/bin/zookeeperStart.sh +++ b/docker/bin/zookeeperStart.sh @@ -144,14 +144,17 @@ fi ZOOCFGDIR=/data/conf export ZOOCFGDIR +echo Copying /conf contents to writable directory, to support Zookeeper dynamic reconfiguration if [[ ! -d "$ZOOCFGDIR" ]]; then - echo Copying /conf contents to writable directory, to support Zookeeper dynamic reconfiguration mkdir $ZOOCFGDIR cp -f /conf/zoo.cfg $ZOOCFGDIR - cp -f /conf/log4j.properties $ZOOCFGDIR - cp -f /conf/log4j-quiet.properties $ZOOCFGDIR - cp -f /conf/env.sh $ZOOCFGDIR +else + echo Copying the /conf/zoo.cfg contents except the dynamic config file during restart + echo -e "$( head -n -1 /conf/zoo.cfg )""\n""$( tail -n 1 "$STATIC_CONFIG" )" > $STATIC_CONFIG fi +cp -f /conf/log4j.properties $ZOOCFGDIR +cp -f /conf/log4j-quiet.properties $ZOOCFGDIR +cp -f /conf/env.sh $ZOOCFGDIR if [ -f $DYNCONFIG ]; then # Node registered, start server