MongoDB 4.0 upgrade to 4.4

Before you post: Your responses to these questions will help the community help you. Please complete this template if you’re asking a support question.
Don’t forget to select tags to help index your topic!

1. Describe your incident:
We are running a Graylog 4.3 instances and we want to upgrade to Graylog 5. Reading the procedures and requirements we observe that is needed to upgrade MongoDb to 4.4 first.

When we try to upgrade MongoDB to 4.4 we went through the documentation and realize that first is necessary to install 4.2 and then 4.4. The problem is we couldn’t upgrade to 4.2 because ubuntu apt didn’ t find because EOL of 4.2

2. Describe your environment:

  • OS Information:
    Ubuntu 20.04 (upgraded from appliance latest OVA graylog)
    Kernel: Linux 5.4.0-139-generic

  • Package Version:
    Graylog 4.3.12
    graylog-enterprise-integrations-plugins 4.3.12-1
    graylog-enterprise-plugins 4.3.12-1
    graylog-integrations-plugins 4.3.12-1
    graylog-server 4.3.12-1
    mongodb-org 4.0.28
    openjdk version 1.8.0_352 (ver. 8)

  • Service logs, configurations, and environment variables:

3. What steps have you already taken to try and solve the problem?

We tried to install mongodb-org 4.2 adding the key to the OS and then apt update but couldn’t find anything.

Then we made a mongodump and tried to install mongodb-org 4.4 via apt package manager. When we check version via dpkg --list we observ that only mongodb-org package was in version 4.4 and the others (mongodb-org-tools, mongodb-org-server, mongodb-org-shell) remains in 4.0. If we try to install all of them manually via apt then mongo doesn’t start.

systemctl status mongod.services showed: "Environment variable MONGODB_CONFIG_OVERRIDE_NOFORK == 1, overriding "processManagement.fork" to false

Today we are going to test uninstallig 4.0 (backing up all mongo data) and try to install 4.4 through apt and then use mongorestore.

4. How can the community help?

If there are some procedure or any help, we will be really gratefully

Helpful Posting Tips: Tips for Posting Questions that Get Answers [Hold down CTRL and link on link to open tips documents in a separate tab]

The most recent version of ubuntu server that i can find mongodb packages for is 18.04 (bionic).

However, i just tested installing this package on Ubuntu 20.04 (Focal) and i didn’t get any complaints/errors and appears to have worked. Your mileage may vary.

lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 20.04.4 LTS
Release:	20.04
Codename:	focal
curl -fsSL https://pgp.mongodb.com/server-4.2.asc | \
   sudo gpg -o /usr/share/keyrings/mongodb-server-4.2.gpg \
   --dearmor

echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-4.2.gpg ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.2.list

sudo apt-get update

sudo apt-get install -y mongodb-org
mongo --eval "db.version()" --quiet
4.2.24

Hey @drewmiranda-gl, really thank you so much!

We have upgraded our mongodb following what you wrote.

We use also this documentation

Standalone MongoDB

So following your steps we arrived to mongodb 4.2 without any problems. Then we tried to go to 4.4.24 using the same procedure and documentation from mongodb official.

curl -fsSL https://pgp.mongodb.com/server-4.4.asc | sudo gpg -o /usr/share/keyrings/mongodb-server-4.4.gpg --dearmor

Then we changed to focal because our ubuntu 20.
echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-4.4.gpg ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list

Then:
sudo apt-get update
sudo apt-get install mongodb-org
sudo apt-get install mongodb-org-mongos mongodb-org-server mongodb-org-shell mongodb-org-tools

Here we had a little issue

Errors were encountered while processing:
/tmp/apt-dpkg-install-Afo4lq/0-mongodb-org-database-tools-extra_4.4.24_amd64.deb

that was fixed using:

sudo apt install –-fix-broken


So the only question we have is when we issue systemctl status mongo service we observe the following line:

Sep 12 14:54:46 graylog mongod[3027]: {“t”:{“$date”:“2023-09-12T17:54:46.283Z”},“s”:“I”, “c”:“CONTROL”, “id”:7484500, “ctx”:“main”,“msg”:“Environment variable MONGODB_CONFIG_OVERRIDE_NOFORK == 1, overriding "processManagement.fork" to false”}

We would like to know what is this environment variable for?
Is there any way to get rid of this?

I see this environment variable in /lib/systemd/system/mongod.service

THANK YOU!!

1 Like

From what I can tell this is normal and expected. Is it causing you issues?

I found the commit that added it via SERVER-74845 Override processManagement.fork in mongod.service · mongodb/mongo@26b4106 · GitHub

which links to https://jira.mongodb.org/browse/SERVER-74845

Create mechanism to ignore ignore fork option with systemd

As long as mongo is running and you can connect with an app or mongosh you should be good to go.

Thank you for your response. I have read the sites you sent. Was usefull

Now we are moving to mongodb 5.0. Wish us luck.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.