On this page本页内容
The following checklist, along with the Development Checklist list, provides recommendations to help you avoid issues in your production MongoDB deployment.以下清单以及开发清单列表提供了一些建议,以帮助您避免生产MongoDB部署中的问题。
dbPath
. dbPath
。Changed in version 3.4.在版本3.4中更改。The replication oplog window no longer needs to cover the time needed to restore a replica set member via initial sync as the oplog records are pulled during the data copy. 复制oplog窗口不再需要覆盖通过初始同步恢复副本集成员所需的时间,因为在数据复制过程中会提取oplog记录。However, the member being restored must have enough disk space in the local database to temporarily store these oplog records for the duration of this data copy stage.但是,要还原的成员在local数据库中必须有足够的磁盘空间,以便在此数据复制阶段期间临时存储这些oplog记录。
With earlier versions of MongoDB, replication oplog window should cover the time needed to restore a replica set member by initial sync.对于早期版本的MongoDB,复制oplog窗口应涵盖通过初始同步恢复副本集成员所需的时间。
w:"majority"
write concern for availability and durability.w:"majority"
写入关注。mongod
instances.mongod
实例之间的完全双向网络连接。mongod
instances have 0
or 1
votes.mongod
实例有0
票或1
票。mongos
routers in accordance with the Production Configuration guidelines.mongos
路由器。mongod
, mongos
, and config servers.mongod
、mongos
和config
服务器之间的完全双向网络连接。mongod
has provisioned IOPS for its dbPath
, or has its own physical drive or LUN.mongod
都为其dbPath
配置了IOPS,或者有自己的物理驱动器或LUN。tcp_keepalive_time
) to 100-120. tcp_keepalive_time
)调整为100-120。MongoDB commercial supportMongoDB商业支持 can provide advice and guidance on alternate readahead configurations.可以就备用预读配置提供建议和指导。
tuned
on RHEL / CentOS, you must customize your tuned
profile. tuned
profiles that ship with RHEL / CentOS can negatively impact performance with their default settings. tuned
配置文件可能会对其默认设置的性能产生负面影响。tuned
profile to:tuned
配置文件自定义为:
noop
or deadline
disk schedulers for SSD drives.noop
或deadline
磁盘调度程序。noop
disk scheduler for virtualized drives in guest VMs.noop
磁盘调度器用于来宾VM中的虚拟化驱动器。mongod
instances with node interleaving. mongod
实例。ulimit
values on your hardware to suit your use case. ulimit
值以适合您的用例。mongod
or mongos
instances are running under the same user, scale the ulimit
values accordingly. mongod
或mongos
实例在同一用户下运行,请相应地缩放ulimit
值。noatime
for the dbPath
mount point.noatime
作为dbPath
装载点。fs.file-max
), kernel pid limit (kernel.pid_max
), maximum threads per process (kernel.threads-max
), and maximum number of memory map areas per process (vm.max_map_count
) for your deployment. fs.file-max
value of 98000,kernel.pid_max
value of 64000,kernel.threads-max
value of 64000, andvm.max_map_count
value of 128000atime
on Unix-like systems.atime
。In the absence of disk space monitoring, or as a precaution:在没有磁盘空间监控的情况下,或者作为预防措施:
storage.dbPath
drive to ensure available space if the disk becomes full.storage.dbPath
驱动器上创建一个4 GB的虚拟文件,以确保磁盘已满时的可用空间。cron+df
can alert when disk space hits a high-water mark, if no other monitoring tool is available.cron+df
的组合可以在磁盘空间达到高水位线时发出警报。