/pcq/media/post_banners/wp-content/uploads/2015/02/Installing-MongoDB-on-CentOS-6.jpg)
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
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 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.
/pcq/media/post_attachments/wp-content/uploads/2015/02/step-cetn-2-1024x180.jpg)
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.
/pcq/media/post_attachments/wp-content/uploads/2015/02/step-cetn-4-1024x131.jpg)
Step 3: Install MongoDB: At this point, installing MongoDB is as simple as running the following command:
![]()
Step 4: If the installation goes well, it will prompt you with a “Is this ok
/pcq/media/post_attachments/wp-content/uploads/2015/02/step-new.jpg)
Step 5: Run MongoDB by using the following command:
![]()
You would see an output very similar to the following image:
/pcq/media/post_attachments/wp-content/uploads/2015/02/new-2.jpg)
Enter the MongoDB Command Line
You would see an output very similar to the following image:
/pcq/media/post_attachments/wp-content/uploads/2015/02/step-cetn-9-300x51.jpg)
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
/pcq/media/agency_attachments/2025/02/06/2025-02-06t100846387z-pcquest-new-logo-png.png)
Follow Us