Install MongoDB on Fedora 24

Aug 4 • All • 3629 Views • 2 Comments on Install MongoDB on Fedora 24

The steps to install MongoDB on Fedora 24 is pretty simple.

 

First, login to the server as root user.

Then, we should add the repository to download the package. Open a new repo file ‘mongodb.repo’ using below command.

root@fedora # vi /etc/yum.repos.d/mongodb.repo

Option A: If you are running a 64-bit system, add the following information to the file you’ve created, using i to insert:

[mongodb]

name=MongoDB Repository

baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64/

gpgcheck=0

enabled=1

Then exit and save the file with the command :wq.

Option B: If you are running a 32-bit system, add the following information to the file you’ve created, using i to insert:

[mongodb]

name=MongoDB Repository

baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/i686/

gpgcheck=0

enabled=1

Then exit and save the file with the command :wq .

Once you have done this, installing MongoDB is now one command away.

dnf install mongodb-org mongodb-org-server

Now you should get output similar to below. When rompted with Y / n, enter yes or y to download and install the package

[root@fedora]# dnf install mongodb-org mongodb-org-server

Last metadata expiration check: 0:00:17 ago on Thu Aug 4 19:34:04 2016.

Dependencies resolved.

======================================================================================================================================================

Package Arch Version Repository Size

======================================================================================================================================================

Installing:

mongodb-org x86_64 2.6.12-1 mongodb 4.6 k

mongodb-org-mongos x86_64 2.6.12-1 mongodb 6.9 M

mongodb-org-server x86_64 2.6.12-1 mongodb 9.1 M

mongodb-org-shell x86_64 2.6.12-1 mongodb 4.3 M

mongodb-org-tools x86_64 2.6.12-1 mongodb 90 M


Transaction Summary

======================================================================================================================================================

Install 5 Packages


Total size: 110 M

Installed size: 279 M

Is this ok [y/N]:

Once installed,

Start-Up MongoDB

[root@fedora]#systemctl start mongod

Check MongoDB Service Status

[root@fedora]#systemctl status mongod

Start the MongoDB Service at Boot

[root@fedora]#systemctl enable mongod

Summary List of Status Statistics (Continuous)

[root@fedora]#mongostat

Summary List of Status Statistics (5 Rows, Summarized Every 2 Seconds)

[root@fedora]#mongostat –rowcount 5 2

Enter the MongoDB Command Line

[root@fedora]#mongo

By default, running this command will look for a MongoDB server listening on port 27017 on the localhost interface.

If you’d like to connect to a MongoDB server running on a different port, then use the –port option. For example, if you wanted to connect to a local MongoDB server listening on port 23456, then you’d issue the following command:

[root@fedora]#mongo –port 23456

Shutdown MongoDB

[root@fedora]#systemctl stop mongod

Related Posts

2 Responses to Install MongoDB on Fedora 24

  1. bob otter says:

    To get the latest mongodb
    baseurl=https://repo.mongodb.org/yum/redhat/7/mongodb-org/3.4/x86_64/

Leave a Reply

Your email address will not be published. Required fields are marked *

« »