2016-10-14 18:30:36 -04:00
|
|
|
---
|
|
|
|
title: "node inspect"
|
|
|
|
description: "The node inspect command description and usage"
|
2016-11-03 18:48:30 -04:00
|
|
|
keywords: "node, inspect"
|
2016-10-14 18:30:36 -04:00
|
|
|
---
|
2016-06-13 22:57:19 -04:00
|
|
|
|
|
|
|
# node inspect
|
|
|
|
|
2016-07-07 14:43:18 -04:00
|
|
|
```markdown
|
|
|
|
Usage: docker node inspect [OPTIONS] self|NODE [NODE...]
|
2016-06-13 22:57:19 -04:00
|
|
|
|
2016-07-07 14:43:18 -04:00
|
|
|
Display detailed information on one or more nodes
|
2016-06-13 22:57:19 -04:00
|
|
|
|
2016-07-07 14:43:18 -04:00
|
|
|
Options:
|
2021-01-18 05:43:29 -05:00
|
|
|
-f, --format string Format output using a custom template:
|
|
|
|
'json': Print in JSON format
|
|
|
|
'TEMPLATE': Print output using the given Go template.
|
2022-03-08 08:54:21 -05:00
|
|
|
Refer to https://docs.docker.com/go/formatting/ for more information about formatting output with templates
|
2017-02-23 03:46:08 -05:00
|
|
|
--pretty Print the information in a human friendly format
|
2021-01-18 05:43:29 -05:00
|
|
|
--help Print usage
|
2016-07-07 14:43:18 -04:00
|
|
|
```
|
2016-06-13 22:57:19 -04:00
|
|
|
|
2017-02-07 18:42:48 -05:00
|
|
|
## Description
|
|
|
|
|
2016-06-13 22:57:19 -04:00
|
|
|
Returns information about a node. By default, this command renders all results
|
|
|
|
in a JSON array. You can specify an alternate format to execute a
|
|
|
|
given template for each result. Go's
|
2021-10-14 18:04:36 -04:00
|
|
|
[text/template](https://golang.org/pkg/text/template/) package describes all the
|
2016-06-13 22:57:19 -04:00
|
|
|
details of the format.
|
|
|
|
|
2020-04-19 11:08:37 -04:00
|
|
|
> **Note**
|
|
|
|
>
|
|
|
|
> This is a cluster management command, and must be executed on a swarm
|
|
|
|
> manager node. To learn about managers and workers, refer to the
|
|
|
|
> [Swarm mode section](https://docs.docker.com/engine/swarm/) in the
|
|
|
|
> documentation.
|
2018-12-23 06:27:52 -05:00
|
|
|
|
2017-02-07 18:42:48 -05:00
|
|
|
## Examples
|
2016-06-13 22:57:19 -04:00
|
|
|
|
2017-02-07 18:42:48 -05:00
|
|
|
### Inspect a node
|
|
|
|
|
2021-08-21 08:54:14 -04:00
|
|
|
```console
|
2017-02-07 18:42:48 -05:00
|
|
|
$ docker node inspect swarm-manager
|
2020-03-15 10:11:43 -04:00
|
|
|
```
|
2017-02-07 18:42:48 -05:00
|
|
|
|
2020-03-15 10:11:43 -04:00
|
|
|
```json
|
2017-02-07 18:42:48 -05:00
|
|
|
[
|
2020-03-15 10:11:43 -04:00
|
|
|
{
|
2017-02-07 18:42:48 -05:00
|
|
|
"ID": "e216jshn25ckzbvmwlnh5jr3g",
|
|
|
|
"Version": {
|
2020-03-15 10:11:43 -04:00
|
|
|
"Index": 10
|
2017-02-07 18:42:48 -05:00
|
|
|
},
|
2017-05-10 16:32:47 -04:00
|
|
|
"CreatedAt": "2017-05-16T22:52:44.9910662Z",
|
|
|
|
"UpdatedAt": "2017-05-16T22:52:45.230878043Z",
|
2017-02-07 18:42:48 -05:00
|
|
|
"Spec": {
|
2020-03-15 10:11:43 -04:00
|
|
|
"Role": "manager",
|
|
|
|
"Availability": "active"
|
2017-02-07 18:42:48 -05:00
|
|
|
},
|
|
|
|
"Description": {
|
2020-03-15 10:11:43 -04:00
|
|
|
"Hostname": "swarm-manager",
|
|
|
|
"Platform": {
|
|
|
|
"Architecture": "x86_64",
|
|
|
|
"OS": "linux"
|
|
|
|
},
|
|
|
|
"Resources": {
|
|
|
|
"NanoCPUs": 1000000000,
|
|
|
|
"MemoryBytes": 1039843328
|
|
|
|
},
|
|
|
|
"Engine": {
|
|
|
|
"EngineVersion": "17.06.0-ce",
|
|
|
|
"Plugins": [
|
|
|
|
{
|
|
|
|
"Type": "Volume",
|
|
|
|
"Name": "local"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"Type": "Network",
|
|
|
|
"Name": "overlay"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"Type": "Network",
|
|
|
|
"Name": "null"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"Type": "Network",
|
|
|
|
"Name": "host"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"Type": "Network",
|
|
|
|
"Name": "bridge"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"Type": "Network",
|
|
|
|
"Name": "overlay"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"TLSInfo": {
|
|
|
|
"TrustRoot": "-----BEGIN CERTIFICATE-----\nMIIBazCCARCgAwIBAgIUOzgqU4tA2q5Yv1HnkzhSIwGyIBswCgYIKoZIzj0EAwIw\nEzERMA8GA1UEAxMIc3dhcm0tY2EwHhcNMTcwNTAyMDAyNDAwWhcNMzcwNDI3MDAy\nNDAwWjATMREwDwYDVQQDEwhzd2FybS1jYTBZMBMGByqGSM49AgEGCCqGSM49AwEH\nA0IABMbiAmET+HZyve35ujrnL2kOLBEQhFDZ5MhxAuYs96n796sFlfxTxC1lM/2g\nAh8DI34pm3JmHgZxeBPKUURJHKWjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMB\nAf8EBTADAQH/MB0GA1UdDgQWBBS3sjTJOcXdkls6WSY2rTx1KIJueTAKBggqhkjO\nPQQDAgNJADBGAiEAoeVWkaXgSUAucQmZ3Yhmx22N/cq1EPBgYHOBZmHt0NkCIQC3\nzONcJ/+WA21OXtb+vcijpUOXtNjyHfcox0N8wsLDqQ==\n-----END CERTIFICATE-----\n",
|
|
|
|
"CertIssuerSubject": "MBMxETAPBgNVBAMTCHN3YXJtLWNh",
|
|
|
|
"CertIssuerPublicKey": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAExuICYRP4dnK97fm6OucvaQ4sERCEUNnkyHEC5iz3qfv3qwWV/FPELWUz/aACHwMjfimbcmYeBnF4E8pRREkcpQ=="
|
|
|
|
}
|
2017-02-07 18:42:48 -05:00
|
|
|
},
|
|
|
|
"Status": {
|
2020-03-15 10:11:43 -04:00
|
|
|
"State": "ready",
|
|
|
|
"Addr": "168.0.32.137"
|
2017-02-07 18:42:48 -05:00
|
|
|
},
|
|
|
|
"ManagerStatus": {
|
2020-03-15 10:11:43 -04:00
|
|
|
"Leader": true,
|
|
|
|
"Reachability": "reachable",
|
|
|
|
"Addr": "168.0.32.137:2377"
|
2016-06-17 00:28:07 -04:00
|
|
|
}
|
2020-03-15 10:11:43 -04:00
|
|
|
}
|
2017-02-07 18:42:48 -05:00
|
|
|
]
|
|
|
|
```
|
|
|
|
|
2023-01-06 13:28:29 -05:00
|
|
|
### <a name="format"></a> Format the output (--format)
|
2017-02-07 18:42:48 -05:00
|
|
|
|
2021-08-21 08:54:14 -04:00
|
|
|
```console
|
2017-02-07 18:42:48 -05:00
|
|
|
$ docker node inspect --format '{{ .ManagerStatus.Leader }}' self
|
|
|
|
|
|
|
|
false
|
2020-03-15 10:11:43 -04:00
|
|
|
```
|
|
|
|
|
|
|
|
Use `--format=pretty` or the `--pretty` shorthand to pretty-print the output:
|
|
|
|
|
2021-08-21 08:54:14 -04:00
|
|
|
```console
|
2020-03-15 10:11:43 -04:00
|
|
|
$ docker node inspect --format=pretty self
|
2017-02-07 18:42:48 -05:00
|
|
|
|
|
|
|
ID: e216jshn25ckzbvmwlnh5jr3g
|
|
|
|
Hostname: swarm-manager
|
2017-05-10 16:32:47 -04:00
|
|
|
Joined at: 2017-05-16 22:52:44.9910662 +0000 utc
|
2017-02-07 18:42:48 -05:00
|
|
|
Status:
|
|
|
|
State: Ready
|
|
|
|
Availability: Active
|
|
|
|
Address: 172.17.0.2
|
|
|
|
Manager Status:
|
|
|
|
Address: 172.17.0.2:2377
|
|
|
|
Raft Status: Reachable
|
|
|
|
Leader: Yes
|
|
|
|
Platform:
|
|
|
|
Operating System: linux
|
|
|
|
Architecture: x86_64
|
|
|
|
Resources:
|
|
|
|
CPUs: 4
|
|
|
|
Memory: 7.704 GiB
|
|
|
|
Plugins:
|
|
|
|
Network: overlay, bridge, null, host, overlay
|
|
|
|
Volume: local
|
2017-05-10 16:32:47 -04:00
|
|
|
Engine Version: 17.06.0-ce
|
|
|
|
TLS Info:
|
|
|
|
TrustRoot:
|
|
|
|
-----BEGIN CERTIFICATE-----
|
|
|
|
MIIBazCCARCgAwIBAgIUOzgqU4tA2q5Yv1HnkzhSIwGyIBswCgYIKoZIzj0EAwIw
|
|
|
|
EzERMA8GA1UEAxMIc3dhcm0tY2EwHhcNMTcwNTAyMDAyNDAwWhcNMzcwNDI3MDAy
|
|
|
|
NDAwWjATMREwDwYDVQQDEwhzd2FybS1jYTBZMBMGByqGSM49AgEGCCqGSM49AwEH
|
|
|
|
A0IABMbiAmET+HZyve35ujrnL2kOLBEQhFDZ5MhxAuYs96n796sFlfxTxC1lM/2g
|
|
|
|
Ah8DI34pm3JmHgZxeBPKUURJHKWjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMB
|
|
|
|
Af8EBTADAQH/MB0GA1UdDgQWBBS3sjTJOcXdkls6WSY2rTx1KIJueTAKBggqhkjO
|
|
|
|
PQQDAgNJADBGAiEAoeVWkaXgSUAucQmZ3Yhmx22N/cq1EPBgYHOBZmHt0NkCIQC3
|
|
|
|
zONcJ/+WA21OXtb+vcijpUOXtNjyHfcox0N8wsLDqQ==
|
|
|
|
-----END CERTIFICATE-----
|
|
|
|
|
2020-03-15 10:11:43 -04:00
|
|
|
Issuer Public Key: MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAExuICYRP4dnK97fm6OucvaQ4sERCEUNnkyHEC5iz3qfv3qwWV/FPELWUz/aACHwMjfimbcmYeBnF4E8pRREkcpQ==
|
|
|
|
Issuer Subject: MBMxETAPBgNVBAMTCHN3YXJtLWNh
|
2017-02-07 18:42:48 -05:00
|
|
|
```
|
|
|
|
|
|
|
|
## Related commands
|
2016-06-13 22:57:19 -04:00
|
|
|
|
2016-12-13 09:15:08 -05:00
|
|
|
* [node demote](node_demote.md)
|
2016-06-13 22:57:19 -04:00
|
|
|
* [node ls](node_ls.md)
|
2016-12-13 09:15:08 -05:00
|
|
|
* [node promote](node_promote.md)
|
|
|
|
* [node ps](node_ps.md)
|
2016-06-13 22:57:19 -04:00
|
|
|
* [node rm](node_rm.md)
|
2016-12-13 09:15:08 -05:00
|
|
|
* [node update](node_update.md)
|