Benutzer-Werkzeuge

Webseiten-Werkzeuge


percona_xtrabackup

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen RevisionVorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
percona_xtrabackup [2022-08-17 11:24:43] manfredpercona_xtrabackup [2025-05-13 16:25:07] (aktuell) – [Allgemeines] manfred
Zeile 1: Zeile 1:
 ====== Percona xtrabackup ====== ====== Percona xtrabackup ======
 +
 +
 +===== Allgemeines =====
 +
 +<code bash xtrabackup gibt die "Defaults" aus>
 +root@host01:~# xtrabackup --defaults-file=/etc/mysql/my.cnf --print-defaults | sed 's/[ ][-][-]/\n--/g'
 +...
 +--datadir=/var/lib/mysql
 +--socket=/var/run/mysqld/mysqld.sock
 +...
 +</code>
 +
 +<code bash xtrabackup legt eine Kopie vom DataDir im PWD an>
 +root@host01:~# xtrabackup --datadir=/var/lib/mysql/ --socket /var/run/mysqld/mysqld.sock --backup --galera-info --parallel 4
 +</code>
 +
 +<code bash 1. socat+xbstream auf dem Empfänger starten "host02">
 +root@host02:~# cd /var/lib/mysql/
 +root@host02:/var/lib/mysql# rm -fr *
 +root@host02:/var/lib/mysql# socat - TCP-LISTEN:12345 | xbstream -vx
 +</code>
 +
 +<code bash 2. xtrabackup auf dem Sender starten "host01">
 +root@host01:~# xtrabackup --datadir=/var/lib/mysql/ --socket /var/run/mysqld/mysqld.sock --backup --galera-info --parallel 4 --stream=xbstream | socat - TCP:host02:12345
 +</code>
 +
 +<code bash 3. prepare auf "host02">
 +# prepare the backup on db2
 +root@host02:~# xtrabackup --prepare --target-dir=/var/lib/mysql/
 +</code>
 +
 +<code bash 4. grastate.dat generieren auf "host02">
 +# recreate the grastate.dat file using the GTID in xtrabackup_galera_info file.
 +root@host02:/var/lib/mysql# echo "uuid: $(cat xtrabackup_galera_info)" > grastate.dat
 +root@host02:/var/lib/mysql# echo "safe_to_bootstrap: 0" >> grastate.dat
 +root@host02:/var/lib/mysql# cat grastate.dat
 +</code>
 +
 +<code bash 5. BIN-LOG-Dateien, an den richtigen Ort, verschieben>
 +root@host02:/var/lib/mysql/port_13319/datadir# mv -v mysql-bin.* ../log_bin/
 +renamed 'mysql-bin.000007' -> '../log_bin/mysql-bin.000007'
 +renamed 'mysql-bin.index' -> '../log_bin/mysql-bin.index'
 +</code>
 +
 +<code bash 6. alte Dateien löschen>
 +root@host02:/var/lib/mysql# rm backup-my.cnf xtrabackup_*
 +</code>
 +
 +<code bash 7. Rechte>
 +root@host02:~# chown -R mysql:mysql /var/lib/mysql/
 +root@host02:~# ls -lha /var/lib/mysql/
 +</code>
  
  
/home/http/wiki/data/attic/percona_xtrabackup.1660735483.txt · Zuletzt geändert: von manfred