malaskowski / aet-docker

Docker support for AET - easy to set up local/developer environment with example Docker Swarm configuration.
Apache License 2.0
8 stars 8 forks source link

upgrade mongo to 3.6 #23

Closed malaskowski closed 4 years ago

malaskowski commented 4 years ago

Upgrading mongo image version to 3.6. Additionally updated docker swarm schema to 3.7.

Important: if you are upgrading AET from the version that used mongo 3.2, please read carefully upgrade notes before migrating.

Upgrade notes

  1. Backup your data!
  2. Upgrade to mongo image 3.4 first (set image: mongo:3.4 in aet-swarm.yml and deploy - docker stack deploy -c aet-swarm.yml aet). Wait until AET stack will be up.
  3. Assuming you have open port 27017 for mongo run:
    docker exec -it `docker ps --filter expose=27017/tcp -q` bash -c 'mongo --eval "db.adminCommand( { getParameter: 1, featureCompatibilityVersion: 1 } )"'

    This should say { "featureCompatibilityVersion" : "3.2", "ok" : 1 }.

  4. Set setFeatureCompatibilityVersion flag to 3.4 (read more in MongoDB upgrade notes), run:
    docker exec -it `docker ps --filter expose=27017/tcp -q` bash -c 'mongo --eval "db.adminCommand( { setFeatureCompatibilityVersion: \"3.4\" } )"'

    You should see: { "ok" : 1 }

  5. Upgrade to mongo image 3.6 (set image: mongo:3.6 in aet-swarm.yml and deploy - docker stack deploy -c aet-swarm.yml aet). Wait until AET stack will be up.
  6. Set setFeatureCompatibilityVersion flag to 3.6 (read more in MongoDB upgrade notes), run:
    docker exec -it `docker ps --filter expose=27017/tcp -q` bash -c 'mongo --eval "db.adminCommand( { setFeatureCompatibilityVersion: \"3.6\" } )"'

    You should see: { "ok" : 1 }

  7. You are good to go :).