Aliyun CentOS7 installation Mongodb tutorial

  • 2020-06-03 08:42:32
  • OfStack

1. An overview of the

Recently, when Installing MongoDB on the new CentOS system, I got the download link for version 3.2 directly from the Mongo website. However, I found the download was woefully slow. Forced to find the only domestic mirror download. After switching the installation source in China and using yum, it was found that the version of MongoDB installed was 2.8. After 1 study, the following operation methods are posted for future operation.

2. Operation process

1, first update 1 pack, more harmless.

sudo yum -y update

2, in/etc yum. repos. Create a mongodb d - org. repo file

sudo touch /etc/yum.repos.d/mongodb-org.repo

3. Edit mongodb-ES31en. repo file

sudo vi /etc/yum.repos.d/mongodb-org.repo

4. Save and exit after entering the following contents


[mongodb-org]
name=MongoDB Repository
baseurl=http://mirrors.aliyun.com/mongodb/yum/redhat/7Server/mongodb-org/3.2/x86_64/
gpgcheck=0
enabled=1

5. Install MongoDB

sudo yum install -y mongodb-org

6. Start MongoDB

sudo service mongod start

7. Set startup

sudo chkconfig mongod on

8. Open MongoDB

sudo /bin/mongo

9. Configure remote access

Edit/etc/mongod conf

Annotation bindIp: 127.0.0.1

restart sudo service mongod restart

3. Afterword.

As long as the speed is not too slow you can download the official source code and then compile the installation, or refer to the official version of the installation tutorial.


Related articles: