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
|
|
|
|
2016-10-19 13:25:45 -04:00
|
|
|
<!-- This file is maintained within the docker/docker Github
|
|
|
|
repository at https://github.com/docker/docker/. Make all
|
|
|
|
pull requests against that repo. If you see this file in
|
|
|
|
another repository, consider it read-only there, as it will
|
|
|
|
periodically be overwritten by the definitive file. Pull
|
|
|
|
requests which include edits to this file in other repositories
|
|
|
|
will be rejected.
|
|
|
|
-->
|
|
|
|
|
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:
|
2016-10-18 06:50:11 -04:00
|
|
|
-f, --format string Format the output using the given Go template
|
2016-07-07 14:43:18 -04:00
|
|
|
--help Print usage
|
2016-07-13 12:46:17 -04:00
|
|
|
--pretty Print the information in a human friendly format.
|
2016-07-07 14:43:18 -04:00
|
|
|
```
|
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
|
|
|
|
[text/template](http://golang.org/pkg/text/template/) package describes all the
|
|
|
|
details of the format.
|
|
|
|
|
|
|
|
Example output:
|
|
|
|
|
|
|
|
$ docker node inspect swarm-manager
|
|
|
|
[
|
2016-06-17 00:28:07 -04:00
|
|
|
{
|
|
|
|
"ID": "e216jshn25ckzbvmwlnh5jr3g",
|
2016-06-13 22:57:19 -04:00
|
|
|
"Version": {
|
2016-06-17 00:28:07 -04:00
|
|
|
"Index": 10
|
2016-06-13 22:57:19 -04:00
|
|
|
},
|
2016-06-17 00:28:07 -04:00
|
|
|
"CreatedAt": "2016-06-16T22:52:44.9910662Z",
|
|
|
|
"UpdatedAt": "2016-06-16T22:52:45.230878043Z",
|
2016-06-13 22:57:19 -04:00
|
|
|
"Spec": {
|
2016-06-17 00:28:07 -04:00
|
|
|
"Role": "manager",
|
|
|
|
"Availability": "active"
|
2016-06-13 22:57:19 -04:00
|
|
|
},
|
|
|
|
"Description": {
|
|
|
|
"Hostname": "swarm-manager",
|
|
|
|
"Platform": {
|
|
|
|
"Architecture": "x86_64",
|
|
|
|
"OS": "linux"
|
|
|
|
},
|
|
|
|
"Resources": {
|
|
|
|
"NanoCPUs": 1000000000,
|
2016-06-17 00:28:07 -04:00
|
|
|
"MemoryBytes": 1039843328
|
2016-06-13 22:57:19 -04:00
|
|
|
},
|
|
|
|
"Engine": {
|
|
|
|
"EngineVersion": "1.12.0",
|
2016-06-17 00:28:07 -04:00
|
|
|
"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"
|
|
|
|
}
|
|
|
|
]
|
2016-06-13 22:57:19 -04:00
|
|
|
}
|
|
|
|
},
|
|
|
|
"Status": {
|
2016-10-24 19:11:25 -04:00
|
|
|
"State": "ready",
|
|
|
|
"Addr": "168.0.32.137"
|
2016-06-13 22:57:19 -04:00
|
|
|
},
|
2016-06-17 00:28:07 -04:00
|
|
|
"ManagerStatus": {
|
|
|
|
"Leader": true,
|
|
|
|
"Reachability": "reachable",
|
|
|
|
"Addr": "168.0.32.137:2377"
|
|
|
|
}
|
|
|
|
}
|
2016-06-13 22:57:19 -04:00
|
|
|
]
|
|
|
|
|
2016-10-19 13:25:45 -04:00
|
|
|
{% raw %}
|
2016-06-17 00:28:07 -04:00
|
|
|
$ docker node inspect --format '{{ .ManagerStatus.Leader }}' self
|
2016-06-13 22:57:19 -04:00
|
|
|
false
|
2016-10-19 13:25:45 -04:00
|
|
|
{% endraw %}
|
2016-06-13 22:57:19 -04:00
|
|
|
|
|
|
|
$ docker node inspect --pretty self
|
2016-06-17 00:28:07 -04:00
|
|
|
ID: e216jshn25ckzbvmwlnh5jr3g
|
|
|
|
Hostname: swarm-manager
|
2016-08-09 07:04:35 -04:00
|
|
|
Joined at: 2016-06-16 22:52:44.9910662 +0000 utc
|
2016-06-13 22:57:19 -04:00
|
|
|
Status:
|
|
|
|
State: Ready
|
|
|
|
Availability: Active
|
2016-10-24 19:11:25 -04:00
|
|
|
Address: 172.17.0.2
|
2016-06-13 22:57:19 -04:00
|
|
|
Manager Status:
|
|
|
|
Address: 172.17.0.2:2377
|
2016-06-27 06:26:58 -04:00
|
|
|
Raft Status: Reachable
|
2016-06-13 22:57:19 -04:00
|
|
|
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
|
|
|
|
Engine Version: 1.12.0
|
|
|
|
|
|
|
|
## Related information
|
|
|
|
|
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)
|