Tutorial on installing mongoDB database in yum under centos on a single node, centosmongodb

Source: Internet
Author: User

Tutorial on installing mongoDB database in yum under centos on a single node, centosmongodb

MongoDB deployment uses replica set + sharding to achieve high load. However, in actual testing, sometimes you only need to install a single mongodb for testing.

Below is a single mongoDB deployed under centos7.

1. Configure the package management system (I have installed the latest version 3.4)

sudo yum install -y mongodb-org

Enter the following configuration in the file:

[mongodb-org-3.4]name=MongoDB Repositorybaseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.4/x86_64/gpgcheck=1enabled=1gpgkey=https://www.mongodb.org/static/pgp/server-3.4.asc

ThenWq!Write and exit

2. Download and install mongodb3.4 from yum

sudo yum install -y mongodb-org
Then wait for the installation package to be downloaded and installed

Then go to the mongo configuration file.

Vim/etc/mongod. conf

Modify the bindIp in net: 0.0.0.0 (you can Baidu for the reason)

3. Start

sudo service mongod start

4. view the mongodb process.

ps -ef | grep mongodb

If the following information is displayed, mongo is up. Use the default port 27017 (Changeable)

5. Test the connection

Enter mongo -- port 27017 in any location in linux

The connection is successful!

Note: The old version and new version of mongo are different. We recommend that you use the latest mongo version.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.