0% found this document useful (0 votes)
431 views5 pages

Upgrade mongoDB Server From 4.0.19 To 4.2.8

This document provides instructions for upgrading a MongoDB server from version 4.0.19 to 4.2.8. It describes downloading the 4.2.8 software, replacing the 4.0 binaries, checking the feature compatibility version, stopping and restarting the daemon process using the 4.2 binaries, enabling 4.2 features and setting the feature compatibility version to 4.2, and validating the upgrade.

Uploaded by

Ravindra Malwal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
431 views5 pages

Upgrade mongoDB Server From 4.0.19 To 4.2.8

This document provides instructions for upgrading a MongoDB server from version 4.0.19 to 4.2.8. It describes downloading the 4.2.8 software, replacing the 4.0 binaries, checking the feature compatibility version, stopping and restarting the daemon process using the 4.2 binaries, enabling 4.2 features and setting the feature compatibility version to 4.2, and validating the upgrade.

Uploaded by

Ravindra Malwal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

mongoDB

4.0 Hands-on

RAVINDRA MALWAL
Topic: Upgrade mongoDB server from 4.0.19 to 4.2.8
In this QuickStart, we learn how to:

• Download mongoDB 4.2.8 software and unzip


• Replace existing 4.0 binaries with the 4.2 binaries
• Feature Compatibility Version
• Stop and Start daemon process using 4.2 binaries
• Enable the 4.2 features, set the feature compatibility version (FCV) to 4.2
• Validation

1] Download mongoDB 4.2.8 software and unzip the tar bundle

https://www.mongodb.com/try/download/enterprise

- Create directory to unzip 4.2.8 binary

[mongod@localhost mongoDB]$ mkdir 4.2.8


[mongod@localhost mongoDB]$ pwd
/u02/mongoDB
[mongod@localhost mongoDB]$ cd 4.2.8
[mongod@localhost 4.2.8]$ pwd
/u02/mongoDB/4.2.8
[mongod@localhost 4.2.8]$

- Unzip the tar bundle

[mongod@localhost tmp]$ tar -xvzf mongodb-linux-x86_64-rhel62-


4.2.8.tgz -C /u02/mongoDB/4.2.8/
mongodb-linux-x86_64-rhel62-4.2.8/THIRD-PARTY-NOTICES.gotools
mongodb-linux-x86_64-rhel62-4.2.8/README
mongodb-linux-x86_64-rhel62-4.2.8/THIRD-PARTY-NOTICES
mongodb-linux-x86_64-rhel62-4.2.8/MPL-2
mongodb-linux-x86_64-rhel62-4.2.8/LICENSE-Community.txt
mongodb-linux-x86_64-rhel62-4.2.8/bin/mongodump
mongodb-linux-x86_64-rhel62-4.2.8/bin/mongorestore
mongodb-linux-x86_64-rhel62-4.2.8/bin/mongoexport
mongodb-linux-x86_64-rhel62-4.2.8/bin/mongoimport
mongodb-linux-x86_64-rhel62-4.2.8/bin/mongostat
mongodb-linux-x86_64-rhel62-4.2.8/bin/mongotop
mongodb-linux-x86_64-rhel62-4.2.8/bin/bsondump
mongodb-linux-x86_64-rhel62-4.2.8/bin/mongofiles
mongodb-linux-x86_64-rhel62-4.2.8/bin/mongoreplay
mongodb-linux-x86_64-rhel62-4.2.8/bin/mongod
mongodb-linux-x86_64-rhel62-4.2.8/bin/mongos
mongodb-linux-x86_64-rhel62-4.2.8/bin/mongo
mongodb-linux-x86_64-rhel62-4.2.8/bin/install_compass
[mongod@localhost tmp]$

2] Replace existing 4.0 binaries with the 4.2 binaries

- Set path for new mongoDB 4.2.8 home in bash_profile

[mongod@localhost ~]$ cat .bash_profile


# .bash_profile

# Get the aliases and functions


if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/.local/bin:$HOME/bin
export PATH=/u02/mongoDB/4.2.8/mongodb-linux-x86_64-rhel62-
4.2.8/bin:$PATH
export MONGO_HOME=/u02/mongoDB/4.2.8/mongodb-linux-x86_64-rhel62-4.2.8
export PATH
[mongod@localhost ~]$

3] check Feature Compatibility Version

- Connect admin database check featureCompatibilityVersion

> use admin


switched to db admin
> db.adminCommand( { getParameter: 1, featureCompatibilityVersion: 1 }
)
{ "featureCompatibilityVersion" : { "version" : "4.0" }, "ok" : 1 }
>
3] Stop and Start daemon process using 4.2 binaries

- Login to mongoDB server and shutdown the server.

> use admin


switched to db admin
> db.shutdownServer()
2020-06-29T18:25:47.306-0500 I NETWORK [js] DBClientConnection
failed to receive message from 127.0.0.1:27017 - HostUnreachable:
Connection closed by peer
server should be down...
2020-06-29T18:25:47.320-0500 I NETWORK [js] trying reconnect to
127.0.0.1:27017 failed
2020-06-29T18:25:47.320-0500 I NETWORK [js] reconnect
127.0.0.1:27017 failed failed
> exit

- Start daemon Service using new binaries

[mongod@localhost appdb]$ mongod -f /u02/DATA/appdb/mongod.conf


about to fork child process, waiting until server is ready for
connections.
forked process: 4792
child process started successfully, parent exiting

4] Enable the 4.2 features, set the feature compatibility version (FCV) to 4.2

- Login to database
-
[mongod@localhost appdb]$ mongo --host "127.0.0.1:27017" -u "admin" -p
"Admin1234" --authenticationDatabase "admin"
MongoDB shell version v4.2.8
connecting to:
mongodb://127.0.0.1:27017/?authSource=admin&compressors=disabled&gssap
iServiceName=mongodb
Implicit session: session { "id" : UUID("09d49e25-fccb-489a-85ad-
aafb8dae248d") }
MongoDB server version: 4.2.8
>
> use admin
switched to db admin
> db.adminCommand( { setFeatureCompatibilityVersion: "4.2" } )

{ "ok" : 1 }
>
>
> db.adminCommand( { getParameter: 1, featureCompatibilityVersion: 1 }
)

{ "featureCompatibilityVersion" : { "version" : "4.2" }, "ok" : 1 }


>

5] Validation:

> db.version()
4.2.8
>

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy