- MongoDB Enterprise Advanced MongoDB 企业版
- MongoDB Professional MongoDB 专业版
- MongoDB Atlas 在线MongoDB,收费
- MongoDB Ops Manager 可本地安装的 MongoDB 监控工具
- MongoDB Cloud Manager MongoDB 云端监控工具,收费
- MongoDB Compass 图形界面管理探索和操纵你的MongoDB。
- MongoDB Connector for BI 在线分析和数据挖掘
- MongoDB Connector for Apache Spark Spark 连接器。
$ brew install mongodb --with-openssl
cp $(brew --prefix mongodb)/homebrew.mxcl.redis.plist ~/Library/LaunchAgents/
launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.redis.plist
-
https://docs.mongodb.com/manual/administration/configuration-and-maintenance/
-
默认配置文件路径
/etc/mongod.conf
mongo
use admin
db.createUser(
{
user: "myUserAdmin",
pwd: "abc123",
roles: [ { role: "userAdminAnyDatabase", db: "admin" } ]
}
)
mongo
use admin
db.auth("myUserAdmin", "abc123" )
./bin/mongod --dbpath ~/mongodb/db --fork --logpath ~/mongodb/log/mongodb.log --logappend
$ ./bin/mongostat
$ ./bin/mongo
> use admin
> db.shutdownServer()
或
$ ./bin/mongod --shutdown
available only on Linux systems
$ cd <mongodb installation dir>
$ ./bin/mongo
use <db_name>
show collections
db.foo.find()
foo 为对应 collection 名字
2016-12-13T13:58:04.601+0800 I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is 'always'.
2016-12-13T13:58:04.601+0800 I CONTROL [initandlisten] ** We suggest setting it to 'never'
2016-12-13T13:58:04.601+0800 I CONTROL [initandlisten]
2016-12-13T13:58:04.601+0800 I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/defrag is 'always'.
2016-12-13T13:58:04.601+0800 I CONTROL [initandlisten] ** We suggest setting it to 'never'
解决方法:
/etc/rc.local 中写入
if test -f /sys/kernel/mm/transparent_hugepage/enabled; then
echo never > /sys/kernel/mm/transparent_hugepage/enabled
fi
if test -f /sys/kernel/mm/transparent_hugepage/defrag; then
echo never > /sys/kernel/mm/transparent_hugepage/defrag
fi
** WARNING: soft rlimits too low. rlimits set to 1024 processes, 100000 files. Number of processes should be at least 50000 : 0.5 times number of files.
解决方法:
参考 Recommended ulimit Settings
ulimit -n 64000
ulimit -u 64000
** WARNING: Access control is not enabled for the database.
** Read and write access to data and configuration is unrestricted.
解决方法:
/etc/mongod.conf 配置:
security:
authorization: enabled