Mongodb on debian10

Hello,
I installed a Mongodb 4.2.7 database a while ago on a Debian 10 server (buster).
I would like to run security updates on this debian server with an “apt update” and an “apt upgrade”.
Are there any special precautions to be taken with mongodb?

Thanks in advance

Hi @GuiVERO_VeroGui and welcome in the MongoDB Community :muscle: !

MongoDB 4.2 supports Debian 10. See Production Notes — MongoDB Manual

So you should be fine with the latest version of Debian 10. The latest 4.2.X version is 4.2.14 though. So while you are at it, you could also update MongoDB and eventually upgrade to 4.4.X.

If you have to reboot your server after your updates, I would do a graceful shutdown of MongoDB, just to be on the safe side.

I’m currently running the latest 4.4.6 on Debian 11 and I don’t have any issues.

Cheers,
Maxime.

Thank you for your reply.
I don’t want to change the version of mongodb but just do the server security updates.
Can these security updates cause the mongodb database to malfunction?

MongoDB has very little system dependencies as far as I know.

Source: https://docs.mongodb.com/manual/tutorial/install-mongodb-on-debian-tarball/#install-mongodb-community-edition

libcurl4 openssl liblzma5

And I guess these 3 have a few subdependencies.
If you don’t anticipate any incredible update on these, you should be safe I guess.

In doubt, run a full backup before you do anything. And you will perform your update/upgrade in a rolling manner on your replica set I guess so if you have a problem while doing this operation on the first secondary, it shouldn’t be too hard to fix the problem and your production environment won’t be impacted as long as the other secondary and primary are still up and running.

The basic update method with zero downtime is:

  • shutdown one secondary
  • update it
  • restart it
  • check it’s back in the replica set and the rs.status() is fine.
  • repeat these operations for the second secondary node.
  • force the primary to step down: rs.stepDown().
  • the former primary is now a secondary and the new primary is one of the 2 secondaries.
  • repeat the first 4 steps for the last node.
  • your 3 nodes are now up-to-date.

Cheers,
Maxime.

By the way, you should have a look to MongoDB Atlas because these kind of troubles don’t exist in Atlas :wink: ! It’s fully automated for you.