I just upgraded one of my replica set nodes to MongoDB 5.0 from 4.4, but it’s still reporting the previous version after restart.
I’m on CentOS 7, and I must have messed up something to do with the repo data.
This is what I did:
I added the 5.0 repo data, so I have this in /etc/yum.repos.d/mongodb.repo
[mongodb-org-4.4]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/4.4/x86_64/
gpgcheck=1
enabled=0
gpgkey=https://www.mongodb.org/static/pgp/server-4.4.asc
[mongodb-org-5.0]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/5.0/x86_64/
gpgcheck=1
enabled=0
gpgkey=https://pgp.mongodb.com/server-5.0.asc
(I left the 4.4 lines in the file, because the current version is/was 4.4. I don’t know if this makes a difference).
I did a graceful shutdown of the replica set member, then ran the upgrade like so:
yum --enablerepo mongodb-org-5.0 update mongodb-org
Yum reported to be updating to 5.0.23 and looking at yum info mongodb-org
now it all looks good. I see this:
Name : mongodb-org
Arch : x86_64
Version : 5.0.23
Release : 1.el7
Size : 0.0
Repo : installed
From repo : mongodb-org-5.0
But the server still reports version 4.4. I can see this when I connect from the shell, and when checking the binary’s version:
$ mongod --version
db version v4.4.4
Build Info: {
"version": "4.4.4",
"gitVersion": "8db30a63db1a9d84bdcad0c83369623f708e0397",
...
What am I missing?
Update: I’ve just noticed that the mongodb-org-server
package shows as being installed from the old 4.4 repo, although to the best of my knowledge I installed it via the mongodb-org
metapackage, which still states it includes the server. I will try upgrading mongodb-org-server
and see if this fixes it.