반응형
consul 서비스 등록
consul nodes
curl -s localhost:8500/v1/catalog/nodes | jq
consul nodes leader
curl -s localhost:8500/v1/status/leader
consul members address list
curl -s http://127.0.0.1:8500/v1/agent/members | jq -r '.[].Addr'
consul domain 확인(ptr 레코드 질의)
dig @127.0.0.1 -p 8600 -x {Consul Member IP}
dig @127.0.0.1 -p 8600 -x {Consul Member IP}
CONSUL CLIENT ADDRESS(local ip)
export CONSUL_CLIENT_ADDRESS=`ip route get 1.2.3.4 | awk '{ print $7 }' | egrep -v '^$'`
echo $CONSUL_CLIENT_ADDRESS
Agent HTTP API
register
curl -XPUT http://${CONSUL_CLIENT_ADDRESS}:8500/v1/agent/service/register -d '{ "ID": "web1", "Name": "web1", "Address": "www.google.com", "Meta": {"google_path":"/", "google_ssl":"true" }, "Port": 443}'
agent -services
curl -s http://${CONSUL_CLIENT_ADDRESS}:8500/v1/catalog/services | jq
agent -services
curl -s http://${CONSUL_CLIENT_ADDRESS}:8500/v1/agent/services | jq
curl -s http://${CONSUL_CLIENT_ADDRESS}:8500/v1/agent/service/web | jq
agent -health -service
curl -s http://${CONSUL_CLIENT_ADDRESS}:8500/v1/agent/health/service/name/web | jq
agent -checks
curl -s http://${CONSUL_CLIENT_ADDRESS}:8500/v1/agent/checks | jq
deregister
curl -XPUT http://${CONSUL_CLIENT_ADDRESS}:8500/v1/agent/service/deregister/web1
참고URL
- Consul Health Checks : https://developer.hashicorp.com/consul/docs/discovery/checks
728x90
반응형
'리눅스' 카테고리의 다른 글
[리눅스] consul kv (0) | 2023.02.14 |
---|---|
[리눅스] 리눅스에서 CPU 사용률을 계산하고, 소수점 2자리까지 출력하는 쉘 스크립트 예제 - by ChatGPT (0) | 2023.02.13 |
java(jdk) 설치 및 java 환경 설정 (0) | 2023.02.07 |
Pacemaker와 Corosync를 사용하여 NGINX의 고가용성 설정을 구성하는 방법 (0) | 2023.02.07 |
우분투에서 Pacemaker와 VIP(Virtual IP)를 구성하여 고가용성 클러스터를 운영하는 방법 (0) | 2023.02.06 |