https://github.com/tkuchiki/haproxy-external-check
https://github.com/tkuchiki/haproxy-external-check
docker haproxy testing
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/tkuchiki/haproxy-external-check
- Owner: tkuchiki
- License: mit
- Created: 2017-05-16T03:47:25.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-05-17T03:14:11.000Z (about 8 years ago)
- Last Synced: 2025-01-25T09:11:07.746Z (4 months ago)
- Topics: docker, haproxy, testing
- Language: Shell
- Size: 1.95 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# haproxy-external-check
## build
```console
$ docker-compose build
```## run
```console
$ docker-compose up -d
```## example
```console
# docker host
$ docker exec -it $(docker ps | grep _haproxy | awk '{print $1}') /bin/bash#
$ curl -X PUT -d "maintenance" http://consul:8500/v1/kv/db_maintenance/slave1
true$ tail /var/log/haproxy.log
...
May 16 07:22:24 localhost haproxy[1]: Server b_mysql_slave/slave1 is DOWN, reason: External check error, code: 1, check duration: 14ms. 1 active and 0 backup servers left. 0 sessions active, 0 requeued, 0 remaining in queue.
May 16 07:22:24 localhost haproxy[1]: Server b_mysql_slave/slave1 is DOWN, reason: External check error, code: 1, check duration: 14ms. 1 active and 0 backup servers left. 0 sessions active, 0 requeued, 0 remaining in queue.
...$ curl -X DELETE http://consul:8500/v1/kv/db_maintenance/slave1
true$ tail /var/log/haproxy.log
...
May 16 07:24:20 localhost haproxy[1]: Server b_mysql_slave/slave1 is UP, reason: External check passed, code: 0, check duration: 17ms. 2 active and 0 backup servers online. 0 sessions requeued, 0 total in queue.
May 16 07:24:20 localhost haproxy[1]: Server b_mysql_slave/slave1 is UP, reason: External check passed, code: 0, check duration: 17ms. 2 active and 0 backup servers online. 0 sessions requeued, 0 total in queue.
...
```