This repository has been archived by the owner on Jul 27, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 67
Agent
Chris Aubuchon edited this page Feb 5, 2016
·
2 revisions
Subcommand | Synopsis |
---|---|
checks | Get the checks the agent is managing |
force-leave | Force the removal of a node |
join | Trigger the local agent to join a node |
maintenance | Manage node maintenance mode |
members | Get the members as seen by the serf agent |
self | Get agent configuration |
services | Get the services the agent is managing |
Get the checks that the agent is managing
Usage: consul-cli agent checks [options]
$ ./consul-cli agent checks
{
"service:docker": {
"Node": "default",
"CheckID": "service:docker",
"Name": "Service 'docker' check",
"Status": "passing",
"Notes": "",
"Output": "active\n",
"ServiceID": "docker",
"ServiceName": "docker"
}
}
Force the removal of a node
Usage: consul-cli agent force-leave [options] nodeName
$ ./consul-cli agent force-leave mi-control-01
Triggers the agent to join a node
Usage: consul-cli agent join [options] nodeName
-
--wan
Whentrue
, attempt to join a WAN pool instead of a LAN pool. Default isfalse
$ ./consul-cli agent join mi-control-01
Manages node maintenance mode
Usage: consul-cli agent maintenance [options]
-
--enabled
Whentrue
, enable maintenance mode on the agent. Default istrue
-
--reason
Optional text explaining the reason for putting the node in maintenance mode
$ ./consul-cli agent maintenance --enable=true --reason="Maintenance Testing"
Get the cluster members as seen by the local Serf agent.
Usage: consul-cli agent members [options]
-
--wan
Get the list of WAN pool members instead of LAN pool members
$ ./consul-cli agent members
[
{
"Name": "default",
"Addr": "10.0.2.15",
"Port": 8301,
"Tags": {
"bootstrap": "1",
"build": "0.5.2:9a9cc934",
"dc": "vagrant",
"port": "8300",
"role": "consul",
"vsn": "2",
"vsn_max": "2",
"vsn_min": "1"
},
"Status": 1,
"ProtocolMin": 1,
"ProtocolMax": 2,
"ProtocolCur": 2,
"DelegateMin": 2,
"DelegateMax": 4,
"DelegateCur": 4
}
]
Get the local node configuration
Usage: consul-cli agent self [options]
$ ./consul-cli agent self
{
"Config": {
"ACLDatacenter": "vagrant",
"ACLDefaultPolicy": "allow",
"ACLDownPolicy": "allow",
"ACLTTL": 3e+10,
"ACLTTLRaw": "",
"Addresses": {
"DNS": "",
"HTTP": "",
"HTTPS": "",
"RPC": ""
},
...
}
}
Get services managed by the agent
Usage: consul-cli agent services [options]
$ ./consul-cli agent services
{
"docker": {
"ID": "docker",
"Service": "docker",
"Tags": null,
"Port": 0,
"Address": ""
}
}