Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhanced recovery and and backup documentation #684

Merged
merged 1 commit into from
Oct 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 42 additions & 14 deletions docs/guides/operations-guide/infrastructure.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,40 +66,68 @@ global

### Backup

[Mariabackup](https://mariadb.com/kb/en/mariabackup-overview/) is used to create backups
of MariaDB.
[Mariabackup](https://mariadb.com/kb/en/mariabackup-overview/) is used to create backups
of MariaDB. For more details about backups, you can use the offical
[kolla-ansible](https://docs.openstack.org/kolla-ansible/latest/admin/mariadb-backup-and-restore.html) documentation.

* Full backup
* Create a full backup

```
osism apply mariadb_backup
```

* Incremental backup (supported as of OSISM 7.0.6)
* Create a incremental backup (supported as of OSISM 7.0.6)

```
osism apply mariadb_backup -e mariadb_backup_type=incremental
```

There is a Docker volume `mariadb_backup` on the 1st control node. The backups
are stored in this volume.
* Accessing created backups

There is a Docker volume `mariadb_backup` on the 1st control node. The backups
are stored in this volume.
(see also /var/lib/docker/volumes/mariadb_backup/)

```
$ docker run --rm -v mariadb_backup:/backup -it ubuntu:22.04 bash -c 'ls -la /backup'
total 9728
drwxr-xr-x 2 42434 42434 4096 Jun 3 18:46 .
drwxr-xr-x 1 root root 4096 Jun 3 18:47 ..
-rw-r--r-- 1 42434 42434 4530618 Jun 3 18:46 incremental-18-mysqlbackup-03-06-2024-1717440409.qp.xbc.xbs.gz
-rw-r--r-- 1 42434 42434 11 Jun 3 18:45 last_full_date
-rw-r--r-- 1 42434 42434 5411763 Jun 3 18:45 mysqlbackup-03-06-2024-1717440342.qp.xbc.xbs.gz
```

Currently there is no offical scheduling and houskeeping (disk space) for mariadb backups.
You can create a simple cronjob on the manager or use your enterprise backup software.

```
$ docker run --rm -v mariadb_backup:/backup -it ubuntu:22.04 bash -c 'ls -la /backup'
total 9728
drwxr-xr-x 2 42434 42434 4096 Jun 3 18:46 .
drwxr-xr-x 1 root root 4096 Jun 3 18:47 ..
-rw-r--r-- 1 42434 42434 4530618 Jun 3 18:46 incremental-18-mysqlbackup-03-06-2024-1717440409.qp.xbc.xbs.gz
-rw-r--r-- 1 42434 42434 11 Jun 3 18:45 last_full_date
-rw-r--r-- 1 42434 42434 5411763 Jun 3 18:45 mysqlbackup-03-06-2024-1717440342.qp.xbc.xbs.gz
cat /etc/cron.d/mariadb_backup <<'EOF'
0 7 * * * dragon osism apply mariadb_backup |logger -t mariadb_backup
EOF
```

### Restore

https://docs.openstack.org/kolla-ansible/latest/admin/mariadb-backup-and-restore.html#restoring-backups
* Stop all MariaDb Instances

```
osism apply -s stop maria
```

* Follow the [restore procedure described in the kolla-ansible manual](https://docs.openstack.org/kolla-ansible/latest/admin/mariadb-backup-and-restore.html#restoring-backups)

* Execute the recovery procedure with the node name where you executed the recovery

```
osism apply mariadb_recovery -e mariadb_recover_inventory_name=THE_NAME_OF_THE_RESTORE_NODE
```

### Recovery

If you stopped your mariadb galera cluster completly, you can use the following procedure
to start a recovery.

```
osism apply mariadb_recovery
```
Expand Down
Loading