문서의 이전 판입니다!
RHEV 3.6 Backup / Restore
— 이강우 2016/04/16 01:10
백업 절차
[root@host]# engine-backup --scope=all --mode=backup --file=BACKUP_FILE --log=LOG_FILE
복구 절차
[root@host]# service ovirt-engine stop [root@host]# engine-cleanup [root@host]# su - postgres -c psql alter role engine encrypted password 'PASSWORD'; [root@host]# engine-backup --mode=restore --scope=all --file=BACKUP_FILE --log=LOG_FILE --change-db-credentials --db-host=localhost --db-name=engine --db-user=engine --db-password --restore-permissions [root@host]# engine-setup
script
본 스크립트 파일은 위의 절차를 예제로 만들어본 것 뿐으로서 정확한 조건하에서만 정상적으로 동작합니다.
따라서 본 스크립트는 참고용으로만 사용할것을 권장드리며 위의 절차대로 한단계씩 테스트 해보시기 바랍니다.
#!/bin/bash # Usage : restore.sh DB_PASS RESTORE_FILE # if [ $# -ne 2 ] then echo "Usage : restore.sh <DB_PASS> <RESTORE_FILE>"; exit 1; fi PASSWORD=$1 RESTORE_FILE=$2 ####### check daemon echo "check ovirt-engine daemon..." service ovirt-engine status if [ $? -ne 3 ] then echo "Service ovirt-engine is not stopped."; echo "Service ovirt-engine daemon MUST stop."; echo "Exit"; exit 1; fi engine-cleanup << EOF yes ok ok EOF if [ $? -ne 0 ] then echo "engine-cleanup is not completed"; echo "Exit"; exit 1; fi su - postgres -c psql << EOF alter role engine encrypted password '$PASSWORD'; \q EOF if [ $? -ne 0 ] then echo "db password is not set"; echo "Exit"; exit 1; fi engine-backup --mode=restore --scope=all --file=$RESTORE_FILE --log=restore.log --change-db-credentials --db-host=localhost --db-name=engine --db-user=engine --db-password=$PASSWORD --restore-permissions engine-setup << EOF yes no ok EOF echo "Restore Done"
참고사항 - DB Corruption
가끔 engine-cleanup이나 engine-setup이 제대로 안되는경우가 있는데 이런경우 database가 꼬인경우일 수도 있다.
psql로 들어가 database list를 살펴보기 바란다.
[root@host2 ~]# su - postgres -c psql psql (8.4.20) Type "help" for help. postgres=# \l List of databases Name | Owner | Encoding | Collation | Ctype | Access privileges -----------------------+-----------------------+----------+-------------+-------------+----------------------- engine_20160416011028 | engine_20160416011028 | UTF8 | en_US.UTF-8 | en_US.UTF-8 | engine_20160416011808 | engine_20160416011808 | UTF8 | en_US.UTF-8 | en_US.UTF-8 | postgres | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | template0 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres : postgres=CTc/postgres template1 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres : postgres=CTc/postgres (5 rows) postgres=# drop database engine_20160416011028; DROP DATABASE postgres=# drop database engine_20160416011808; DROP DATABASE postgres=# \l List of databases Name | Owner | Encoding | Collation | Ctype | Access privileges -----------+----------+----------+-------------+-------------+----------------------- postgres | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | template0 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres : postgres=CTc/postgres template1 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres : postgres=CTc/postgres (3 rows) postgres=# \q
참고사항 - Memory Size
복구하고자 하는 대상 시스템의 메모리가 원본 시스템의 메모리보다 적을경우 서비스 기동에 문제가 생기는 경우가 있다.
engine-setup 과정에서 오류가 발생하면서 /var/log/messages 의 내용에 아래와 같은 오류가 발생한다.
Apr 21 17:02:53 testvm002 2016-04-21 17:02:53,974 ovirt-engine: ERROR run:532 Error: Cannot detect JBoss version
해결하는 방법은 복구과정중 engine-setup 하기 전 아래의 파일을 열어 메모리 사이즈를 조정해주면 해결 된다.
ENGINE_HEAP_MIN="4096M" # 시스템 메모리 크기에 맞게 적당히 조절해준다. ENGINE_HEAP_MAX="4096M"
아래는 기본적으로 oVirt에서 자동으로 잡아주는 힙 사이즈 크기이다.
물리 메모리 크기 | 힙사이즈 |
---|---|
8GB | 1964M |
32GB | 7959M |
256GB | 64565M |
로그인하면 댓글을 남길 수 있습니다.