etcdctl 설치

ETCD_VER=v3.5.9  # 최신 버전 확인 후 필요 시 변경

# 다운로드 및 압축 해제
wget https://github.com/etcd-io/etcd/releases/download/${ETCD_VER}/etcd-${ETCD_VER}-linux-amd64.tar.gz
tar xvf etcd-${ETCD_VER}-linux-amd64.tar.gz

# 실행 파일을 /usr/local/bin으로 이동
sudo mv etcd-${ETCD_VER}-linux-amd64/etcdctl /usr/local/bin/

# 설치 확인
etcdctl version

 

 

v3.5.20 amd64 패키지

 

https://github.com/etcd-io/etcd/releases/download/v3.5.20/etcd-v3.5.20-linux-amd64.tar.gz

 

v3.5.20 arm64 (mac os) 패키지

https://github.com/etcd-io/etcd/releases/download/v3.5.20/etcd-v3.5.20-linux-arm64.tar.gz

 

etcd 멤버 확인

export ETCDCTL_API=3
export ENDPOINTS="https://127.0.0.1:2379"
export CERT_PATH="/etc/kubernetes/pki/etcd"
export ETCDCTL_CACERT="${CERT_PATH}/ca.crt"
export ETCDCTL_CERT="${CERT_PATH}/peer.crt"
export ETCDCTL_KEY="${CERT_PATH}/peer.key"

etcdctl member list

etcd 리더 확인

export ETCDCTL_API=3
export ENDPOINTS="https://127.0.0.1:2379"
export CERT_PATH="/etc/kubernetes/pki/etcd"
export ETCDCTL_CACERT="${CERT_PATH}/ca.crt"
export ETCDCTL_CERT="${CERT_PATH}/peer.crt"
export ETCDCTL_KEY="${CERT_PATH}/peer.key"

etcdctl endpoint status --write-out=table

 

 

 

 

etcd 백업

wget https://github.com/etcd-io/etcd/releases/download/v3.5.19/etcd-v3.5.19-linux-arm64.tar.gz

 

sudo etcdctl snapshot save etcd-snapshot.db --endpoints=https://127.0.0.1:2379 --cacert=./ca.crt --cert=./healthcheck-client.crt --key=./healthcheck-client.key

{"level":"info","ts":"2025-03-17T15:16:59.834146+0900","caller":"snapshot/v3_snapshot.go:65","msg":"created temporary db file","path":"etcd-snapshot.db.part"}
{"level":"info","ts":"2025-03-17T15:16:59.838007+0900","logger":"client","caller":"v3@v3.5.19/maintenance.go:212","msg":"opened snapshot stream; downloading"}
{"level":"info","ts":"2025-03-17T15:16:59.838848+0900","caller":"snapshot/v3_snapshot.go:73","msg":"fetching snapshot","endpoint":"https://127.0.0.1:2379"}
{"level":"info","ts":"2025-03-17T15:16:59.895353+0900","logger":"client","caller":"v3@v3.5.19/maintenance.go:220","msg":"completed snapshot read; closing"}
{"level":"info","ts":"2025-03-17T15:16:59.899929+0900","caller":"snapshot/v3_snapshot.go:88","msg":"fetched snapshot","endpoint":"https://127.0.0.1:2379","size":"4.1 MB","took":"now"}
{"level":"info","ts":"2025-03-17T15:16:59.900198+0900","caller":"snapshot/v3_snapshot.go:97","msg":"saved","path":"etcd-snapshot.db"}
Snapshot saved at etcd-snapshot.db

 

sudo etcdctl --write-out=table snapshot status etcd-snapshot.db

+----------+----------+------------+------------+
|   HASH   | REVISION | TOTAL KEYS | TOTAL SIZE |
+----------+----------+------------+------------+
| f1b95c40 |    84533 |       1394 |     4.1 MB |
+----------+----------+------------+------------+

 

'Kubernetes > Tool' 카테고리의 다른 글

install kubenetes  (0) 2025.03.04
Kustomize (외부자료)  (0) 2025.02.28
Helm (외부자료)  (0) 2025.02.27
(1) KIND란?  (0) 2025.01.24
(2) KIND 활용 예제 MSA 샘플  (0) 2025.01.24

+ Recent posts