xtrabackup - (1) 백업 : 기본편
2024. 11. 22. 00:16ㆍMySQL/Class
반응형
1. 백업 폴더 생성
$ mkdir /data/backup
2. my.cnf 설정
$ vi /etc/my_8033.cnf
# 내용 추가
[xtrabackup]
target_dir = /data/backup/.
- target_dir을 직접 기입하여 xtrabackup 을 실행시키기 때문에 필요없는 작업일 수 있습니다. 다만 실무에서 스크립트를 통해서 정기적으로 백업을 한다면 불필요한 내용은 최대한 제거하여 스크립트를 만드는 것이 좋기 때문에 최대한 my.cnf 파일에 많은 정보를 넣는 것도 좋은 방법이라 생각합니다.
3. 백업
$ xtrabackup --defaults-file=/etc/my_8033.cnf --user=root --password='1234' --backup --target_dir=/data/backup --socket=/tmp/mysql_8033.sock
[root@centOS09-02 tmp]# xtrabackup --defaults-file=/etc/my_8033.cnf --user=root --password='1234' --backup --target_dir=/data/backup --socket=/tmp/mysql_8033.sock
2024-10-25T14:48:59.579826+09:00 0 [Note] [MY-011825] [Xtrabackup] recognized server arguments: --server-id=200 --datadir=/data/mysql_data --innodb_file_per_table=1 --innodb_buffer_pool_size=500M
2024-10-25T14:48:59.580094+09:00 0 [Note] [MY-011825] [Xtrabackup] recognized client arguments: --port=3306 --socket=/tmp/mysql_8033.sock --target-dir=/data/backup --user=root --password=* --backup=1 --target-dir=/data/backup --socket=/tmp/mysql_8033.sock
xtrabackup version 8.0.35-31 based on MySQL server 8.0.35 Linux (aarch64) (revision id: 55ec21d7)
241025 14:48:59 version_check Connecting to MySQL server with DSN 'dbi:mysql:;mysql_read_default_group=xtrabackup;port=3306;mysql_socket=/tmp/mysql_8033.sock' as 'root' (using password: YES).
241025 14:48:59 version_check Connected to MySQL server
241025 14:48:59 version_check Executing a version check against the server...
241025 14:48:59 version_check Done.
2024-10-25T14:48:59.649328+09:00 0 [Note] [MY-011825] [Xtrabackup] Connecting to MySQL server host: localhost, user: root, password: set, port: 3306, socket: /tmp/mysql_8033.sock
.
.
.
2024-10-25T14:49:01.147451+09:00 0 [Note] [MY-011825] [Xtrabackup] Done: Copying ib_buffer_pool to /data/backup/ib_buffer_pool
2024-10-25T14:49:01.147797+09:00 0 [Note] [MY-011825] [Xtrabackup] Backup created in directory '/data/backup/'
2024-10-25T14:49:01.147805+09:00 0 [Note] [MY-011825] [Xtrabackup] MySQL binlog position: filename 'binlog.000009', position '157'
2024-10-25T14:49:01.147864+09:00 0 [Note] [MY-011825] [Xtrabackup] Writing /data/backup/backup-my.cnf
2024-10-25T14:49:01.147925+09:00 0 [Note] [MY-011825] [Xtrabackup] Done: Writing file /data/backup/backup-my.cnf
2024-10-25T14:49:01.148493+09:00 0 [Note] [MY-011825] [Xtrabackup] Writing /data/backup/xtrabackup_info
2024-10-25T14:49:01.148545+09:00 0 [Note] [MY-011825] [Xtrabackup] Done: Writing file /data/backup/xtrabackup_info
2024-10-25T14:49:02.149297+09:00 0 [Note] [MY-011825] [Xtrabackup] Transaction log of lsn (326850210) to (326850220) was copied.
2024-10-25T14:49:02.367596+09:00 0 [Note] [MY-011825] [Xtrabackup] completed OK!
4. 백업파일 확인
반응형
'MySQL > Class' 카테고리의 다른 글
xtrabackup - (3) qpress 설치 (0) | 2024.11.24 |
---|---|
xtrabackup - (2) 복구 : 기본편 (0) | 2024.11.23 |
Load Data : 파일 내용 넣기 (0) | 2024.11.20 |
log-slave-updates (0) | 2024.11.18 |
M2(Mac)용 VMWare로 가상화 만들기 - (9) xtrabackup 설치 (2) | 2024.11.17 |