MONGO Study notes (vi): Build on Linux

Source: Internet
Author: User

Linux is divided into the following units

192.68. 68.89:790192.68. 68.89:890192.68. 68.89:990192.68. 68.89:1090

1. Use SSH to move the mongodb-linux-x86_64-3.0.6.tgz to the Linux/root

2. Unzip to/root/mongodb-3.0.6/

Tar zxf mongodb-linux-x86_64-3.0. 6. tgz

3. Add the data and log folders

mkdir Datemkdir Log

4. Add Logs.log to the log folder

Touch Logs.log

5. Create a file/root/mongodb-3.0.6/mongodb.conf

6. Create a file/root/mongostar.sh put it anywhere.

777 mongostar.sh

7. Turn off MongoDB

Pkill MONGO

8. Check if MONGO is turned off

Ps-ef|grep MONGO

9. sharding

Log on to the Linux MONGOs
CD//root/mongodb-3.0. 6/bin. 27017 Mongosuse Admin
Db.runcommand ({addshard: "192.68.68.89:990"})
Db.runcommand ({addshard: "192.68.68.89:1090"})

Mongodb.conf

1.mongos

port=27017  #端口  logpath=/root/mongodb-3.0.  6/log/logs.log #日志文件存放目录  logappend=true  #使用追加的方式写日志  Fork=true #以守护程序的方式启用, that is, run  configdb=192.68in the background. 68.89:890 #config服务器地址

2.mongocfg

port=27017  #端口  dbpath=/root/mongodb-3.0.  6/data #数据文件存放目录  logpath=/root/mongodb-3.0.  6/log/logs.log #日志文件存放目录  logappend=true  #使用追加的方式写日志  Fork=true  #以守护程序的方式启用, which is running in the background configsvr=true #config服务器

3.mongod

port=27017  #端口  dbpath=/root/mongodb-3.0.  6/data #数据文件存放目录  logpath=/root/mongodb-3.0.  6/log/logs.log #日志文件存放目录  logappend=true  #使用追加的方式写日志  Fork=true #以守护程序的方式启用, which runs in the background

mongostar.sh

MONGOs
/root/mongodb-3.0.6/bin/mongos-f/root/mongodb-3.0.6/mongodb.conf
Other
/root/mongodb-3.0. 6/bin/mongod-f/root/mongodb-3.0. 6/mongodb.conf

MONGO Learning Note (vi): Build on Linux

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.