badtuxx / giropops-monitoring

Full stack tools for monitoring containers and other stuff. ;)
https://youtube.com/linuxtips
Apache License 2.0
1.33k stars 267 forks source link

Upgrade MongoDB image version #24

Closed strund3r closed 4 years ago

strund3r commented 4 years ago

Upgraded MongoDB image to version 3.4.23 because of the following error displayed on the Rocket.Chat log: rocketchat-error \ It wasn't possible to upgrade to the version 3.6 or greater because of the following problem:

IMPORTANT: UPGRADE PROBLEM: The data files need to be fully upgraded to version 3.4 before attempting an upgrade to 3.6; see http://dochub.mongodb.org/core/3.6-upgrade-fcv for more details.

\ One way to fix this problem is to do this: source

# starting from 3.2, down the containers and update your mongo version in docker-compose.yml
docker-compose -f /path/to/rocketchat/docker-compose.yml down
sed -i "s/mongo:3.2/mongo:3.4/g" /path/to/rocketchat/docker-compose.yml

# starting up the updated docker-compose.yml will pull new mongo image
docker-compose -f /path/to/rocketchat/docker-compose.yml up -d mongo

# this command will update the db to use the new version features
docker exec -it rocketchat_mongo_1 bash -c 'mongo --eval "db.adminCommand( { setFeatureCompatibilityVersion: "3.4" } )"'

# should see an output like this
{ "ok" : 1 }

# initialize rocketchat server to load new db features and update your data files
# not sure if this step necessary but I'm not taking any risks
docker-compose -f /path/to/rocketchat/docker-compose.yml up -d

# go back to step 1, change values, rinse and repeat!

\ \ According to the Rocket.Chat log, MongoDB 3.6 or greater will be necessary to run Rocket.Chat 4.0 \ rocketchat-warn