I tried to upgrade from Community Edition 4.2.8 to Enterprise Edition 4.4 by replacing the existing binaries as described here.
MongoDB shell version was updated to v4.4.0, but MongoDB server version is still 4.2.8. How can I solve this?
I tried to upgrade from Community Edition 4.2.8 to Enterprise Edition 4.4 by replacing the existing binaries as described here.
MongoDB shell version was updated to v4.4.0, but MongoDB server version is still 4.2.8. How can I solve this?
mongod --version
to check.db.adminCommand( { setFeatureCompatibilityVersion: "4.4" } )
Thank you, Maxime !
Yes
It works and I get this response.
db version v4.4.0
Build Info: {
“version”: “4.4.0”,
“gitVersion”: “563487e100c4215e2dce98d0af2a6a5a2d67c5cf”,
“modules”: [
“enterprise”
],
“allocator”: “system”,
“environment”: {
“distarch”: “x86_64”,
“target_arch”: “x86_64”
}
}
{
“ok” : 0,
“errmsg” : "Invalid command argument. Expected ‘4.2’ or ‘4.0’, found 4.4 in: { setFeatureCompatibilityVersion: “4.4”, lsid: { id: UUID(“39820014-601d-4a26-a816-51adac01dc04”) }, $db: “admin” }. See https://docs.mongodb.com/manual/release-notes/4.2-compatibility/#feature-compatibility.",
“code” : 2,
“codeName” : “BadValue”
}
Well if you are still running the server in 4.2.8 it’s because the 4.2.8 binary is still installed somewhere in your computer and when you are starting the mongod
process, you are not using the binary 4.4.0 binary you just installed.
I would suggest the following to find the hidden binary:
$ ps aux | grep mongod
999 56703 1.3 0.7 1903520 123556 ? Ssl 02:12 0:02 mongod --replSet=test --bind_ip_all
polux 57291 0.0 0.0 6244 660 pts/1 S+ 02:15 0:00 grep --color=auto mongod
In my exemple, it’s 56703 here.
$ sudo ls -l /proc/56703/exe
[sudo] password for polux:
lrwxrwxrwx 1 999 docker 0 Sep 9 02:12 /proc/56703/exe -> /usr/bin/mongod
Then I bet if you take this path and check the version, you will probably get 4.2.8.
/usr/bin/mongod --version
I did this little test with a mongod
running in Docker but I’m guessing you installed MongoDB using the package manager of your system and I guess you are not running the binary you think you are running.
Please make sure to make a backup of your database before you upgrade - just in case !
I can identify PID, but the second step does not find anything. After entering my password, it says ls: ./proc/<PID>/exe: No such file or directory
Which OS are you using? Maybe it’s slightly different from my Debian. What do you have in the /proc/<PID>/
folder?
Also I see you have an extra “dot” in your error, are in sure you are pointing to the right file?
It’s $ sudo ls -l /proc/<PID>/exe
.
Not $ sudo ls -l ./proc/<PID>/exe
.
macOS Catalina. I can’t find /proc
. I tried both /proc
and ./proc
after your previous message, and happened to copy the error message with a dot.
Ohh that’s not Linux my friend! I never touched a Mac in my life so I won’t do any better than Google on this one I guess.
If you see that your mongod is still running in 4.2.8, that’s because 4.2.8 is installed somewhere in your computer and it’s the one that you are starting.
Maybe you can find this binary with find
?
$ find / -name "mongod" 2> /dev/null
/home/polux/Softwares/mongodb-linux-x86_64-enterprise-debian10-4.2.8/bin/mongod
/home/polux/Softwares/mongodb-linux-x86_64-enterprise-debian10-4.4.0/bin/mongod
That’s where I install MongoDB in my PC but maybe you have 4.2.8 that was installed with MacOS package manager and 4.4.0 installed manually?
How do you start the “mongod” process?
I only find 4.4.0 with this command. Both were installed with package manager. I simply type mongod
to start.
I don’t know why, but community server 4.4.0 does not get the same problem as the enterprise server. I’ll stay with community for now.
Topic | Replies | Views | Activity |
---|---|---|---|
MongoDB Kafka Connector Sink Fails, Source works | 3 | 886 | May 2024 |
Run mongodb from a read-only storage device? | 5 | 388 | Jul 2024 |
mongosh: disable creation of ~/.mongodb/mongosh | 0 | 353 | Aug 2024 |
Install MongoDB Community on Windows using msiexec.exe | 1 | 224 | Aug 2024 |
Does MongoDB 7.0 really drop Windows 10 support? | 0 | 121 | Sep 2024 |