4.2. 언더클라우드 백업

언더클라우드 노드를 백업하려면 언더클라우드 노드에 root 사용자로 로그인해야 합니다. 예방 조치로 데이터베이스를 백업하여 복원할 수 있는지 확인해야 합니다.As a precaution, you must back up the database to ensure that you can restore it.

사전 요구 사항

절차

  1. 데이터베이스 암호를 찾습니다.

    [root@undercloud stack]# PASSWORD=$(sudo /bin/hiera -c /etc/puppet/hiera.yaml mysql::server::root_password)
  2. 데이터베이스를 백업합니다.

    [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
  3. mariadb 데이터베이스 서비스를 중지합니다.

    [root@undercloud stack]# systemctl stop mariadb
  4. 백업을 생성합니다.

    [root@undercloud stack]# rear -d -v mkbackup

    /ctl_plane_backups 디렉터리의 백업 노드에서 ReaR으로 생성한 백업 ISO 파일을 찾을 수 있습니다.

  5. 언더클라우드를 다시 시작합니다.

    1. stack 사용자로 언더클라우드에 로그인합니다.
    2. 언더클라우드를 다시 시작합니다.

      [stack@undercloud]$ sudo reboot