Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pmalek/consul-go-example
https://github.com/pmalek/consul-go-example
consul go golang
Last synced: 23 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/pmalek/consul-go-example
- Owner: pmalek
- License: mit
- Created: 2020-03-11T12:47:00.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-03-11T12:51:29.000Z (almost 5 years ago)
- Last Synced: 2024-10-29T10:52:27.651Z (2 months ago)
- Topics: consul, go, golang
- Language: Go
- Size: 11.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Consul service
This repo contains a simple Go backend comprised of:
* 1 frontend facing service `web`
* 1 backend service `backend``web` uses Consul for service discovery to connect to `backend` instances and
issue requests against it.
Several Consul checks are also registered with Consul agent:* TTL based checks which are basically heartbeats issued from services towards
Consul agent
* HTTP healthecks which are basically HTTP requests issues from the Consul agent
against defined services' healthcheck endpointsTo observe the state of the system please open http://localhost:8500/ in your
browser.## How to run
```
docker-compose up -d
```Optionally one can dynamically adjust number of backend services to observe how they
dynamically register and deregister with Consul agent.```
docker-compose up --no-recreate -d --scale backend=5
```## How to teardown
```
docker-compose down --remove-orphans
```