Skip to content

Commit 42980ee

Browse files
vikstrousjoaofnfernandes
authored andcommitted
document rethinkcli and remove old information (#1845)
* document rethinkcli and remove old information * document recovering from ha degraded mode #815 * fixes * fixes * Improve DTR troubleshoot instructions
1 parent 4d93d17 commit 42980ee

File tree

1 file changed

+58
-34
lines changed

1 file changed

+58
-34
lines changed

datacenter/dtr/2.2/guides/admin/monitor-and-troubleshoot/troubleshoot-with-logs.md

Lines changed: 58 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -4,61 +4,85 @@ keywords: docker, registry, monitor, troubleshoot
44
title: Troubleshoot Docker Trusted Registry
55
---
66

7-
<!-- TODO: review page for v2.2 -->
7+
This guide contains tips and tricks for troubleshooting DTR problems.
8+
9+
## Troubleshoot overlay networks
810

911
High availability in DTR depends on having overlay networking working in UCP.
10-
To manually test that overlay networking is working in UCP run the following
11-
commands on two different UCP machines.
12+
One way to test if overlay networks are working correctly you can deploy
13+
containers in different nodes, that are attached to the same overlay network
14+
and see if they can ping one another.
15+
16+
Use SSH to log into a UCP node, and run:
1217

1318
```none
14-
docker run -it --rm --net dtr-ol --name overlay-test1 --entrypoint sh docker/dtr
15-
docker run -it --rm --net dtr-ol --name overlay-test2 --entrypoint ping docker/dtr -c 3 overlay-test1
19+
docker run -it --rm \
20+
--net dtr-ol --name overlay-test1 \
21+
--entrypoint sh docker/dtr
1622
```
1723

18-
You can create new overlay network for this test with `docker network create -d overaly network-name`.
19-
You can also use any images that contain `sh` and `ping` for this test.
24+
Then use SSH to log into another UCP node and run:
2025

21-
If the second command succeeds, overlay networking is working.
26+
```none
27+
docker run -it --rm \
28+
--net dtr-ol --name overlay-test2 \
29+
--entrypoint ping docker/dtr -c 3 overlay-test1
30+
```
2231

23-
## DTR doesn't come up after a Docker restart
32+
If the second command succeeds, it means that overlay networking is working
33+
correctly.
2434

25-
This is a known issue with Docker restart policies when DTR is running on the same
26-
machine as a UCP controller. If this happens, you can simply restart the DTR replica
27-
from the UCP UI under "Applications". The best workaround right now is to not run
28-
DTR on the same node as a UCP controller.
35+
You can run this test with any overlay network, and any Docker image that has
36+
`sh` and `ping`.
2937

30-
## Etcd refuses to start after a Docker restart
3138

32-
If you see the following log message in etcd's logs after a DTR restart it means that
33-
your DTR replicas are on machines that don't have their clocks synchronized. Etcd requires
34-
synchronized clocks to function correctly.
39+
## Access RethinkDB directly
3540

36-
```
37-
2016-04-27 17:56:34.086748 W | rafthttp: the clock difference against peer aa4fdaf4c562342d is too high [8.484795885s > 1s]
38-
```
41+
DTR uses RethinkDB for persisting data and replicating it across replicas.
42+
It might be helpful to connect directly to the RethinkDB instance running on a
43+
DTR replica to check the DTR internal state.
3944

40-
## Accessing the RethinkDB Admin UI
45+
Use SSH to log into a node that is running a DTR replica, and run the following
46+
command, replacing `$REPLICA_ID` by the id of the DTR replica running on that
47+
node:
4148

42-
> Warning: This command will expose your database to the internet with no authentication. Use with caution.
49+
```none
50+
docker run -it --rm \
51+
--net dtr-ol \
52+
-v dtr-ca-$REPLICA_ID:/ca dockerhubenterprise/rethinkcli:v2.2.0 \
53+
$REPLICA_ID
54+
```
4355

44-
Run this on the UCP node that has a DTR replica with the given replica id:
56+
This starts an interactive prompt where you can run RethinkDB queries like:
4557

58+
```none
59+
> r.db('dtr2').table('repositories')
4660
```
47-
docker run --rm -it --net dtr-br -p 9999:8080 svendowideit/ambassador dtr-rethinkdb-$REPLICA_ID 8080
48-
```
4961

50-
Options to make this more secure:
62+
[Learn more about RethinkDB queries](https://www.rethinkdb.com/docs/guide/javascript/).
63+
64+
## Recover from an unhealthy replica
5165

52-
* Use `-p 127.0.0.1:9999:8080` to expose the admin UI only to localhost
53-
* Use an SSH tunnel in combination with exposing the port only to localhost
54-
* Use a firewall to limit which IPs are allowed to connect
55-
* Use a second proxy with TLS and basic auth to provide secure access over the Internet
66+
When a DTR replica is unhealthy or down, the DTR web UI displays a warning:
5667

57-
## Accessing etcd directly
68+
```none
69+
Warning: The following replicas are unhealthy: 59e4e9b0a254; Reasons: Replica reported health too long ago: 2017-02-18T01:11:20Z; Replicas 000000000000, 563f02aba617 are still healthy.
70+
```
5871

59-
You can execute etcd commands on a UCP node hosting a DTR replica using etcdctl
60-
via the following docker command:
72+
To fix this, you should remove the unhealthy replica from the DTR cluster,
73+
and join a new one. Start by running:
6174

75+
```none
76+
docker run -it --rm \
77+
{{ page.docker_image }} remove \
78+
--ucp-insecure-tls
6279
```
63-
docker run --rm -v dtr-ca-$REPLICA_ID:/ca --net dtr-br -it --entrypoint /etcdctl docker/dtr-etcd:v2.2.4 --endpoint https://dtr-etcd-$REPLICA_ID.dtr-br:2379 --ca-file /ca/etcd/cert.pem --key-file /ca/etcd-client/key.pem --cert-file /ca/etcd-client/cert.pem
80+
81+
And then:
82+
83+
```none
84+
docker run -it --rm \
85+
{{ page.docker_image }} join \
86+
--ucp-node <ucp-node-name> \
87+
--ucp-insecure-tls
6488
```

0 commit comments

Comments
 (0)