/
hostInfo.txt
199 lines (132 loc) · 5.4 KB
/
hostInfo.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
========
hostInfo
========
.. default-domain:: mongodb
.. contents:: On this page
:local:
:backlinks: none
:depth: 1
:class: singlecol
.. dbcommand:: hostInfo
.. versionadded:: 2.2
:returns: A document with information about the underlying system
that the :binary:`~bin.mongod` or :binary:`~bin.mongos` runs on.
Some of the returned fields are only included on some
platforms.
You must run the :dbcommand:`hostInfo` command, which takes no
arguments, against the ``admin`` database. Consider the following
invocations of :dbcommand:`hostInfo`:
.. code-block:: javascript
db.hostInfo()
db.adminCommand( { "hostInfo" : 1 } )
In the :binary:`~bin.mongo` shell you can use :method:`db.hostInfo()`
as a helper to access :dbcommand:`hostInfo`. The output of
:dbcommand:`hostInfo` on a Linux system will resemble the
following:
.. code-block:: javascript
{
"system" : {
"currentTime" : ISODate("<timestamp>"),
"hostname" : "<hostname>",
"cpuAddrSize" : <number>,
"memSizeMB" : <number>,
"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>
}
Consider the following documentation of these fields:
.. data:: hostInfo
The document returned by the :dbcommand:`hostInfo`.
.. data:: hostInfo.system
An embedded document providing information about the underlying
environment of the system running the :binary:`~bin.mongod` or :binary:`~bin.mongos`
.. data:: hostInfo.system.currentTime
A time stamp of the current system time.
.. data:: hostInfo.system.hostname
The system name, which should correspond to the output of
``hostname -f`` on Linux systems.
.. data:: hostInfo.system.cpuAddrSize
A number reflecting the architecture of the system. Either
``32`` or ``64``.
.. data:: hostInfo.system.memSizeMB
The total amount of system memory (RAM) in megabytes.
.. data:: hostInfo.system.numCores
The total number of available logical processor cores.
.. data:: hostInfo.system.cpuArch
A string that represents the system architecture. Either ``x86``
or ``x86_64``.
.. data:: hostInfo.system.numaEnabled
A boolean value. ``false`` if NUMA is interleaved (i.e. disabled),
otherwise ``true``.
.. data:: hostInfo.os
An embedded document that contains information about the operating
system running the :binary:`~bin.mongod` and :binary:`~bin.mongos`.
.. data:: hostInfo.os.type
A string representing the type of operating system, such as
``Linux`` or ``Windows``.
.. data:: hostInfo.os.name
If available, returns a display name for the operating
system.
.. data:: hostInfo.os.version
If available, returns the name of the distribution or operating
system.
.. data:: hostInfo.extra
An embedded document with extra information about the operating system
and the underlying hardware. The content of the
:data:`~hostInfo.extra` embedded document depends on the operating
system.
.. data:: hostInfo.extra.versionString
A complete string of the operating system version and
identification. On Linux and OS X systems, this contains output
similar to ``uname -a``.
.. data:: hostInfo.extra.libcVersion
The release of the system ``libc``.
:data:`~hostInfo.extra.libcVersion` only appears on Linux
systems.
.. data:: hostInfo.extra.kernelVersion
The release of the Linux kernel in current use.
:data:`~hostInfo.extra.kernelVersion` only appears on Linux
systems.
.. data:: hostInfo.extra.alwaysFullSync
:data:`~hostInfo.extra.alwaysFullSync` only appears on OS X
systems.
.. data:: hostInfo.extra.nfsAsync
:data:`~hostInfo.extra.nfsAsync` only appears on OS X
systems.
.. data:: hostInfo.extra.cpuFrequencyMHz
Reports the clock speed of the system's processor in megahertz.
.. data:: hostInfo.extra.cpuFeatures
Reports the processor feature flags. On Linux systems this the
same information that ``/proc/cpuinfo`` includes in the
``flags`` fields.
.. data:: hostInfo.extra.pageSize
Reports the default system page size in bytes.
.. data:: hostInfo.extra.numPages
:data:`~hostInfo.extra.numPages` only appears on Linux systems.
.. data:: hostInfo.extra.maxOpenFiles
Reports the current system limits on open file handles. See
:doc:`/reference/ulimit` for more information.
:data:`~hostInfo.extra.maxOpenFiles` only appears on Linux
systems.
.. data:: hostInfo.extra.scheduler
Reports the active I/O scheduler.
:data:`~hostInfo.extra.scheduler` only appears on OS
X systems.
.. admin-only