Operations Checklist操作检查表

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部署中的问题。

Filesystem

Replication复制

Sharding分片

Journaling: WiredTiger Storage Engine日志记录:WiredTiger存储引擎

Hardware硬件

Deployments to Cloud Hardware部署到云硬件

Operating System Configuration操作系统配置

Linux

  • Turn off transparent hugepages. 关闭透明hugepages。See Transparent Huge Pages Settings for more information.有关详细信息,请参阅透明巨型页面设置。
  • Adjust the readahead settings on the devices storing your database files.调整存储数据库文件的设备上的readahead设置

    • For the WiredTiger storage engine, set readahead between 8 and 32 regardless of storage media type (spinning disk, SSD, etc.), unless testing shows a measurable, repeatable, and reliable benefit in a higher readahead value.对于WiredTiger存储引擎,无论存储介质类型(旋转磁盘、SSD等)如何,都应将readahead设置在8到32之间,除非测试显示更高的readahead值具有可测量、可重复和可靠的好处。

      MongoDB commercial supportMongoDB商业支持 can provide advice and guidance on alternate readahead configurations.可以就备用预读配置提供建议和指导。

  • If using tuned on RHEL / CentOS, you must customize your tuned profile. 如果在RHEL/CentOS上使用tuned,则必须自定义已优化的配置文件。Many of the tuned profiles that ship with RHEL / CentOS can negatively impact performance with their default settings. RHEL/CentOS附带的许多tuned配置文件可能会对其默认设置的性能产生负面影响。Customize your chosen tuned profile to:将您选择的tuned配置文件自定义为:

    • Disable transparent hugepages. 禁用透明hugepages。See Using tuned and ktune for instructions.有关说明,请参阅使用tuned和ktune
    • Set readahead between 8 and 32 regardless of storage media type. 将readahead设置为8到32之间,而不考虑存储介质类型。See Readahead settings for more information.有关更多信息,请参阅Readahead设置
  • Use the noop or deadline disk schedulers for SSD drives.对于SSD驱动器,请使用noopdeadline磁盘调度程序。
  • Use the noop disk scheduler for virtualized drives in guest VMs.noop磁盘调度器用于来宾VM中的虚拟化驱动器。
  • Disable NUMA or set vm.zone_reclaim_mode to 0 and run mongod instances with node interleaving. 禁用NUMA或将vmzone_Reclain_mode设置为0,并使用节点交错运行mongod实例。See: MongoDB and NUMA Hardware for more information.有关更多信息,请参阅:MongoDB和NUMA硬件
  • Adjust the ulimit values on your hardware to suit your use case. 调整硬件上的ulimit值以适合您的用例。If multiple mongod or mongos instances are running under the same user, scale the ulimit values accordingly. 如果多个mongodmongos实例在同一用户下运行,请相应地缩放ulimit值。See: UNIX ulimit Settings for more information.有关详细信息,请参阅:UNIX ulimit设置
  • Use noatime for the dbPath mount point.使用noatime作为dbPath装载点。
  • Configure sufficient file handles (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. 为部署配置足够的文件句柄(fsfile max)、内核pid限制(kernelpid_max)、每个进程的最大线程数(kernelthreads max)和每个进程的最大内存映射区域数(vmmax_map_count)。For large systems, the following values provide a good starting point:对于大型系统,以下值提供了一个良好的起点:

    • fs.file-max value of 98000,
    • kernel.pid_max value of 64000,
    • kernel.threads-max value of 64000, and
    • vm.max_map_count value of 128000
  • Ensure that your system has swap space configured. 确保系统已配置交换空间。Refer to your operating system’s documentation for details on appropriate sizing.有关适当大小的详细信息,请参阅操作系统的文档。
  • Ensure that the system default TCP keepalive is set correctly. 确保系统默认TCP keepalive设置正确。A value of 300 often provides better performance for replica sets and sharded clusters. 值300通常可以为副本集和分片集群提供更好的性能。See: Does TCP keepalive time affect MongoDB Deployments? in the Frequently Asked Questions for more information.请参阅:TCP保持生存时间是否会影响MongoDB部署?在常见问题中获取更多信息。

Windows

  • Consider disabling NTFS “last access time” updates. 考虑禁用NTFS“上次访问时间”更新。This is analogous to disabling atime on Unix-like systems.这类似于在类Unix系统上禁用atime
  • Format NTFS disks using the default Allocation unit size of 4096 bytes.使用默认分配单元大小4096字节格式化NTFS磁盘。

Backups备份

Monitoring监测

Load Balancing负载平衡