当前位置: 首页 > news >正文

mongodb.conf配置文件详解

 

 

  不多说,直接上干货!

 

 

编辑文件:/etc/mongodb.conf

 

 

# mongodb.conf

# Where to store the data.
dbpath=/var/lib/mongodb

#where to log
logpath=/var/log/mongodb/mongodb.log

logappend=true

bind_ip = 127.0.0.1
port = 27017

# Enable journaling, http://www.mongodb.org/display/DOCS/Journaling
journal=true

# Enables periodic logging of CPU utilization and I/O wait
#cpu = true

# Turn on/off security.  Off is currently the default
#noauth = true
#auth = true
# Verbose logging output.
#verbose = true

# Inspect all client data for validity on receipt (useful for
# developing drivers)
#objcheck = true

# Enable db quota management
#quota = true

# Set oplogging level where n is
#   0=off (default)
#   1=W
#   2=R
#   3=both
#   7=W+some reads
#oplog = 0
# Diagnostic/debugging option
#nocursors = true

# Ignore query hints
#nohints = true

# Disable the HTTP interface (Defaults to localhost:27018).
#nohttpinterface = true

# Turns off server-side scripting.  This will result in greatly limited
# functionality
#noscripting = true

# Turns off table scans.  Any query that would do a table scan fails.
#notablescan = true

# Disable data file preallocation.
#noprealloc = true

# Specify .ns file size for new databases.
# nssize = <size>
# Accout token for Mongo monitoring server.
#mms-token = <token>

# Server name for Mongo monitoring server.
#mms-name = <server-name>

# Ping interval for Mongo monitoring server.
#mms-interval = <seconds>

# Replication Options

# in replicated mongo databases, specify here whether this is a slave or master
#slave = true
#source = master.example.com
# Slave only: specify a single database to replicate
#only = master.example.com
# or
#master = true
#source = slave.example.com
# Address of a server to pair with.
#pairwith = <server:port>
# Address of arbiter server.
#arbiter = <server:port>
# Automatically resync if slave data is stale
#autoresync
# Custom size for replication operation log.
#oplogSize = <MB>
# Size limit for in-memory storage of op ids.
#opIdMem = <bytes>

# SSL options
# Enable SSL on normal ports
#sslOnNormalPorts = true
# SSL Key file and password
#sslPEMKeyFile = /etc/ssl/mongodb.pem
#sslPEMKeyPassword = pass

 

 

 

  这是mongodb.conf配置文件的中文

#日志文件位置
logpath=/data/db/journal/mongodb.log  (这些都是可以自定义修改的)

# 以追加方式写入日志
logappend=true

# 是否以守护进程方式运行
fork = true

# 默认27017
#port = 27017

# 数据库文件位置
dbpath=/data/db

# 启用定期记录CPU利用率和 I/O 等待
#cpu = true

# 是否以安全认证方式运行,默认是不认证的非安全方式
#noauth = true
#auth = true

# 详细记录输出
#verbose = true

# Inspect all client data for validity on receipt (useful for
# developing drivers)用于开发驱动程序时验证客户端请求
#objcheck = true

# Enable db quota management
# 启用数据库配额管理
#quota = true
# 设置oplog记录等级
# Set oplogging level where n is
#   0=off (default)
#   1=W
#   2=R
#   3=both
#   7=W+some reads
#diaglog=0

# Diagnostic/debugging option 动态调试项
#nocursors = true

# Ignore query hints 忽略查询提示
#nohints = true
# 禁用http界面,默认为localhost:28017
#nohttpinterface = true

# 关闭服务器端脚本,这将极大的限制功能
# Turns off server-side scripting.  This will result in greatly limited
# functionality
#noscripting = true
# 关闭扫描表,任何查询将会是扫描失败
# Turns off table scans.  Any query that would do a table scan fails.
#notablescan = true
# 关闭数据文件预分配
# Disable data file preallocation.
#noprealloc = true
# 为新数据库指定.ns文件的大小,单位:MB
# Specify .ns file size for new databases.
# nssize =

# Replication Options 复制选项
# in replicated mongo databases, specify the replica set name here
#replSet=setname
# maximum size in megabytes for replication operation log
#oplogSize=1024
# path to a key file storing authentication info for connections
# between replica set members
#指定存储身份验证信息的密钥文件的路径
#keyFile=/path/to/keyfile

 

相关文章:

  • Manjaro Linux 17.0.2 pre 5 发布
  • 微软 PowerShell 成为黑客恶意软件传播工具
  • Docker 收购 Tutum,进一步完善其生态布局
  • 软件工程——团队答辩
  • Scrapy基础(十四)————Scrapy实现知乎模拟登陆
  • IdentityServer4 SigningCredential(RSA 证书加密)
  • 一款基于jQuery Ajax的等待效果
  • uTorrent 被发现悄悄安装挖矿程序,BitTorrent 公司否认
  • TortoiseGit为github账号添加SSH keys,解决pull总是提示输入密码的问题
  • Npcap —— 基于 Winpcap/ Libpcap 的网络包抓取库
  • Lucene 个人领悟 (二)
  • Java线程挂起
  • DOM2和DOM3
  • noip 2008 双栈排序
  • 双向绑定底层剖析(用于自定义组件双向数据绑定和非form表单元素)
  • 2017年终总结、随想
  • Angular js 常用指令ng-if、ng-class、ng-option、ng-value、ng-click是如何使用的?
  • C++入门教程(10):for 语句
  • Django 博客开发教程 8 - 博客文章详情页
  • ECMAScript入门(七)--Module语法
  • ES10 特性的完整指南
  • express.js的介绍及使用
  • iOS编译提示和导航提示
  • Javascript Math对象和Date对象常用方法详解
  • java概述
  • PHP面试之三:MySQL数据库
  • Promise面试题,控制异步流程
  • spring cloud gateway 源码解析(4)跨域问题处理
  • ucore操作系统实验笔记 - 重新理解中断
  • 不用申请服务号就可以开发微信支付/支付宝/QQ钱包支付!附:直接可用的代码+demo...
  • 等保2.0 | 几维安全发布等保检测、等保加固专版 加速企业等保合规
  • 工作踩坑系列——https访问遇到“已阻止载入混合活动内容”
  • 浏览器缓存机制分析
  • 浅析微信支付:申请退款、退款回调接口、查询退款
  • 如何学习JavaEE,项目又该如何做?
  • 使用Gradle第一次构建Java程序
  • 吴恩达Deep Learning课程练习题参考答案——R语言版
  • const的用法,特别是用在函数前面与后面的区别
  • FaaS 的简单实践
  • 直播平台建设千万不要忘记流媒体服务器的存在 ...
  • ​LeetCode解法汇总307. 区域和检索 - 数组可修改
  • #13 yum、编译安装与sed命令的使用
  • #laravel 通过手动安装依赖PHPExcel#
  • #QT项目实战(天气预报)
  • #我与Java虚拟机的故事#连载19:等我技术变强了,我会去看你的 ​
  • (06)Hive——正则表达式
  • (八)Flask之app.route装饰器函数的参数
  • (二)c52学习之旅-简单了解单片机
  • (附源码)计算机毕业设计SSM疫情居家隔离服务系统
  • .NET 5种线程安全集合
  • .NET HttpWebRequest、WebClient、HttpClient
  • .Net Web项目创建比较不错的参考文章
  • .NET/C# 判断某个类是否是泛型类型或泛型接口的子类型
  • .Net8 Blazor 尝鲜
  • .Net程序猿乐Android发展---(10)框架布局FrameLayout