Skip to content

Commit

Permalink
fix: MongoDB does not receive signals when terminating pods. (#3990)
Browse files Browse the repository at this point in the history
  • Loading branch information
xuriwuyun authored Jun 27, 2023
1 parent 5ef506e commit 32a59d5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions deploy/mongodb/scripts/replicaset-setup.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ BACKUPFILE=$MONGODB_ROOT/db/mongodb.backup
if [ -f $BACKUPFILE ]
then
mongod --bind_ip_all --port $PORT --dbpath $MONGODB_ROOT/db --directoryperdb --logpath $MONGODB_ROOT/logs/mongodb.log --logappend --pidfilepath $MONGODB_ROOT/tmp/mongodb.pid&
until mongosh --quiet --port $PORT --host $host --eval "print('peer is ready')"; do sleep 1; done
until mongosh --quiet --port $PORT --host $host --eval "print('restore process is ready')"; do sleep 1; done
PID=`cat $MONGODB_ROOT/tmp/mongodb.pid`

mongosh --quiet --port $PORT local --eval "db.system.replset.deleteOne({})"
Expand All @@ -31,5 +31,5 @@ then
wait $PID
rm $BACKUPFILE
fi
mongod --bind_ip_all --port $PORT --replSet $RPL_SET_NAME --config /etc/mongodb/mongodb.conf

exec mongod --bind_ip_all --port $PORT --replSet $RPL_SET_NAME --config /etc/mongodb/mongodb.conf

0 comments on commit 32a59d5

Please sign in to comment.