4.2. 언더클라우드 백업
언더클라우드 노드를 백업하려면 언더클라우드 노드에 root 사용자로 로그인해야 합니다. 예방 조치로 데이터베이스를 백업하여 복원할 수 있는지 확인해야 합니다.As a precaution, you must back up the database to ensure that you can restore it.
사전 요구 사항
- 백업 디렉토리를 생성하고 내보냈습니다. 자세한 내용은 백업 디렉터리 생성 및 내보내기를 참조하십시오.
- 언더클라우드를 백업하기 전에 사전 요구 사항 작업을 수행했습니다. 자세한 내용은 언더클라우드를 백업하기 전에 전제 조건 작업 수행을 참조하십시오.
- 각 컨트롤 플레인 노드에 ReaR을 설치하고 구성했습니다. 자세한 내용은 Relax 및 Recover(ReaR) 설치 및 구성을 참조하십시오.
절차
데이터베이스 암호를 찾습니다.
[root@undercloud stack]# PASSWORD=$(sudo /bin/hiera -c /etc/puppet/hiera.yaml mysql::server::root_password)
데이터베이스를 백업합니다.
[root@undercloud stack]# mysql -uroot -p$PASSWORD -s -N -e "select distinct table_schema from information_schema.tables where engine='innodb' and table_schema != 'mysql';" | xargs mysqldump -uroot -p$PASSWORD --single-transaction --databases > openstack-backup-mysql.sql
[root@undercloud stack]# mysql -uroot -p$PASSWORD -s -N -e "SELECT CONCAT('\"SHOW GRANTS FOR ''',user,'''@''',host,''';\"') FROM mysql.user where (length(user) > 0 and user NOT LIKE 'root')" | xargs -n1 mysql -uroot -p$PASSWORD -s -N -e | sed 's/$/;/' > openstack-backup-mysql-grants.sql
mariadb
데이터베이스 서비스를 중지합니다.[root@undercloud stack]# systemctl stop mariadb
백업을 생성합니다.
[root@undercloud stack]# rear -d -v mkbackup
/ctl_plane_backups
디렉터리의 백업 노드에서 ReaR으로 생성한 백업 ISO 파일을 찾을 수 있습니다.언더클라우드를 다시 시작합니다.
- stack 사용자로 언더클라우드에 로그인합니다.
언더클라우드를 다시 시작합니다.
[stack@undercloud]$ sudo reboot