Skip to content

Commit ef1ca7d

Browse files
committed
add hcdiag tutorial
1 parent 6348270 commit ef1ca7d

File tree

2 files changed

+4
-51
lines changed

2 files changed

+4
-51
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ Specifically, the following articles and collections are currently supported by
1414

1515
- [Automate Consul Agent Security with Auto Config](https://learn.hashicorp.com/tutorials/consul/docker-compose-auto-config)
1616

17+
- [Use hcdiag with Consul](https://learn.hashicorp.com/tutorials/consul/hcdiag-with-consul)
18+
1719
# Additional Assets
1820

1921
This repository also contains quick start Docker Compose assets that can be used to deploy Consul in various configurations. Rather than a supporting tutorial, a README file is included that will walk you through steps that will highlight various Consul concepts and scenarios.

datacenter-deploy-hcdiag/README.md

Lines changed: 2 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,3 @@
1-
## Overview
1+
## Tutorial URL
22

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

Comments
 (0)