On this page本页内容
hostInfo mongod or mongos runs on. mongod或mongos运行的底层系统信息的文档。 |
You must run the 您必须对hostInfo command, which takes no arguments, against the admin database. admin数据库运行hostInfo命令,该命令不接受任何参数。Consider the following invocations of 考虑以下hostInfo:hostInfo调用:
db.hostInfo()
db.adminCommand( { "hostInfo" : 1 } )
In 在mongosh you can use db.hostInfo() as a helper to access hostInfo. mongosh中,您可以使用db.hostInfo()作为访问hostInfo的助手。The output of Linux系统上hostInfo on a Linux system will resemble the following:hostInfo的输出如下所示:
{
"system" : {
"currentTime" : ISODate("<timestamp>"),
"hostname" : "<hostname>",
"cpuAddrSize" : <number>,
"memSizeMB" : <number>,
"memLimitMB" : <number>, // Available starting in MongoDB 4.0.9 (and 3.6.13)
"numCores" : <number>,
"cpuArch" : "<identifier>",
"numaEnabled" : <boolean>
},
"os" : {
"type" : "<string>",
"name" : "<string>",
"version" : "<string>"
},
"extra" : {
"versionString" : "<string>",
"libcVersion" : "<string>",
"kernelVersion" : "<string>",
"cpuFrequencyMHz" : "<string>",
"cpuFeatures" : "<string>",
"pageSize" : <number>,
"numPages" : <number>,
"maxOpenFiles" : <number>
},
"ok" : <return>
}
hostInfo.system An embedded document providing information about the underlying environment of the system running the 提供运行mongod or mongosmongod或mongos的系统底层环境信息的嵌入式文档
hostInfo.system.hostname The system name, which should correspond to the output of 系统名,在Linux系统上应与hostname -f on Linux systems.hostname -f的输出相对应。
hostInfo.system.cpuAddrSize A number reflecting the architecture of the system. 反映系统架构的数字。Either 32 or 64.32或64。
hostInfo.system.memLimitMB The memory usage limit in megabytes.内存使用限制(MB)。
For example, running in a container may impose memory limits that are lower than the total system memory. 例如,在容器中运行可能会施加低于系统总内存的内存限制。This memory limit, rather than the total system memory, is used as the maximum RAM available to calculate WiredTiger internal cache.此内存限制(而不是总系统内存)用作计算WiredTiger内部缓存的最大可用RAM。
Available starting in MongoDB 4.0.9 (and 3.6.13)从MongoDB 4.0.9(和3.6.13)开始提供
hostInfo.system.cpuArch A string that represents the system architecture. 表示系统体系结构的字符串。Either x86 or x86_64.x86或x86_64。
hostInfo.system.numaEnabled A boolean value. 布尔值。如果NUMA交错(即禁用),则为false if NUMA is interleaved (i.e. disabled), otherwise true.false,否则为true。
hostInfo.os An embedded document that contains information about the operating system running the 包含运行mongod and mongos.mongod和mongos的操作系统信息的嵌入式文档。
hostInfo.os.type A string representing the type of operating system, such as 表示操作系统类型的字符串,如Linux or Windows.Linux或Windows。
hostInfo.os.version If available, returns the name of the distribution or operating system.如果可用,则返回分发或操作系统的名称。
hostInfo.extra An embedded document with extra information about the operating system and the underlying hardware. 包含有关操作系统和底层硬件的额外信息的嵌入式文档。The content of the extra embedded document depends on the operating system.extra额外嵌入文档的内容取决于操作系统。
hostInfo.extra.cpuString A string containing a human-readable description of the system's processor.包含系统处理器的可读描述的字符串。
cpuString only appears on macOS systems.仅出现在macOS系统上。
hostInfo.extra.versionString A complete string of the operating system version and identification. 操作系统版本和标识的完整字符串。On Linux and macOS systems, this contains output similar to 在Linux和macOS系统上,这包含与uname -a.uname -a类似的输出。
hostInfo.extra.libcVersion The release of the system 系统libc.libc的发布。
libcVersion only appears on Linux systems.仅在Linux系统上出现。
hostInfo.extra.kernelVersion The release of the Linux kernel in current use.当前使用的Linux内核版本。
kernelVersion only appears on Linux systems.仅在Linux系统上显示。
hostInfo.extra.alwaysFullSync alwaysFullSync only appears on macOS systems.仅出现在macOS系统上。
hostInfo.extra.nfsAsync nfsAsync only appears on macOS systems.仅出现在macOS系统上。
hostInfo.extra.cpuFrequencyMHz Reports the clock speed of the system's processor in megahertz.以兆赫为单位报告系统处理器的时钟速度。
hostInfo.extra.cpuFeatures Reports the processor feature flags. 报告处理器功能标志。On Linux systems this the same information that 在Linux系统上,这与/proc/cpuinfo includes in the flags fields./proc/cpuinfo在标志字段中包含的信息相同。
hostInfo.extra.physicalCores Reports the number of physical, non-HyperThreading, cores available on the system.报告系统上可用的物理非超线程内核数。
physicalCores only appears on macOS systems.仅出现在macOS系统上。
hostInfo.extra.numPages numPages only appears on Linux systems.仅在Linux系统上出现。
hostInfo.extra.maxOpenFiles Reports the current system limits on open file handles. 报告打开文件句柄的当前系统限制。See UNIX 有关详细信息,请参阅UNIX ulimit Settings for more information.ulimit设置。
maxOpenFiles only appears on Linux systems.仅在Linux系统上出现。
hostInfo.extra.scheduler Reports the active I/O scheduler. 报告活动的I/O调度器。scheduler only appears on OS X systems.仅出现在OS X系统上。