백업 방법
1. 스냅샷 생성
1) 비보안 엔드포인트
$ ETCDCTL_API=3 etcdctl --endpoint=https://127.0.0.1:2379 snapshot save /path/to/backup/snapshot.db
2) 보안 엔드포인트
$ ETCDCTL_API=3 etcdctl --endpoint=https://127.0.0.1:2379 \
--cacert=$CACERT --cert=$CERT --key=$KEY \
snapshot save /path/to/backup/snapshot.db
2. 스냅샷 검증
$ etcdctl --write-out=table snapshot status
출력 HASH, RVISION, TOTAL KEYS, TOTAL SIZE 확인
복원 방법
1. 스냅샷 복원
1) 기본 명령어
$ etcdctl snapshot restore /path/to/backup/snapshot.db --data-dir /new/data/dir
--data-dir: 새 데이터 경로
해시 검증 스킵: --skip-hash-check 옵션 추가
2) Kubernetes 적용
- ETCD 매니페스트 업데이트: /etc/kubernetes/manifests/etcd.yaml 에서 volumes.hostpath.path를 새 데이터 디렉토리로 변경
- ETCD pod 재시작
- API 서버 재구성: 엔드포인트 변경 시 kube-apiserver의 --etcd-servers 플래그 업데이트(/etc/kubernetes/manifests/kube-apiserver.yaml)
- etcdctl member list로 클러스터 상태 확인.
'K8S' 카테고리의 다른 글
| ETCD 기본 동작 원리의 이해 (0) | 2025.12.08 |
|---|---|
| ETCD 명령어 정리 (0) | 2025.12.08 |
| [K8S] Disk io 바운더리로 인해 데이터 처리 속도 저하 (0) | 2025.08.26 |
| [K8S] Multi scheduler (0) | 2025.08.21 |
| [K8S] Priority classes (0) | 2025.08.19 |