Skip to content

Commit

Permalink
add hcdiag tutorial
Browse files Browse the repository at this point in the history
  • Loading branch information
eddie-rowe committed Dec 15, 2021
1 parent 6348270 commit ef1ca7d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 51 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ Specifically, the following articles and collections are currently supported by

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

- [Use hcdiag with Consul](https://learn.hashicorp.com/tutorials/consul/hcdiag-with-consul)

# Additional Assets

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.
53 changes: 2 additions & 51 deletions datacenter-deploy-hcdiag/README.md
Original file line number Diff line number Diff line change
@@ -1,52 +1,3 @@
## Overview
## Tutorial URL

Deploy a Consul datacenter containing agents with a preconfigured DNS service and health check.

## Prerequisites

- Docker
- Docker Compose

## Deployment procedure

1. Clone [learn-consul-docker](https://github.com/hashicorp/learn-consul-docker) repository.
2. Navigate to this directory.
3. `docker-compose up -d`

## Testing procedure

1. Open an interactive shell to a Consul server:
1. `docker exec -it consul-server1 /bin/sh`
2. Set environment variables:
1. `export CONSUL_HTTP_ADDR=http://127.0.0.1:8500`
2. `export CONSUL_HTTP_TOKEN=my-master-token`
3. `export CONSUL_TOKEN=my-master-token`
3. Check to see if all clients have successfully joined the Consul datacenter:
1. `consul members`
2. `curl http://127.0.0.1:8500/v1/agent/members --header "X-Consul-Token: my-master-token"`
4. Update package sources;
1. `apk update`
5. Add curl and unzup packages:
1. `apk add curl unzip`
6. Download hcdiag:
1. `curl --silent --remote-name https://releases.hashicorp.com/hcdiag/0.1.1/hcdiag_0.1.1_linux_amd64.zip`
7. Unzip hcdiag and remove the archive:
1. `unzip hcdiag_0.1.1_linux_amd64.zip && rm -f hcdiag_0.1.1_linux_amd64.zip`
8. Move the hcdiag executable to your sbin directory:
1. `mv hcdiag sbin/`
9. Run hcdiag for consul:
2. `hcdiag -consul`
3. Let it run until completion
10. Look for the support package
4. `ls -l *.gz`
11. Unpack the archive:
5. `tar zxvf support-2021-12-10T20:47:55Z.tar.gz`
12. Change directory into the unpacked folder:
1. `cd temp495511880/`
13. Examine the contents
14. Exit the terminal: `exit`

## Additional information

- [https://github.com/hashicorp/hcdiag](https://github.com/hashicorp/hcdiag)
- [https://learn.hashicorp.com/tutorials/consul/troubleshooting](https://learn.hashicorp.com/tutorials/consul/troubleshooting)
https://learn.hashicorp.com/tutorials/consul/hcdiag-with-consul

0 comments on commit ef1ca7d

Please sign in to comment.