MongoDB Replica Set Configuration series one: Installing MongoDB

Source: Internet
Author: User
Tags connect mongo win32

1: Download MongoDB 2.6 version

Https://fastdl.mongodb.org/win32/mongodb-win32-x86_64-2008plus-2.6.9.zip

2: Unzip

TAR-ZXVF Mongodb-linux-x86_64-2.6.9.zip
MV mongodb-linux-x86_64-2.6.9 MongoDB

  

3: Create data directory and log directory and conf configuration file in MongoDB directory

Both data and log directories are guaranteed to have read and write access

4: Edit config file vi mongo.conf

Add logappend=true# to the =/root/software/mongodb/log/mongod# Data Catalog dbpath=/root/software/mongodb/data# log in Append mode #日志目录logpath Turn on background process run fork = true# Port = 27017

  

5: Start the Mongod with the configuration file

./bin/mongod--config mongo.conf

6: Connect MONGO

7: Add user name and password

Db.adduser ("Gechong", "password")

Certified Users:

Db.auth ("Gechong", "password") 1

View User

Db.auth ("Gechong", "password") 1

Add a user with read and write permissions to the test library

> Use testswitched to DB test >db.adduser ("GE", "password") warning:the ' addUser ' shell Helper is DEPRECATED. Please use ' createUser ' insteadsuccessfully added User: {"user": "GE", "Roles": ["Dbowner"]}

  

Add a read-only client to the test library

Db.adduser ("Geread", "password", true)

  

Remove Invalid User

Db.system.users.remove ({User: "Geread"})

 

Next Blog: http://www.cnblogs.com/xiaoit/p/4478951.html

MongoDB Replica Set Configuration series one: Installing MongoDB

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.