首页
mongodb
Linux
云原生
常用bat文件
Maven教程
设计模式
Oracle常用知识梳理
更多……
申请加入课程
MongDB简介
MongDB及其附属工具介绍和安装
MongoDB 备份(mongodump)与恢复(mongorestore)
MongoDB基础DML和DDL操作
MongoDB 可视化工具
MongoDB 索引
MongoDB 聚合
MongDB 复制与分片集群
MongoDB 监控
MongoDB 查询分析
MongoDB 概念解析
MongoDB GridFS
MongoDB Java
Redis、Memcache和MongoDB的区别
MongoDB的其它关键知识点
MongoDB k8s单节点部署和备份
MongoDB 的配置mongodb.conf
MongoDB k8s下部署 Replica Set
MongoDB 状态查询
MongoDB 数据库的日志解析
MongoDb 常见错误处理方法收集
MongoDB 一次性能测试和问题解决
MongoDB 的配置mongodb.conf
星辰
2020-11-26
0
0
1919
人
0
人评论
0
人举报
[TOC] # MongoDB 的配置 ## yaml格式配置 ``` systemLog: verbosity: 0 quiet: false # traceAllExceptions:
syslogFacility: user path: "/data/mongodb/log" logAppend: false logRotate: rename destination: file timeStampFormat: iso8601-local component: accessControl: verbosity: 0 command: verbosity: 0 # COMMENT some component verbosity settings omitted for brevity storage: verbosity: 0 journal: verbosity: 0 write: verbosity: 0 processManagement: fork: false pidFilePath: "/var/run/mongodb/mongod.pid" net: port: 27017 bindIp: "127.0.0.1" maxIncomingConnections: 65536 wireObjectCheck: true ipv6: false unixDomainSocket: enabled: true pathPrefix: "/tmp" filePermissions: 0700 http: enabled: true JSONPEnabled: false RESTInterfaceEnabled: false # ssl: # sslOnNormalPorts:
# deprecated since 2.6 # mode: disabled # PEMKeyFile:
# PEMKeyPassword:
# clusterFile:
# clusterPassword:
# CAFile:
# CRLFile:
# allowConnectionsWithoutCertificates:
# allowInvalidCertificates:
# allowInvalidHostnames:
# FIPSMode:
#security: # keyFile: "/var/lib/mongo/mongodb-keyfile" # clusterAuthMode: keyFile # authorization: disabled # javascriptEnabled: true # sasl: # hostName:
# serviceName:
# saslauthdSocketPath:
#setParameter: #
:
#
:
storage: dbPath: "/data/db" indexBuildRetry: true repairPath: "/data/db/tmp" journal: enabled: true directoryPerDB: false syncPeriodSecs: 60 engine: mmapv1 mmapv1: preallocDataFiles: true nsSize: 16 quota: enforced: false maxFilesPerDB: 8 smallFiles: false journal: debugFlags: 1 commitIntervalMs: 100 # wiredTiger: # engineConfig: # cacheSizeGB: 1 # statisticsLogDelaySecs: 0 # journalCompressor: snappy # directoryForIndexes: false # collectionConfig: # blockCompressor: snappy # indexConfig: # prefixCompression: true operationProfiling: slowOpThresholdMs: 100 mode: off #replication: # oplogSizeMB: 50 # replSetName: repl_test # secondaryIndexPrefetch: all #sharding: # clusterRole:
# archiveMovedChunks:
#auditLog: # destination: file # format: JSON # path: "/data/mongodb/log" # filter:
#snmp: # subagent:
# master:
#mongos only #replication: # localPingThresholdMs:
#sharding: # autoSplit:
# configDB:
# chunkSize:
``` ## mongodb.conf ``` vi /etc/mongod.conf # 日志文件位置 logpath=/var/log/mongo/mongod.log # 以追加方式写入日志 logappend=true # 是否以守护进程方式运行 fork = true # 默认27017 #port = 27017 # 数据库文件位置 dbpath=/var/lib/mongo # 启用定期记录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 ```
所有评论列表
点我发表评论