hostInfo

On this page本页内容

hostInfo
Returns:返回:A document with information about the underlying system that the mongod or mongos runs on. 包含mongodmongos运行的底层系统信息的文档。Some of the returned fields are only included on some platforms.某些返回的字段仅包含在某些平台上。

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 hostInfo on a Linux system will resemble the following:Linux系统上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>
}

Output输出

hostInfo

The document returned by the hostInfo.hostInfo返回的文档。

hostInfo.system

An embedded document providing information about the underlying environment of the system running the mongod or mongos提供运行mongodmongos的系统底层环境信息的嵌入式文档

hostInfo.system.currentTime

A timestamp of the current system time.当前系统时间的时间戳。

hostInfo.system.hostname

The system name, which should correspond to the output of hostname -f on Linux systems.系统名,在Linux系统上应与hostname -f的输出相对应。

hostInfo.system.cpuAddrSize

A number reflecting the architecture of the system. 反映系统架构的数字。Either 32 or 64.3264

hostInfo.system.memSizeMB

The total amount of system memory (RAM) in megabytes.以兆字节为单位的系统内存(RAM)总量。

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.numCores

The total number of available logical processor cores.可用逻辑处理器内核的总数。

hostInfo.system.cpuArch

A string that represents the system architecture. 表示系统体系结构的字符串。Either x86 or x86_64.x86x86_64

hostInfo.system.numaEnabled

A boolean value. 布尔值。false if NUMA is interleaved (i.e. disabled), otherwise true.如果NUMA交错(即禁用),则为false,否则为true

hostInfo.os

An embedded document that contains information about the operating system running the mongod and mongos.包含运行mongodmongos的操作系统信息的嵌入式文档。

hostInfo.os.type

A string representing the type of operating system, such as Linux or Windows.表示操作系统类型的字符串,如LinuxWindows

hostInfo.os.name

If available, returns a display name for the operating system.如果可用,则返回操作系统的显示名称。

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 uname -a.在Linux和macOS系统上,这包含与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 /proc/cpuinfo includes in the flags fields.在Linux系统上,这与/proc/cpuinfo在标志字段中包含的信息相同。

hostInfo.extra.pageSize

Reports the default system page size in bytes.报告默认系统页面大小(以字节为单位)。

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 ulimit Settings for more information.有关详细信息,请参阅UNIX 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系统上。

←  getLogisSelf →