|
1 | | -## Overview |
| 1 | +## Tutorial URL |
2 | 2 |
|
3 | | -Deploy a Consul datacenter containing agents with a preconfigured DNS service and health check. |
4 | | - |
5 | | -## Prerequisites |
6 | | - |
7 | | -- Docker |
8 | | -- Docker Compose |
9 | | - |
10 | | -## Deployment procedure |
11 | | - |
12 | | -1. Clone [learn-consul-docker](https://github.com/hashicorp/learn-consul-docker) repository. |
13 | | -2. Navigate to this directory. |
14 | | -3. `docker-compose up -d` |
15 | | - |
16 | | -## Testing procedure |
17 | | - |
18 | | -1. Open an interactive shell to a Consul server: |
19 | | - 1. `docker exec -it consul-server1 /bin/sh` |
20 | | -2. Set environment variables: |
21 | | - 1. `export CONSUL_HTTP_ADDR=http://127.0.0.1:8500` |
22 | | - 2. `export CONSUL_HTTP_TOKEN=my-master-token` |
23 | | - 3. `export CONSUL_TOKEN=my-master-token` |
24 | | -3. Check to see if all clients have successfully joined the Consul datacenter: |
25 | | - 1. `consul members` |
26 | | - 2. `curl http://127.0.0.1:8500/v1/agent/members --header "X-Consul-Token: my-master-token"` |
27 | | -4. Update package sources; |
28 | | - 1. `apk update` |
29 | | -5. Add curl and unzup packages: |
30 | | - 1. `apk add curl unzip` |
31 | | -6. Download hcdiag: |
32 | | - 1. `curl --silent --remote-name https://releases.hashicorp.com/hcdiag/0.1.1/hcdiag_0.1.1_linux_amd64.zip` |
33 | | -7. Unzip hcdiag and remove the archive: |
34 | | - 1. `unzip hcdiag_0.1.1_linux_amd64.zip && rm -f hcdiag_0.1.1_linux_amd64.zip` |
35 | | -8. Move the hcdiag executable to your sbin directory: |
36 | | - 1. `mv hcdiag sbin/` |
37 | | -9. Run hcdiag for consul: |
38 | | - 2. `hcdiag -consul` |
39 | | - 3. Let it run until completion |
40 | | -10. Look for the support package |
41 | | - 4. `ls -l *.gz` |
42 | | -11. Unpack the archive: |
43 | | - 5. `tar zxvf support-2021-12-10T20:47:55Z.tar.gz` |
44 | | -12. Change directory into the unpacked folder: |
45 | | - 1. `cd temp495511880/` |
46 | | -13. Examine the contents |
47 | | -14. Exit the terminal: `exit` |
48 | | - |
49 | | -## Additional information |
50 | | - |
51 | | -- [https://github.com/hashicorp/hcdiag](https://github.com/hashicorp/hcdiag) |
52 | | -- [https://learn.hashicorp.com/tutorials/consul/troubleshooting](https://learn.hashicorp.com/tutorials/consul/troubleshooting) |
| 3 | +https://learn.hashicorp.com/tutorials/consul/hcdiag-with-consul |
0 commit comments