Advertisment

Installing MongoDB on CentOS 6

MongoDB is an open source, document-oriented database built to store large amounts of documents, typically required for Big Data applications.

author-image
Rajkumar Maurya
New Update
Installing MongoDB on CentOS 6

MongoDB is an open source, document-oriented database built to store large amounts of documents, typically required for Big Data applications. Let’s see how to install it

Advertisment

MongoDB is a NoSQL database intended for model other than the tabular format used in relational databases such as MySQL, PostgreSQL, and Microsoft SQL. MongoDB features include: full index support, replication, high availability, and auto-sharding.

Step 1: Add the MongoDB Repository to your CentOS machine by using the following command: storing large amounts of data in document-oriented storage with dynamic schemas. NoSQL refers to a database with a data

step cetn 1

Advertisment

Step 2:

Option A: If you are running a 64-bit system, add the following information to the repository file you've created in step 1 , using i to insert or edit . Then exit and save the file with the command :wq! and press Enter.

step cetn 2

Advertisment

Option B: If you are running a 32-bit system, add the following information to the file you’ve created, using i to insert. Then exit and save the file with the command :wq! and press Enter.

step cetn 4

Step 3: Install MongoDB: At this point, installing MongoDB is as simple as running the following command:

Advertisment

step cetn 5

Step 4: If the installation goes well, it will prompt you with a “Is this ok ” message. Enter ‘y’ and hit ‘Enter’ if the installation was successful as follows:

step new

Advertisment

Step 5: Run MongoDB by using the following  command:

new 3

You would see an output very similar to the following  image:

Advertisment

new 2

Enter the MongoDB Command Line

new5
Advertisment

 You would see an output very similar to the following image:

step cetn 9

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 want to connect to a local

MongoDB server listening on port 22222, then issue the

following command:

mongo —port 22222

port 22222

Shutdown MongoDB

service mongod stop

service stop

linux database opensource
Advertisment