Watch keynotes and sessions from MongoDB.live, our virtual developer conference.

Automated upgrading of MongoDB deployments

We have recently been having a lot of struggle finding a good way to automatically upgrade an existing mongo database across multiple major versions. Due to time constraints the short term emergency solution seems to be to pin the MongoDB version. But this is not a long term solution. Are there any thoughts or plans regarding MongoDB’s ability to move across multiple major versions in one update? The system we are working on is a distributed system, with alot of servers involved, so manually stepping through rolling updates is not an option. Nor can one assume all the servers are on the same version at the same time, or that all servers are passing through all versions along the way (i.e. a server could be updated from a previous version to the next version without stepping through the current version, if this makes any sense).

Any thoughts or suggestions are much appreciated.

Hi @LostNotFound,

Upgrading can definitely be a challenge, particularly if you have multiple successive major versions to upgrade through.

Rather than performing manual upgrades or relying on O/S packages (which often don’t have a smooth upgrade path) I would use MongoDB-aware tooling. Upgrading a distributed database deployment with minimal downtime requires some coordination, but is certainly possible to automate.

There are three main options developed by MongoDB:

  • MongoDB Cloud Manager - monitoring, automation, and backup for self-hosted deployments. Cloud Manager uses an agent-based approach and is a freemium service (basic monitoring is free, automation requires a per server subscription, and backup is pay for use). If cloud-based agents are an option for your deployment, there’s a 30-day trial if you want to try out the automation features. Cloud Manager automation can handle upgrading or downgrading the versions of deployments, although typically you have to be starting from a supported (non End-of-Life) version of MongoDB server.

  • MongoDB Ops Manager - the on-premise version of Cloud Manager, which is part of a MongoDB Enterprise Advanced subscription. With Ops Manager you are responsible for setting up and managing all infrastructure for on-premise management of automation, backup, and monitoring.

  • MongoDB Atlas - fully managed MongoDB-as-a-service with upgrades managed via the Atlas UI or API. Atlas also has a live import feature which can be handy for migrating from an older version of MongoDB to a supported version. For example, you can live migrate from MongoDB 2.6 to 4.2.

There some other solutions that build on the above APIs, such as the Enterprise Operator for Kubernetes and the Atlas Open Service Broker. There are also various third party tooling & scripts which may be helpful depending on your environment and the types of deployments you manage.

What types of deployments are you managing (standalone, replica set, or sharded cluster) and how are you currently automating upgrades? Are you using any automation or orchestration tooling (for example: Ansible, Chef, Puppet, Salt, Terraform, … )?

Regards,
Stennie

1 Like