How to upgrade mongodb online without affecting the normal operation of existing business?

problem description

the online version of mongodb is a little low, and some grammars don"t work. So I want to upgrade the next version, but I don"t have the experience of upgrading the version before. I"d like to ask for some relevant experience.

the main problem is that it can not affect the normal operation of online business.

Mar.30,2021

when each MongoDB version is launched, there is a Upgrade Notes, that guides you on how to upgrade from the previous version to the current version. For example:

if you read these documents carefully, almost every version of the upgrade process can be offline, because the three nodes of replica set can be upgraded in turn.
questions to pay attention to:

  1. you cannot skip version upgrades. For example, from 2.6 to 4.0, the upgrade path must be: 2.6-> 3.0-> 3.2-> 3.4-> 3.6-> 4.0;
  2. upgrade the driver before upgrading MongoDB, because the old driver is not compatible with the new version, but the new driver is certainly compatible with the old version.

if the online mongo is replicated. Can be adopted, first upgrade from the version. And then switch the master to the slave just now. Then upgrade the other replication sets to the primary node.

Menu