芒果数据库配置文件

配置文件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

猜你喜欢

转载自blog.51cto.com/yht1990/2147567