您的位置:首页 > 数据库

芒果数据库配置文件

2018-07-20 11:28 260 查看
配置文件1

# mongod.conf
systemLog:
destination: file
logAppend: true
storage:
journal:
enabled: true
directoryPerDB: true
engine: wiredTiger
wiredTiger:
engineConfig:
cacheSizeGB: 2
directoryForIndexes: true
indexConfig:
prefixCompression: true
processManagement:
fork: true
net:
port: 27017

目录介绍
/data/wyd/mongodb下的目录内容如下
backup(备份) log(日志) pid(pid文件) script shard-a-primary(数据库目录)

cacheSize是指系统分配给mongod用的内存,比如你系统有三十G内存,你可以分配二十四G内存给Mongodb

配置文件说明参考
https://blog.csdn.net/jianlong727/article/details/53484440

启动

numactl --interleave=all mongod -f /etc/mongod.conf \
--dbpath /data/wyd03/mongodbard-a-primary \
--logpath /data/wyd03/mongodb/logard-a-primary.log \
--pidfilepath /data/wyd03/mongodb/pidard-a-primary.pid --port 27021

指定不一样的pid和端口这样就可以起启多个不一样的进程

线上配置文件二

dbpath=/data/mongodb/db
logpath=/data/mongodb/logs/mongodb.log
bind_ip=127.0.0.1
port=27017
fork=true
nohttpinterface=true
auth=true

启动
/usr/local/mongodb/bin/mongod -f /usr/local/mongodb/conf/mongodb.conf

线上配置文件三

systemLog:
quiet: false
logAppend: true
destination: file
path: /data/mongodb/logs/mongod.log
storage:
dbPath: /data/mongodb/db
journal:
enabled: true
engine: wiredTiger
wiredTiger:
engineConfig:
cacheSizeGB: 16
indexConfig:
prefixCompression: true
processManagement:
fork: true
net:
bindIp: 127.0.0.1
port: 27017
security:
authorization: enabled
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  数据库 配置文件