Installing the Configuration MongoDB

Source: Internet
Author: User

1. Download MongoDBHTTPS://FASTDL.MONGODB.ORG/LINUX/MONGODB-LINUX-X86_64-2.6.8.TGZ2. Unzip the tar zxf mongodb-linux-x86_64-2.6.8. Tgz3. Specify the installation directory MV MONGODB-LINUX-X86_64-2.6.8/APP/SINOVA/MONGODB4. Create a data file to store the directory mkdir/app/sinova/mongodb/ DB5. Create a log file to hold the directory MKDIR/APP/SINOVA/MONGODB/LOGS6. Create a profile directory Mkdir/app/sinova/mongodb/conf7. In/app/sinova/mongodb/ Conf the new configuration file in the directory, MongoDB supports writing the parameters into the configuration file and then starting with the configuration file configurationVI mongodb.confDBPath =/app/sinova/mongodb/db #数据文件存放目录LogPath =/app/sinova/mongodb/logs/mongodb.log #日志文件存放目录port = 27017 #mongodb监听的端口fork = True #以守护进程方式启动, which runs in the backgroundNohttpinterface = True #禁用http管理接口auth = True #启动mongodb客户端登录的认证机制. 8. Start MongoDB/app/sinova/mongodb/bin/mongod--config/app/sinova/mongodb/bin/mongodb.conf9. Stop MongoDBUnder Linux Many people stop a lot of services like Direct kill-9 PID, but for MongoDB if the kill-9 PID, the next boot may prompt error, resulting in the service cannot start, this time can be performed by: Rm-f/app/hadoop/db/ Mongod.lock also deletes the Mongod.lock file under the specified data directory.

Normal Stop method:
Kill-2 PID
Or
./mongo-host Ip:port First connect the services that need to be stopped, and then:
>use Admin
>db.shutdownserver ();
This can also stop the service as normal.

Installing the Configuration 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.