본문 바로가기

728x90

consul

[리눅스] consul-template 파일 생성 consul-template 파일 생성 데이터 추가(키 등록) consul kv put web/server/config/webserv1-hostname webserv1 consul kv put web/server/config/webserv1-ip 1.1.1.1 webconfig.json.tmpl 파일 생성 vim webconfig.json.tmpl server_hostname: {{ key "web/server/config/webserv1-hostname" }} server_ip: {{ key "web/server/config/webserv1-ip" }} consul-template 명령 실행 consul-template -template "webconfig.json.tmpl:webconfig.json".. 더보기
[리눅스] consul kv consul kv consul 사용법 $ consul kv Usage: consul kv [options] [args] This command has subcommands for interacting with Consul's key-value store. Here are some simple examples, and more detailed examples are available in the subcommands or the documentation. Create or update the key named "redis/config/connections" with the value "5": $ consul kv put redis/config/connections 5 Read this value back:.. 더보기
[리눅스] consul 서비스 등록 - 2 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_.. 더보기
[리눅스] consul-template 설치(install consul-template) consul-template 설치(install consul-template) consul-template 바이너리 파일로 설치 consul-template releases : https://releases.hashicorp.com/consul-template curl -sSL https://releases.hashicorp.com/consul-template/0.30.0/consul-template_0.30.0_linux_amd64.zip -o /tmp/consul-template.zip unzip /tmp/consul-template.zip -d /tmp/ chmod +x /tmp/consul-template mv /tmp/consul-template /usr/local/bin/consul-templ.. 더보기
[리눅스] consul 보안(security credentials) 설정 consul 보안(security credentials) 설정 consul 컨테이너 실행 docker run -it --rm -v ${PWD}/consul/certs:/consul/config/certs/ consul:latest /bin/sh --- docker container start cd /consul/config/certs consul gossip 암호화 키 생성 consul keygen $ consul keygen ozAzxQlvUHL3Qr0hhW2ibUxSa4B+M6RDz2bTC8OOsN0= consul.hcl 설정 vim /etc/consul.d/consul.hcl ... # bootstrap_expect bootstrap_expect = 3 # encrypt # Specifies the.. 더보기
[리눅스] consul 서비스 등록 consul 서비스 등록 consul agent 환경 설정(consul.hcl) vim /etc/consul.d/consul.hcl datacenter = "my-dc-1" data_dir = "/opt/consul" bind_addr = "0.0.0.0" # Listen on all IPv4 advertise_addr = "192.168.0.63" retry_join = ["control1", "node1", "node2"] /etc/consul.d /opt/consul/services/ web-service.hcl 편집 cd /etc/consul.d $ ls consul.env consul.hcl web-service.hcl vim web-service.hcl service { name = "web .. 더보기
Consul 클러스터를 구성하는 방법 Consul 클러스터를 구성하는 방법테스트 환경호스트 이름서버 아이피Type비고node111192.168.10.111server node112192.168.10.112server node113192.168.10.113server haproxy100192.168.10.110client 1. 각 서버 노드에 Consul 설치consul 설치 : https://scbyun.com/14902. Consul 클러스터를 구성호스트 파일 설정sudo tee -a /etc/hosts > /dev/null Consul 설정 파일 작성consul.hcl 설정(/etc/consul.d/consul.hcl)각 서버 노드에 대해 설정 파일을 작성합니다.vim /etc/consul.d/consul.hclnode111sudo te.. 더보기
우분투에 Consul을 설치하고 설정하는 방법 우분투에 Consul을 설치하고 설정하는 방법(install consul)consul ports tableUseDefault PortsDNS: The DNS server (TCP and UDP)8600HTTP: The HTTP API (TCP Only)8500HTTPS: The HTTPs APIdisabled (8501)*gRPC: The gRPC APIdisabled (8502)*LAN Serf: The Serf LAN port (TCP and UDP)8301Wan Serf: The Serf WAN port (TCP and UDP)8302server: Server RPC address (TCP Only)8300Sidecar Proxy Min: 자동으로 할당된 사이드카 서비스 등록에 사용할 포함된 최소 .. 더보기

반응형