본문 바로가기

반응형

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 cluster 구성 consul cluster 구성 테스트 환경 호스트 이름 서버 아이피 Type 비고 control1 192.168.0.51 server node1 192.168.0.61 server node2 192.168.0.62 server node3 192.168.0.63 client consul 설치 - consul 설치 : https://scbyun.com/1490 consul cluster 구성 consul.hcl 설정(/etc/consul.d/consul.hcl) vim /etc/consul.d/consul.hcl [control1-consul.hcl] datacenter = "my-dc-1" data_dir = "/opt/consul" client_addr = "0.0.0.0" ui_config{ enab.. 더보기
[리눅스] consul 설치(install consul) consul 설치(install consul) consul ports table Use Default Ports DNS: The DNS server (TCP and UDP) 8600 HTTP: The HTTP API (TCP Only) 8500 HTTPS: The HTTPs API disabled (8501)* gRPC: The gRPC API disabled (8502)* LAN Serf: The Serf LAN port (TCP and UDP) 8301 Wan Serf: The Serf WAN port (TCP and UDP) 8302 server: Server RPC address (TCP Only) 8300 Sidecar Proxy Min: 자동으로 할당된 사이드카 서비스 등록에 사용할 포함된 최.. 더보기

728x90
반응형