2015-10-16 00:03:16 -07:00
|
|
|
---
|
2020-09-01 10:14:13 -05:00
|
|
|
layout: commands
|
2020-04-07 14:55:19 -04:00
|
|
|
page_title: 'Commands: RTT'
|
|
|
|
description: |
|
2015-10-16 00:56:15 -07:00
|
|
|
The rtt command estimates the network round trip time between two nodes.
|
2015-10-16 00:03:16 -07:00
|
|
|
---
|
|
|
|
|
|
|
|
# Consul RTT
|
|
|
|
|
|
|
|
Command: `consul rtt`
|
|
|
|
|
2022-01-11 08:26:58 -05:00
|
|
|
Corresponding HTTP API Endpoints: [\[GET\] /v1/coordinate/datacenters](/api-docs/coordinate#read-wan-coordinates), [\[GET\] /v1/coordinate/nodes](/api-docs/coordinate#read-lan-coordinates-for-all-nodes)
|
2022-01-10 12:40:11 -05:00
|
|
|
|
2015-10-21 17:29:43 -07:00
|
|
|
The `rtt` command estimates the network round trip time between two nodes using
|
|
|
|
Consul's network coordinate model of the cluster.
|
|
|
|
|
2022-01-10 15:36:16 -08:00
|
|
|
See the [Network Coordinates](/docs/architecture/coordinates) internals guide
|
2015-10-21 17:29:43 -07:00
|
|
|
for more information on how these coordinates are computed.
|
2015-10-16 00:03:16 -07:00
|
|
|
|
2022-10-18 12:49:07 -07:00
|
|
|
The table below shows this command's [required ACLs](/api-docs/api-structure#authentication). Configuration of
|
2022-03-30 16:16:26 -05:00
|
|
|
[blocking queries](/api-docs/features/blocking) and [agent caching](/api-docs/features/caching)
|
2022-01-10 16:44:56 -05:00
|
|
|
are not supported from commands, but may be from the corresponding HTTP endpoint.
|
|
|
|
|
2022-01-11 09:41:54 -05:00
|
|
|
| ACL Required |
|
|
|
|
| ----------------------- |
|
|
|
|
| `node:read`<sup>1</sup> |
|
|
|
|
|
|
|
|
<p>
|
|
|
|
<sup>1</sup> When referencing WAN coordinates, no ACL permission is needed.
|
|
|
|
</p>
|
2022-01-10 16:44:56 -05:00
|
|
|
|
2015-10-16 00:03:16 -07:00
|
|
|
## Usage
|
|
|
|
|
2015-10-16 12:45:25 -07:00
|
|
|
Usage: `consul rtt [options] node1 [node2]`
|
2015-10-16 00:03:16 -07:00
|
|
|
|
2015-10-16 12:45:25 -07:00
|
|
|
At least one node name is required. If the second node name isn't given, it
|
2016-11-25 11:00:02 -05:00
|
|
|
is set to the agent's node name. These are the node names as known to
|
|
|
|
Consul as the `consul members` command would show, not IP addresses.
|
2015-10-16 00:03:16 -07:00
|
|
|
|
2022-07-26 23:17:11 -07:00
|
|
|
## Sample Output
|
2017-02-09 19:38:06 -05:00
|
|
|
|
2022-07-26 23:17:11 -07:00
|
|
|
If coordinates are available, the command will print the estimated round trip
|
|
|
|
time between the given nodes:
|
|
|
|
|
|
|
|
```shell-session
|
|
|
|
$ consul rtt n1 n2
|
|
|
|
Estimated n1 <-> n2 rtt: 0.610 ms (using LAN coordinates)
|
|
|
|
|
|
|
|
$ consul rtt n2 # Running from n1
|
|
|
|
Estimated n1 <-> n2 rtt: 0.610 ms (using LAN coordinates)
|
|
|
|
|
|
|
|
$ consul rtt -wan n1.dc1 n2.dc2
|
|
|
|
Estimated n1.dc1 <-> n2.dc2 rtt: 1.275 ms (using WAN coordinates)
|
|
|
|
```
|
2017-02-09 19:38:06 -05:00
|
|
|
|
|
|
|
#### Command Options
|
2015-10-16 00:03:16 -07:00
|
|
|
|
2020-04-07 14:55:19 -04:00
|
|
|
- `-wan` - Instructs the command to use WAN coordinates instead of LAN
|
2015-10-16 12:45:25 -07:00
|
|
|
coordinates. By default, the two nodes are assumed to be nodes in the local
|
|
|
|
datacenter and the LAN coordinates are used. If the -wan option is given,
|
|
|
|
then the WAN coordinates are used, and the node names must be suffixed by a period
|
2015-10-21 17:29:43 -07:00
|
|
|
and the datacenter (eg. "myserver.dc1"). It is not possible to measure between
|
2017-03-13 22:56:24 -07:00
|
|
|
LAN coordinates and WAN coordinates, so both nodes must be in the same area.
|
2015-10-21 17:29:43 -07:00
|
|
|
|
2015-12-21 15:16:48 -08:00
|
|
|
The following environment variables control accessing the HTTP server via SSL:
|
2015-12-17 13:24:42 -05:00
|
|
|
|
2020-04-07 14:55:19 -04:00
|
|
|
- `CONSUL_HTTP_SSL` Set this to enable SSL
|
|
|
|
- `CONSUL_HTTP_SSL_VERIFY` Set this to disable certificate checking (not recommended)
|
2015-12-17 13:24:42 -05:00
|
|
|
|
2022-07-26 23:17:11 -07:00
|
|
|
#### API Options
|
2015-10-16 00:56:15 -07:00
|
|
|
|
2022-07-26 23:17:11 -07:00
|
|
|
@include 'http_api_options_client.mdx'
|