CentOS 下 mongodb 安装步骤

前端之家收集整理的这篇文章主要介绍了CentOS 下 mongodb 安装步骤前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

安装文件mongodb-linux-x86_64-3.2.10.tgz

http://download.csdn.net/detail/zhangbest2009/9660216

安装目录:/opt/mongodb/

数据库目录:/opt/mongodb/data/db

日志文件目录:/opt/mongodb/data/logs/mongodb.log

以上目录及其文件先创建好

==================================================

[root@localhost mogodb]#tar -zxvf mongodb-linux-x86_64-3.2.10.tgz
mongodb-linux-x86_64-3.2.10/README
mongodb-linux-x86_64-3.2.10/THIRD-PARTY-NOTICES
mongodb-linux-x86_64-3.2.10/MPL-2
mongodb-linux-x86_64-3.2.10/GNU-AGPL-3.0
mongodb-linux-x86_64-3.2.10/bin/mongodump
mongodb-linux-x86_64-3.2.10/bin/mongorestore
mongodb-linux-x86_64-3.2.10/bin/mongoexport
mongodb-linux-x86_64-3.2.10/bin/mongoimport
mongodb-linux-x86_64-3.2.10/bin/mongostat
mongodb-linux-x86_64-3.2.10/bin/mongotop
mongodb-linux-x86_64-3.2.10/bin/bsondump
mongodb-linux-x86_64-3.2.10/bin/mongofiles
mongodb-linux-x86_64-3.2.10/bin/mongooplog
mongodb-linux-x86_64-3.2.10/bin/mongoperf
mongodb-linux-x86_64-3.2.10/bin/mongod
mongodb-linux-x86_64-3.2.10/bin/mongos
mongodb-linux-x86_64-3.2.10/bin/mongo

[root@localhost bin]# vi mongodb.conf

dbpath=/opt/mongodb/data/db
logpath=/opt/mongodb/data/logs/mongodb.log
port = 27017
fork = true
nohttpinterface = true

[root@localhost bin]#./mongod --config mongodb.conf
about to fork child process,waiting until server is ready for connections.
forked process: 22289
child process started successfully,parent exiting

[root@localhost bin]#./mongo
MongoDB shell version: 3.2.10
connecting to: test
Welcome to the MongoDB shell.
For interactive help,type "help".
For more comprehensive documentation,see
http://docs.mongodb.org/
Questions? Try the support group
http://groups.google.com/group/mongodb-user
Server has startup warnings:
2016-10-20T14:40:05.716+0800 I CONTROL [initandlisten] ** WARNING: You are running this process as the root user,which is not recommended.
2016-10-20T14:40:05.717+0800 I CONTROL [initandlisten]
2016-10-20T14:40:05.717+0800 I CONTROL [initandlisten]
2016-10-20T14:40:05.717+0800 I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is 'always'.
2016-10-20T14:40:05.717+0800 I CONTROL [initandlisten] ** We suggest setting it to 'never'
2016-10-20T14:40:05.717+0800 I CONTROL [initandlisten]
2016-10-20T14:40:05.717+0800 I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/defrag is 'always'.
2016-10-20T14:40:05.717+0800 I CONTROL [initandlisten] ** We suggest setting it to 'never'
2016-10-20T14:40:05.717+0800 I CONTROL [initandlisten]
> use arp
switched to db arp
> show dbs
local 0.000GB
> db.arp.insert({"arp_test":"arp"})
WriteResult({ "nInserted" : 1 })
> show dbs arp 0.000GB local 0.000GB >

猜你在找的CentOS相关文章