MongoDB 3.4 Single Instance installation and preparation

Source: Internet
Author: User
Tags mongodb download

One, MongoDB download

Official: Https://www.mongodb.com/download-center#community

650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M02/9C/15/wKiom1lsJpnSu9JzAAE4f0an-f0304.png "title=" 11. PNG "style=" WIDTH:700PX;HEIGHT:419PX; "width=" "height=" 419 "border=" 0 "hspace=" 0 "vspace=" 0 "alt=" Wkiom1lsjpnsu9jzaae4f0an-f0304.png "/>

Users without Yueyu may download slowly, please fix it yourself

Second, the Environment configuration

Test system centos6.8 IP address: 192.168.1.197

1. Turn off SELinux

Vim/etc/selinux/config

Selinux=disabled


Setenforce 0

2. Turn off the firewall

Service Iptables Stop

3. Increase users and groups

Groupadd MongoDB && useradd-g MongoDB MongoDB

4, upload the binary package to/opt under the decompression and authorization

Cd/opt && tar-xf mongodb-linux-x86_64-rhel62-3.4.5.tgz

5. Create a soft connection

Ln-s/opt/mongodb-linux-x86_64-rhel62-3.4.5/usr/local/mongodb

6. Changing properties

Chown-r mongodb:mongodb/opt/mongodb-linux-x86_64-rhel62-3.4.5

Chown-r Mongodb:mongodb/usr/local/mongodb

7. Configure Environment variables


Echo ' Path=/usr/local/mongodb/bin: $PATH ' >>/etc/profile

Source/etc/profile

8. Create related catalogue

Mkdir-p/data/mongo/{db,log,tmp}

Mkdir-p/etc/mongodb

9. Create a MongoDB configuration file

Vim/etc/mongodb/mongo.conf


Storage

DbPath:/data/mongo/db

Journal

Enabled:true

Engine:wiredtiger

Systemlog:

Destination:file

Logappend:true

Path:/data/mongo/log/mongod.log

Processmanagement:

Fork:true # Fork and run in background

Pidfilepath:/data/mongo/tmp/mongod.pid

Net

port:27017

bindip:192.168.1.197,127.0.0.1

Security

Authorization:enabled

10. Authorization

Chown-r Mongodb:mongodb/data/mongo

Chown-r Mongodb:mongodb/etc/mongodb

11. Start MongoDB

Su-mongodb

Mongod--config/etc/mongodb/mongo.conf

#ps aux |grep MONGO

MongoDB 1649 0.6 1.1 1015552 46780? SLl 08:45 0:55/usr/local/mongodb/bin/mongod--config/etc/mongodb/mongo.conf

MongoDB 30100 0.0 0.0 103256 848 pts/0 s+ 11:08 0:00 grep MONGO


This article is from the "Linux-letian" blog, make sure to keep this source http://412166174.blog.51cto.com/3102369/1948147

MongoDB 3.4 Single Instance installation and preparation

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.