2015-10-16 07:03:16 +00:00
|
|
|
---
|
|
|
|
layout: "docs"
|
|
|
|
page_title: "Commands: RTT"
|
|
|
|
sidebar_current: "docs-commands-rtt"
|
|
|
|
description: >
|
2015-10-16 07:56:15 +00:00
|
|
|
The rtt command estimates the network round trip time between two nodes.
|
2015-10-16 07:03:16 +00:00
|
|
|
---
|
|
|
|
|
|
|
|
# Consul RTT
|
|
|
|
|
|
|
|
Command: `consul rtt`
|
|
|
|
|
2015-10-22 00:29:43 +00:00
|
|
|
The `rtt` command estimates the network round trip time between two nodes using
|
|
|
|
Consul's network coordinate model of the cluster.
|
|
|
|
|
|
|
|
See the [Network Coordinates](/docs/internals/coordinates.html) internals guide
|
|
|
|
for more information on how these coordinates are computed.
|
2015-10-16 07:03:16 +00:00
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
2015-10-16 19:45:25 +00:00
|
|
|
Usage: `consul rtt [options] node1 [node2]`
|
2015-10-16 07:03:16 +00:00
|
|
|
|
2015-10-16 19:45:25 +00:00
|
|
|
At least one node name is required. If the second node name isn't given, it
|
|
|
|
is set to the agent's node name. Note that these are node names as known to
|
2015-10-16 07:03:16 +00:00
|
|
|
Consul as `consul members` would show, not IP addresses.
|
|
|
|
|
|
|
|
The list of available flags are:
|
|
|
|
|
|
|
|
* `-wan` - Instructs the command to use WAN coordinates instead of LAN
|
2015-10-16 19:45:25 +00: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-22 00:29:43 +00:00
|
|
|
and the datacenter (eg. "myserver.dc1"). It is not possible to measure between
|
|
|
|
LAN coordinates and WAN coordinates, so both nodes must be in the same pool.
|
|
|
|
|
2015-10-16 07:56:15 +00:00
|
|
|
|
2015-10-16 07:03:16 +00:00
|
|
|
* `-http-addr` - Address to the HTTP server of the agent you want to contact
|
|
|
|
to send this command. If this isn't specified, the command will contact
|
|
|
|
"127.0.0.1:8500" which is the default HTTP address of a Consul agent.
|
|
|
|
|
2015-12-17 18:24:42 +00:00
|
|
|
To use https, you need to set environment variables:
|
|
|
|
|
|
|
|
* `CONSUL_HTTP_SSL` to enabled SSL
|
|
|
|
* `CONSUL_HTTP_SSL_VERIFY` to disabled https certificate
|
|
|
|
|
2015-10-16 07:03:16 +00:00
|
|
|
## Output
|
|
|
|
|
|
|
|
If coordinates are available, the command will print the estimated round trip
|
2015-10-16 07:56:15 +00:00
|
|
|
time between the given nodes:
|
2015-10-16 07:03:16 +00:00
|
|
|
|
|
|
|
```
|
|
|
|
$ consul rtt n1 n2
|
2015-10-16 19:45:25 +00:00
|
|
|
Estimated n1 <-> n2 rtt: 0.610 ms (using LAN coordinates)
|
2015-10-16 07:03:16 +00:00
|
|
|
|
2015-10-16 19:45:25 +00:00
|
|
|
$ consul rtt n2 # Running from n1
|
|
|
|
Estimated n1 <-> n2 rtt: 0.610 ms (using LAN coordinates)
|
2015-10-16 07:56:15 +00:00
|
|
|
|
2015-10-16 19:45:25 +00:00
|
|
|
$ consul rtt -wan n1.dc1 n2.dc2
|
|
|
|
Estimated n1.dc1 <-> n2.dc2 rtt: 1.275 ms (using WAN coordinates)
|
2015-10-16 07:03:16 +00:00
|
|
|
```
|