github enterprise 백업 및 복구(backup & restore)

 

 

백업 유틸리티 다운로드

 

백업, 복구를 위해선 github 백업 유틸리티가 필요합니다.

아래 링크를 통해 원하시는 버전을 다운로드하시면 됩니다.

https://github.com/github/backup-utils/releases

 

Releases · github/backup-utils

GitHub Enterprise Backup Utilities. Contribute to github/backup-utils development by creating an account on GitHub.

github.com

 

참고로, 백업 유틸리티는 하위 두개 버전까지만 지원합니다.

즉, 3.3.2 버전을 사용하시는 경우

github enterprise  3.1.x 버전까지만 사용이 가능합니다.(3.0.x 불가능)

 

 

사전작업

 

- git 설치

- rsnc 설치 및 enable로 변경

- ssh key 등록

   - backup, resotre를 진행할 서버에 패스워드 없이 접속이 가능해야 하기 때문에  key 등록 필요.

 

 

 백업 유틸리티 기본 설정

 

다운을 받으셨으면 파일이 있는 위치로 이동 후 압축파일을 풀어줍니다

$ tar -xvf [백업 유티리티 파일]

 

 

압축푼 파일을 보시면 backup.config-example 파일이 있을 겁니다

해당 파일을 backup.config으로 파일이름을 변경해 주시고

$ tar -xvf [유틸리티 파일]
$ mv backup.config-example backup.config

 

vi로 파일을 열어줍니다

$ vi backup.config

 

기본적인 설정 항목은 아래와 같습니다

각 항목에 맞는 정보를 기입하시면 됩니다.

GHE_HOSTNAME="[마스터 서버 IP 또는 도메인]"
GHE_DATA_DIR="[백업받을 경로 지정]"
GHE_NUM_SNAPSHOTS=[백업을 몇벌 받을지 기입]
GHE_RESTORE_HOST="[restore할 서버 IP 또는 도메인 지정]"

 

 

 

백업하기

 

ghe-backup 명령어를 통해 백업을 진행하시면 됩니다

위치는 압축푼 디렉토리 내에 bin 디렉토리 하위에 있습니다.

$ ghe-backup
Starting backup of github.test.com with backup-utils v3.3.2 in snapshot 20220214T0802123
Connect github.test.com:122 OK (v3.3.19)
Backing up GitHub settings ...
Backing up SSH authorized keys ...
Backing up SSH host keys ...
Backing up MySQL database using binary backup strategy ...
Backing up Redis database ...
Backing up audit log ...
Backing up Git repositories ...
Backing up GitHub Pages artifacts ...
Backing up storage data ...
Backing up custom Git hooks ...
Backing up Elasticsearch indices ...
Pruning 1 expired snapshot(s) ...
Completed backup of github.test.com:122 in snapshot 20220214T0802123 at 08:10:00

 

 

restore 하기

 

마찬가지로, ghe-restore 명령어를 통해 복구를 진행하시면 됩니다

참고로, 복구 진행에 앞서 점검모드(maintenance)로 전환한 상태에서 진행해 주셔야 합니다.

$ ghe-restore
Starting restore of github2.test.com:122 with backup-utils v3.3.2 from snapshot 202320410T174501
Stopping cron and github-timerd ...
Restoring UUID ...
Restoring MySQL database from binary backup snapshot on an appliance configured for binary backups ...
Restoring Redis database ...
Restoring Git repositories ...
Restoring Gists ...
Restoring GitHub Pages artifacts ...
Restoring SSH authorized keys ...
Restoring storage data ...
Restoring custom Git hooks ...
Restoring Elasticsearch indices ...
Restoring Audit logs ...
Configuring appliance ...
Starting cron ...
Restoring SSH host keys ...
End time: 1683769765
Runtime: 4942 seconds
Restore of github2.test.com:122 from snapshot 202320410T174501 finished.

댓글

Designed by JB FACTORY

loading