리눅스 (1603) 썸네일형 리스트형 HashiCorp Consul KV 사용하는 방법 HashiCorp Consul KV 사용하는 방법(CLI · REST API · consul-template)Consul은 단순 Key-Value 저장소 이상의 기능을 제공하지만 그중 가장 기본이자 많이 사용되는 기능이 바로 KV(Key-Value) Store입니다. 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 documentati.. [리눅스] 리눅스에서 CPU 사용률을 계산하고, 소수점 2자리까지 출력하는 쉘 스크립트 예제 - by ChatGPT 리눅스에서 CPU 사용률을 계산하고, 소수점 2자리까지 출력하는 쉘 스크립트 예제 vim cpu-usage.sh #!/bin/bash # Get the CPU statistics from /proc/stat file cpu_stats=(`cat /proc/stat | grep '^cpu '`) # Calculate the total CPU time. total_cpu_time=0 for stat in "${cpu_stats[@]:1}"; do total_cpu_time=$((total_cpu_time + stat)) done # Calculate the CPU idle time. cpu_idle_time=${cpu_stats[4]} # Calculate the CPU usage percentage. cp.. consul 서비스 등록 - 2 consul 서비스 등록consul nodescurl -s localhost:8500/v1/catalog/nodes | jqconsul nodes leadercurl -s localhost:8500/v1/status/leaderconsul members address listcurl -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.. java(jdk) 설치 및 java 환경 설정 java(jdk) 설치 및 java 환경 설정테스트 환경운영체제 버전 정보$ cat /etc/redhat-release CentOS Linux release 7.8.2003 (Core)$ getconf LONG_BIT64 java downloads(java archive)- Java SE 17 Archive Downloadsjava(jdk) 설치java 파일 다운로드wget https://download.oracle.com/java/17/archive/jdk-17.0.6_linux-x64_bin.tar.gz -O /tmp/jdk-17.0.6_linux-x64_bin.tar.gzjava 압축 풀기tar xfz /tmp/jdk-17.0.6_linux-x64_bin.tar.gz -C /usr/local/jav.. Pacemaker와 Corosync를 사용하여 NGINX의 고가용성 설정을 구성하는 방법 Pacemaker와 Corosync를 사용하여 NGINX의 고가용성(HA) 설정을 구성하는 방법테스트 환경호스트 이름서버 아이피도메인운영체제비고VIP192.168.0.60vip.cluster.local control1192.168.0.51control1.cluster.localUbuntu 22.04 LTS node3192.168.0.63node3.cluster.localUbuntu 22.04 LTS NGINX 설치curl -fsSL https://nginx.org/keys/nginx_signing.key | gpg --dearmor \ | sudo tee /usr/share/keyrings/nginx-archive-keyring.gpg >/dev/nullecho "deb [signed-by=/us.. 우분투에서 Pacemaker와 VIP(Virtual IP)를 구성하여 고가용성 클러스터를 운영하는 방법 우분투에서 Pacemaker와 Virtual IP(VIP)를 구성하여 고가용성 클러스터를 운영하는 방법 Corosync는 클러스터 통신을 담당하며 Pacemaker는 자원 관리와 클러스터 관리를 수행합니다. PCS는 구성 및 모니터링 도구로서 클러스터 관리를 단순화합니다. 더보기 --- Corosync 클러스터 통신 소프트웨어 : Corosync는 여러 노드 간에 클러스터 구성 정보 및 상태 정보를 안정적으로 교환하기 위한 클러스터 통신 소프트웨어입니다. 확장성과 신뢰성 : Corosync는 클러스터 환경에서 확장성과 신뢰성을 제공하며, 클러스터 간의 안정적인 통신을 가능하게 합니다. 패싱 관리 : Corosync는 클러스터 내에서 데이터 패싱 및 동기화를 처리하여 클러스터 노드 간의 데이터 일관성을 유.. consul-template 설치(install consul-template) consul-template 설치(install consul-template)consul-template 바이너리 파일로 설치consul-template releases : https://releases.hashicorp.com/consul-templatecurl -sSL https://releases.hashicorp.com/consul-template/0.30.0/consul-template_0.30.0_linux_amd64.zip -o /tmp/consul-template.zipunzip /tmp/consul-template.zip -d /tmp/chmod +x /tmp/consul-templatemv /tmp/consul-template /usr/local/bin/consul-templatecon.. 유닉스 타임스탬프 간의 변환 방법 유닉스 타임스탬프 간의 변환 방법(unix timestamp converter)** Epoch 또는 Unix 타임스탬프는 1970년 1월 1일 00:00 UTC 이후 지난 시간(초)입니다.날짜를 유닉스 타임스탬프로 변환(date → unix time)date 명령어를 사용하여 특정 날짜와 시간을 유닉스 타임스탬프로 변환할 수 있습니다.date -d "2023-01-02 03:04:05" +%s$ date -d "2023-01-02 03:04:05" +%s1672596245유닉스 타임스탬프를 날짜로 변환(unix time → date)로컬 날짜 형식으로 변환date 명령어를 사용하여 유닉스 타임스탬프를 로컬 날짜 형식으로 변환할 수 있습니다.date -d @1672596245$ date -d @167259.. 이전 1 ··· 92 93 94 95 96 97 98 ··· 201 다음