CentOS MONGO Database Setup

Source: Internet
Author: User

1. wget https://fastdl.mongodb.org/linux/mongodb-linux-i686-2.6.7.tgz?_ga=1.68265944.858401362.1421216907//download
    1. TAR-ZXVF mongodb-linux-i686-2.6.7.tgz\?_ga\=1.68265944.858401362.1421216907//Decompression
    2. MV mongodb-linux-i686-2.6.7 MongoDB//rename
    3. RM mongodb-linux-i686-2.6.7.tgz\?_ga\=1.68265944.858401362.1421216907//Delete compressed package
    4. Mkdir-p/data/mongo/logs//create log directory
    5. Mkdir-p/data/mongo/db//Create DB directory
    6. CD mongodb/
    7. CD bin/
    8. VI mongodb.conf//Create Profile 10 is profile information
    9. DBPath =/data/mongo/db #数据文件存放目录
      LogPath =/data/mongo/logs/mongodb.log #日志文件存放目录
      Port = 27017 #端口
      Fork = True #以守护程序的方式启用, which runs in the background
      Nohttpinterface = True
      Auth=true #需要验证
    10. CP mongodb.conf/etc/mongodb.conf//Put the configuration file in the ETC directory
    11. RM mongodb.conf//Delete conf under MongoDB file
    12. sudo ln-s/home/zhangxd/work/mongodb/mongodb/bin/mongod/usr/bin/mongod//Create a soft link
    13. Ln-s/home/zhangxd/work/mongodb/mongodb/bin/mongo/usr/bin/mongo//Create a soft link
    14. sudo yum install glibc.i686//compatible with an error, Forget what is wrong, if mongod-f/etc/mongodb.conf Start no error without execution
    15. Yum whatprovides libstdc++.so.6//compatible with a wrong, forget what's wrong, If mongod-f/etc/mongodb.conf start without error, do not
    16. sudo yum install libstdc++-4.4.7-16.el6.i686//compatible with one wrong, forget what's wrong if Mongod-f/etc/mongodb.conf boot no error no execution
    17. Mongod-f/etc/mongodb.conf//Use our configuration file to start Mon Godb
    18. Vi/etc/rc.d/rc.local add self-starter mongod-f/etc/mongodb.conf//Add boot-up
    19. Db.adduser (' Tank1 ', ' test '); Add the user, to which db to add to which db

CentOS MONGO Database Setup

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.