【Mongo】mongo配置文件

发布时间:2020-08-09 19:00:50 作者:小亮520cl
来源:ITPUB博客 阅读:122

大于等于3.2按这种写法

  1. [ root@ ip - 172 - 31 - 33 - 43 conf ] # more shard1 . conf

  2. # where to write logging data .

  3. systemLog :

  4.   destination : file

  5.   logAppend : true

  6.   path : /data/shard1/log/shard1 . log

  7.  

  8. # Where and how to store data .

  9. storage :

  10.   dbPath : /data/shard1/data

  11.   journal :

  12.     enabled : true

  13.   wiredTiger :

  14.     engineConfig :

  15.         cacheSizeGB : 5   ##限制内存使用大小


  16. # how the process runs

  17. processManagement :

  18.   fork : true

  19.   pidFilePath : /data/shard1/log/shard1 . pid

  20.  

  21. # network interfaces

  22. net :

  23.   port : 27001

  24.   bindIp : 172 . 31 . 33 . 43


  25. #security :

  26. #  authorization : enabled


  27. #operationProfiling :

  28. replication :

  29.     replSetName : shard1

  30. sharding :

  31.     clusterRole : shardsvr

security:                   ###开启权限认证

    keyFile: /usr/local/mongodb/keyfile

    authorization: enabled


  1. [ root@ ip - 172 - 31 - 33 - 43 conf ] # more config . conf

  2. ## content

  3. systemLog :

  4.   destination : file

  5.   logAppend : true

  6.   path : /data/config/log/config . log

  7.  

  8. # Where and how to store data .

  9. storage :

  10.   dbPath : /data/config/data

  11.   journal :

  12.     enabled : true

  13. # how the process runs

  14. processManagement :

  15.   fork : true

  16.   pidFilePath : /data/config/log/configsrv . pid

  17.  

  18. # network interfaces

  19. net :

  20.   port : 21000

  21.   bindIp : 172 . 31 . 33 . 43

  22.  

  23. #operationProfiling :

  24. replication :

  25.     replSetName : config


  26. sharding :

  27.     clusterRole : configsvr


  28. [ root@ ip - 172 - 31 - 33 - 43 conf ] # more mongos . conf

  29. systemLog :

  30.   destination : file

  31.   logAppend : true

  32.   path : /data/mongos/log/mongos . log

  33. processManagement :

  34.   fork : true

  35.  

  36. # network interfaces

  37.   

  38. net :

  39.   port : 20000

  40.   bindIp : 172 . 31 . 33 . 43

  41. #监听的配置服务器 , 只能有1个或者3个 configs为配置服务器的副本集名字

  42. sharding :

  43.    configDB : config/172 . 31 . 33 . 43 : 21000 , 172 . 31 . 45 . 127 : 21000 , 172 . 31 . 36 . 162 : 21000



小于3.2一般按这种格式
  1. port = 27017

  2. dbpath = / data/mongodb/data

  3. logpath = / data/mongodb/logs/mongodb . log

  4. pidfilepath = / data/mongodb/logs/mongodb . pid

  5. logappend = true

  6. auth = true

  7. fork = true

  8. wiredTigerCacheSizeGB = 20


推荐阅读:
  1. mongo删除重复行
  2. mongo 语句积累

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

mongo 配置文件

上一篇:如何在Kubernetes容器环境下部署Spinnaker ?

下一篇:如何调优 Oracle SQL系列文章:SQL性能方法论

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》