This repository was archived by the owner on Aug 1, 2024. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -227,7 +227,7 @@ services:
227227 command : mongod --nojournal --storageEngine wiredTiger
228228 container_name : " edx.${COMPOSE_PROJECT_NAME:-devstack}.mongo"
229229 hostname : mongo.devstack.edx
230- image : mongo:${MONGO_VERSION:-4.2.14 }
230+ image : mongo:${MONGO_VERSION:-4.4.18 }
231231 networks :
232232 default :
233233 aliases :
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+ set -eu -o pipefail
3+
4+ # This script will upgrade a devstack that was previosly running Mongo DB 4.0 to MongoDB 4.0
5+
6+ . scripts/colors.sh
7+
8+ # Upgrade to mongo 4.4
9+ export MONGO_VERSION=4.4.18
10+
11+ echo
12+ echo -e " ${GREEN} Restarting Mongo on version ${MONGO_VERSION}${NC} "
13+ make dev.up.mongo
14+ mongo_container=" $( make --silent --no-print-directory dev.print-container.mongo) "
15+
16+ echo -e " ${GREEN} Waiting for MongoDB...${NC} "
17+ until docker exec " $mongo_container " mongo --eval ' db.serverStatus()' & > /dev/null
18+ do
19+ printf " ."
20+ sleep 1
21+ done
22+
23+ echo -e " ${GREEN} MongoDB ready.${NC} "
24+ MONGO_VERSION_LIVE=$( docker exec -it " $mongo_container " mongo --quiet --eval " printjson(db.version())" )
25+ MONGO_VERSION_COMPAT=$( docker exec -it " $mongo_container " mongo --quiet \
26+ --eval " printjson(db.adminCommand( { getParameter: 1, featureCompatibilityVersion: 1 } )['featureCompatibilityVersion'])" )
27+ echo -e " ${GREEN} Mongo Server version: ${MONGO_VERSION_LIVE}${NC} "
28+ echo -e " ${GREEN} Mongo FeatureCompatibilityVersion version: ${MONGO_VERSION_COMPAT}${NC} "
29+
30+ if echo " ${MONGO_VERSION_COMPAT} " | grep -q " 4\.2" ; then
31+ echo -e " ${GREEN} Upgrading FeatureCompatibilityVersion to 4.4${NC} "
32+ docker exec -it " $mongo_container " mongo --eval " db.adminCommand( { setFeatureCompatibilityVersion: \" 4.4\" } )"
33+ else
34+ echo -e " ${GREEN} FeatureCompatibilityVersion already set to 4.4${NC} "
35+ fi
You can’t perform that action at this time.
0 commit comments