You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# check and comment out journal: enabled: true in mongod.conf
121
+
CONF_FILE="/etc/mongod.conf"
122
+
if grep -qP '^\s*journal\s*:\s*$'"$CONF_FILE"&& grep -qP '^\s*enabled\s*:\s*true\s*$'"$CONF_FILE";then
123
+
echo"Commenting out journal: enabled: true in $CONF_FILE"
124
+
sed -i '/^\s*journal\s*:/ { N; s/\(.*\n\s*\)\(enabled\s*:\s*true\s*$\)/# \1# \2/ }'"$CONF_FILE"
125
+
else
126
+
echo"Could not find 'journal: enabled: true' in $CONF_FILE or it's already commented."
127
+
fi
128
+
129
+
#mongodb might need to be started
130
+
systemctl restart mongod ||echo"mongodb systemctl job does not exist"
131
+
132
+
#nc not available on latest centos
133
+
#until nc -z localhost 27017; do echo Waiting for MongoDB; sleep 1; done
134
+
mongosh --nodb --eval 'var conn; print("Waiting for MongoDB connection on port 27017. Exit if incorrect port"); var cnt = 0; while(!conn && cnt <= 300){try{conn = new Mongo("localhost:27017");}catch(Error){}sleep(1000);cnt++;}'
135
+
136
+
if [ "$isAuth"-eq"1" ];then
137
+
echo"run this command with authentication to upgrade to 7.0"
systemctl restart mongod ||echo"mongodb systemctl job does not exist"
122
+
123
+
#nc not available on latest centos
124
+
#until nc -z localhost 27017; do echo Waiting for MongoDB; sleep 1; done
125
+
mongosh --nodb --eval 'var conn; print("Waiting for MongoDB connection on port 27017. Exit if incorrect port"); var cnt = 0; while(!conn && cnt <= 300){try{conn = new Mongo("localhost:27017");}catch(Error){}sleep(1000);cnt++;}'
126
+
127
+
if [ "$isAuth"-eq"1" ];then
128
+
echo"run this command with authentication to upgrade to 8.0"
0 commit comments