xtrabackupによるダウンタイムなしのプライマリ・スレーブの作成
28160 ワード
innobackupexはxtrabackupのパッケージコマンドです
バックアップ:rootパスワード3306のユーザー名を/tmpの下にバックアップ
innobackupex --socket=/tmp/user_3306.sock --user root --password 3306/tmp/
実行情報は次のとおりです.
上に示すパスに注意
このディレクトリをスレーブにコピーします
スレーブに復元
バックアップ時に生成されたmyを使用します.cnfバックアップによるリカバリ
innobackupex --defaults-file=/tmp/2015-03-13_18-42-45/backup-my.cnf --apply-log/tmp/2015-03-13_18-42-45/
実行情報:
ファイルをdataの下にコピーする
注意server_idとuuidはホストと同じではありません
バックアップ時に生成された情報に基づいてremasterスクリプトを生成
スレーブ調製完了
バックアップ:rootパスワード3306のユーザー名を/tmpの下にバックアップ
innobackupex --socket=/tmp/user_3306.sock --user root --password 3306/tmp/
実行情報は次のとおりです.
[root@o11204 user_3306]# innobackupex --socket=/tmp/user_3306.sock --user root --password 3306 /tmp/
InnoDB Backup Utility v1.5.1-xtrabackup; Copyright 2003, 2009 Innobase Oy
and Percona LLC and/or its affiliates 2009-2013. All Rights Reserved.
This software is published under
the GNU GENERAL PUBLIC LICENSE Version 2, June 1991.
Get the latest version of Percona XtraBackup, documentation, and help resources:
http://www.percona.com/xb/p
150313 18:42:45 innobackupex: Connecting to MySQL server with DSN 'dbi:mysql:;mysql_read_default_group=xtrabackup;mysql_socket=/tmp/user_3306.sock' as 'root' (using password: YES).
150313 18:42:45 innobackupex: Connected to MySQL server
150313 18:42:45 innobackupex: Executing a version check against the server...
150313 18:42:45 innobackupex: Done.
150313 18:42:45 innobackupex: Starting the backup operation
IMPORTANT: Please check that the backup run completes successfully.
At the end of a successful backup run innobackupex
prints "completed OK!".
innobackupex: Using server version 5.6.21-log
innobackupex: Created backup directory /tmp/2015-03-13_18-42-45
150313 18:42:45 innobackupex: Starting ibbackup with command: xtrabackup --defaults-group="mysqld" --backup --suspend-at-end --target-dir=/tmp/2015-03-13_18-42-45 --innodb_log_file_size="50331648" --innodb_data_file_path="ibdata1:12M:autoextend" --tmpdir=/data/mysql/user_3306/tmp --extra-lsndir='/data/mysql/user_3306/tmp'
innobackupex: Waiting for ibbackup (pid=2153) to suspend
innobackupex: Suspend file '/tmp/2015-03-13_18-42-45/xtrabackup_suspended_2'
xtrabackup version 2.2.6 based on MySQL server 5.6.21 Linux (x86_64) (revision id: )
xtrabackup: uses posix_fadvise().
xtrabackup: cd to /data/mysql/user_3306/data
xtrabackup: open files limit requested 0, set to 1024
xtrabackup: using the following InnoDB configuration:
xtrabackup: innodb_data_home_dir = ./
xtrabackup: innodb_data_file_path = ibdata1:12M:autoextend
xtrabackup: innodb_log_group_home_dir = ./
xtrabackup: innodb_log_files_in_group = 2
xtrabackup: innodb_log_file_size = 50331648
>> log scanned up to (2136559926)
xtrabackup: Generating a list of tablespaces
[01] Copying ./ibdata1 to /tmp/2015-03-13_18-42-45/ibdata1
>> log scanned up to (2136559926)
>> log scanned up to (2136559926)
>> log scanned up to (2136559926)
>> log scanned up to (2136559926)
>> log scanned up to (2136559926)
>> log scanned up to (2136559926)
>> log scanned up to (2136559926)
>> log scanned up to (2136559926)
>> log scanned up to (2136559926)
[01] ...done
>> log scanned up to (2136559926)
[01] Copying ./mysql/innodb_table_stats.ibd to /tmp/2015-03-13_18-42-45/mysql/innodb_table_stats.ibd
[01] ...done
[01] Copying ./mysql/innodb_index_stats.ibd to /tmp/2015-03-13_18-42-45/mysql/innodb_index_stats.ibd
[01] ...done
[01] Copying ./mysql/slave_relay_log_info.ibd to /tmp/2015-03-13_18-42-45/mysql/slave_relay_log_info.ibd
[01] ...done
[01] Copying ./mysql/slave_master_info.ibd to /tmp/2015-03-13_18-42-45/mysql/slave_master_info.ibd
[01] ...done
[01] Copying ./mysql/slave_worker_info.ibd to /tmp/2015-03-13_18-42-45/mysql/slave_worker_info.ibd
[01] ...done
[01] Copying ./test/gap.ibd to /tmp/2015-03-13_18-42-45/test/gap.ibd
[01] ...done
[01] Copying ./test/dept.ibd to /tmp/2015-03-13_18-42-45/test/dept.ibd
[01] ...done
[01] Copying ./test/t10.ibd to /tmp/2015-03-13_18-42-45/test/t10.ibd
[01] ...done
[01] Copying ./test/emp.ibd to /tmp/2015-03-13_18-42-45/test/emp.ibd
[01] ...done
[01] Copying ./test/members#P#p0.ibd to /tmp/2015-03-13_18-42-45/test/members#P#p0.ibd
[01] ...done
[01] Copying ./test/members#P#p1.ibd to /tmp/2015-03-13_18-42-45/test/members#P#p1.ibd
[01] ...done
[01] Copying ./test/members#P#p2.ibd to /tmp/2015-03-13_18-42-45/test/members#P#p2.ibd
[01] ...done
[01] Copying ./test/members#P#p3.ibd to /tmp/2015-03-13_18-42-45/test/members#P#p3.ibd
[01] ...done
[01] Copying ./test/members#P#p4.ibd to /tmp/2015-03-13_18-42-45/test/members#P#p4.ibd
[01] ...done
[01] Copying ./test/pt#P#p0.ibd to /tmp/2015-03-13_18-42-45/test/pt#P#p0.ibd
[01] ...done
[01] Copying ./test/pt#P#p1.ibd to /tmp/2015-03-13_18-42-45/test/pt#P#p1.ibd
[01] ...done
[01] Copying ./test/pt#P#p2.ibd to /tmp/2015-03-13_18-42-45/test/pt#P#p2.ibd
[01] ...done
[01] Copying ./test/test1.ibd to /tmp/2015-03-13_18-42-45/test/test1.ibd
[01] ...done
[01] Copying ./test/test2.ibd to /tmp/2015-03-13_18-42-45/test/test2.ibd
>> log scanned up to (2136559926)
[01] ...done
[01] Copying ./test/t2.ibd to /tmp/2015-03-13_18-42-45/test/t2.ibd
>> log scanned up to (2136559926)
[01] ...done
[01] Copying ./test/t1.ibd to /tmp/2015-03-13_18-42-45/test/t1.ibd
[01] ...done
[01] Copying ./test/t100.ibd to /tmp/2015-03-13_18-42-45/test/t100.ibd
[01] ...done
[01] Copying ./dropdb/test.ibd to /tmp/2015-03-13_18-42-45/dropdb/test.ibd
[01] ...done
[01] Copying ./zabbix/maintenances.ibd to /tmp/2015-03-13_18-42-45/zabbix/maintenances.ibd
[01] ...done
[01] Copying ./zabbix/hosts.ibd to /tmp/2015-03-13_18-42-45/zabbix/hosts.ibd
[01] ...done
[01] Copying ./zabbix/groups.ibd to /tmp/2015-03-13_18-42-45/zabbix/groups.ibd
[01] ...done
[01] Copying ./zabbix/slides.ibd to /tmp/2015-03-13_18-42-45/zabbix/slides.ibd
[01] ...done
[01] Copying ./zabbix/screens.ibd to /tmp/2015-03-13_18-42-45/zabbix/screens.ibd
[01] ...done
[01] Copying ./zabbix/screens_items.ibd to /tmp/2015-03-13_18-42-45/zabbix/screens_items.ibd
[01] ...done
[01] Copying ./zabbix/slideshows.ibd to /tmp/2015-03-13_18-42-45/zabbix/slideshows.ibd
[01] ...done
[01] Copying ./zabbix/items.ibd to /tmp/2015-03-13_18-42-45/zabbix/items.ibd
>> log scanned up to (2136559926)
[01] ...done
[01] Copying ./zabbix/drules.ibd to /tmp/2015-03-13_18-42-45/zabbix/drules.ibd
[01] ...done
[01] Copying ./zabbix/dchecks.ibd to /tmp/2015-03-13_18-42-45/zabbix/dchecks.ibd
[01] ...done
[01] Copying ./zabbix/applications.ibd to /tmp/2015-03-13_18-42-45/zabbix/applications.ibd
[01] ...done
[01] Copying ./zabbix/httptest.ibd to /tmp/2015-03-13_18-42-45/zabbix/httptest.ibd
[01] ...done
[01] Copying ./zabbix/httpstep.ibd to /tmp/2015-03-13_18-42-45/zabbix/httpstep.ibd
[01] ...done
[01] Copying ./zabbix/interface.ibd to /tmp/2015-03-13_18-42-45/zabbix/interface.ibd
[01] ...done
[01] Copying ./zabbix/valuemaps.ibd to /tmp/2015-03-13_18-42-45/zabbix/valuemaps.ibd
[01] ...done
[01] Copying ./zabbix/httptestitem.ibd to /tmp/2015-03-13_18-42-45/zabbix/httptestitem.ibd
[01] ...done
[01] Copying ./zabbix/users_groups.ibd to /tmp/2015-03-13_18-42-45/zabbix/users_groups.ibd
[01] ...done
[01] Copying ./zabbix/media_type.ibd to /tmp/2015-03-13_18-42-45/zabbix/media_type.ibd
[01] ...done
[01] Copying ./zabbix/users.ibd to /tmp/2015-03-13_18-42-45/zabbix/users.ibd
[01] ...done
[01] Copying ./zabbix/usrgrp.ibd to /tmp/2015-03-13_18-42-45/zabbix/usrgrp.ibd
[01] ...done
[01] Copying ./zabbix/scripts.ibd to /tmp/2015-03-13_18-42-45/zabbix/scripts.ibd
[01] ...done
[01] Copying ./zabbix/actions.ibd to /tmp/2015-03-13_18-42-45/zabbix/actions.ibd
[01] ...done
[01] Copying ./zabbix/operations.ibd to /tmp/2015-03-13_18-42-45/zabbix/operations.ibd
[01] ...done
[01] Copying ./zabbix/opmessage_grp.ibd to /tmp/2015-03-13_18-42-45/zabbix/opmessage_grp.ibd
[01] ...done
[01] Copying ./zabbix/opmessage.ibd to /tmp/2015-03-13_18-42-45/zabbix/opmessage.ibd
[01] ...done
[01] Copying ./zabbix/opmessage_usr.ibd to /tmp/2015-03-13_18-42-45/zabbix/opmessage_usr.ibd
[01] ...done
[01] Copying ./zabbix/opcommand.ibd to /tmp/2015-03-13_18-42-45/zabbix/opcommand.ibd
[01] ...done
[01] Copying ./zabbix/opcommand_hst.ibd to /tmp/2015-03-13_18-42-45/zabbix/opcommand_hst.ibd
[01] ...done
[01] Copying ./zabbix/opcommand_grp.ibd to /tmp/2015-03-13_18-42-45/zabbix/opcommand_grp.ibd
[01] ...done
[01] Copying ./zabbix/optemplate.ibd to /tmp/2015-03-13_18-42-45/zabbix/optemplate.ibd
[01] ...done
[01] Copying ./zabbix/opgroup.ibd to /tmp/2015-03-13_18-42-45/zabbix/opgroup.ibd
[01] ...done
[01] Copying ./zabbix/opconditions.ibd to /tmp/2015-03-13_18-42-45/zabbix/opconditions.ibd
[01] ...done
[01] Copying ./zabbix/conditions.ibd to /tmp/2015-03-13_18-42-45/zabbix/conditions.ibd
[01] ...done
[01] Copying ./zabbix/trigger_depends.ibd to /tmp/2015-03-13_18-42-45/zabbix/trigger_depends.ibd
[01] ...done
[01] Copying ./zabbix/config.ibd to /tmp/2015-03-13_18-42-45/zabbix/config.ibd
[01] ...done
[01] Copying ./zabbix/triggers.ibd to /tmp/2015-03-13_18-42-45/zabbix/triggers.ibd
[01] ...done
[01] Copying ./zabbix/graphs_items.ibd to /tmp/2015-03-13_18-42-45/zabbix/graphs_items.ibd
[01] ...done
[01] Copying ./zabbix/functions.ibd to /tmp/2015-03-13_18-42-45/zabbix/functions.ibd
[01] ...done
[01] Copying ./zabbix/graphs.ibd to /tmp/2015-03-13_18-42-45/zabbix/graphs.ibd
[01] ...done
[01] Copying ./zabbix/graph_theme.ibd to /tmp/2015-03-13_18-42-45/zabbix/graph_theme.ibd
[01] ...done
[01] Copying ./zabbix/globalmacro.ibd to /tmp/2015-03-13_18-42-45/zabbix/globalmacro.ibd
[01] ...done
[01] Copying ./zabbix/hostmacro.ibd to /tmp/2015-03-13_18-42-45/zabbix/hostmacro.ibd
[01] ...done
[01] Copying ./zabbix/hosts_templates.ibd to /tmp/2015-03-13_18-42-45/zabbix/hosts_templates.ibd
[01] ...done
[01] Copying ./zabbix/services_links.ibd to /tmp/2015-03-13_18-42-45/zabbix/services_links.ibd
[01] ...done
[01] Copying ./zabbix/mappings.ibd to /tmp/2015-03-13_18-42-45/zabbix/mappings.ibd
[01] ...done
[01] Copying ./zabbix/media.ibd to /tmp/2015-03-13_18-42-45/zabbix/media.ibd
[01] ...done
[01] Copying ./zabbix/rights.ibd to /tmp/2015-03-13_18-42-45/zabbix/rights.ibd
[01] ...done
[01] Copying ./zabbix/services.ibd to /tmp/2015-03-13_18-42-45/zabbix/services.ibd
[01] ...done
[01] Copying ./zabbix/icon_mapping.ibd to /tmp/2015-03-13_18-42-45/zabbix/icon_mapping.ibd
[01] ...done
[01] Copying ./zabbix/services_times.ibd to /tmp/2015-03-13_18-42-45/zabbix/services_times.ibd
[01] ...done
[01] Copying ./zabbix/sysmaps_elements.ibd to /tmp/2015-03-13_18-42-45/zabbix/sysmaps_elements.ibd
[01] ...done
[01] Copying ./zabbix/icon_map.ibd to /tmp/2015-03-13_18-42-45/zabbix/icon_map.ibd
[01] ...done
[01] Copying ./zabbix/maintenances_hosts.ibd to /tmp/2015-03-13_18-42-45/zabbix/maintenances_hosts.ibd
[01] ...done
[01] Copying ./zabbix/auditlog.ibd to /tmp/2015-03-13_18-42-45/zabbix/auditlog.ibd
[01] ...done
[01] Copying ./zabbix/sysmaps.ibd to /tmp/2015-03-13_18-42-45/zabbix/sysmaps.ibd
[01] ...done
[01] Copying ./zabbix/sysmaps_links.ibd to /tmp/2015-03-13_18-42-45/zabbix/sysmaps_links.ibd
[01] ...done
[01] Copying ./zabbix/acknowledges.ibd to /tmp/2015-03-13_18-42-45/zabbix/acknowledges.ibd
[01] ...done
[01] Copying ./zabbix/sysmap_element_url.ibd to /tmp/2015-03-13_18-42-45/zabbix/sysmap_element_url.ibd
[01] ...done
[01] Copying ./zabbix/sysmap_url.ibd to /tmp/2015-03-13_18-42-45/zabbix/sysmap_url.ibd
[01] ...done
[01] Copying ./zabbix/maintenances_groups.ibd to /tmp/2015-03-13_18-42-45/zabbix/maintenances_groups.ibd
[01] ...done
[01] Copying ./zabbix/dhosts.ibd to /tmp/2015-03-13_18-42-45/zabbix/dhosts.ibd
>> log scanned up to (2136559926)
[01] ...done
[01] Copying ./zabbix/timeperiods.ibd to /tmp/2015-03-13_18-42-45/zabbix/timeperiods.ibd
[01] ...done
[01] Copying ./zabbix/regexps.ibd to /tmp/2015-03-13_18-42-45/zabbix/regexps.ibd
[01] ...done
[01] Copying ./zabbix/expressions.ibd to /tmp/2015-03-13_18-42-45/zabbix/expressions.ibd
[01] ...done
[01] Copying ./zabbix/alerts.ibd to /tmp/2015-03-13_18-42-45/zabbix/alerts.ibd
[01] ...done
[01] Copying ./zabbix/ids.ibd to /tmp/2015-03-13_18-42-45/zabbix/ids.ibd
[01] ...done
[01] Copying ./zabbix/history.ibd to /tmp/2015-03-13_18-42-45/zabbix/history.ibd
>> log scanned up to (2136559926)
>> log scanned up to (2136559926)
>> log scanned up to (2136559926)
[01] ...done
[01] Copying ./zabbix/history_uint.ibd to /tmp/2015-03-13_18-42-45/zabbix/history_uint.ibd
>> log scanned up to (2136559926)
[01] ...done
[01] Copying ./zabbix/history_str.ibd to /tmp/2015-03-13_18-42-45/zabbix/history_str.ibd
[01] ...done
[01] Copying ./zabbix/history_log.ibd to /tmp/2015-03-13_18-42-45/zabbix/history_log.ibd
[01] ...done
[01] Copying ./zabbix/history_text.ibd to /tmp/2015-03-13_18-42-45/zabbix/history_text.ibd
[01] ...done
[01] Copying ./zabbix/proxy_history.ibd to /tmp/2015-03-13_18-42-45/zabbix/proxy_history.ibd
[01] ...done
[01] Copying ./zabbix/proxy_dhistory.ibd to /tmp/2015-03-13_18-42-45/zabbix/proxy_dhistory.ibd
[01] ...done
[01] Copying ./zabbix/events.ibd to /tmp/2015-03-13_18-42-45/zabbix/events.ibd
[01] ...done
[01] Copying ./zabbix/trends.ibd to /tmp/2015-03-13_18-42-45/zabbix/trends.ibd
[01] ...done
[01] Copying ./zabbix/trends_uint.ibd to /tmp/2015-03-13_18-42-45/zabbix/trends_uint.ibd
>> log scanned up to (2136559926)
[01] ...done
[01] Copying ./zabbix/dservices.ibd to /tmp/2015-03-13_18-42-45/zabbix/dservices.ibd
[01] ...done
[01] Copying ./zabbix/proxy_autoreg_host.ibd to /tmp/2015-03-13_18-42-45/zabbix/proxy_autoreg_host.ibd
[01] ...done
[01] Copying ./zabbix/escalations.ibd to /tmp/2015-03-13_18-42-45/zabbix/escalations.ibd
[01] ...done
[01] Copying ./zabbix/globalvars.ibd to /tmp/2015-03-13_18-42-45/zabbix/globalvars.ibd
[01] ...done
[01] Copying ./zabbix/item_discovery.ibd to /tmp/2015-03-13_18-42-45/zabbix/item_discovery.ibd
[01] ...done
[01] Copying ./zabbix/housekeeper.ibd to /tmp/2015-03-13_18-42-45/zabbix/housekeeper.ibd
[01] ...done
[01] Copying ./zabbix/images.ibd to /tmp/2015-03-13_18-42-45/zabbix/images.ibd
[01] ...done
[01] Copying ./zabbix/interface_discovery.ibd to /tmp/2015-03-13_18-42-45/zabbix/interface_discovery.ibd
[01] ...done
[01] Copying ./zabbix/profiles.ibd to /tmp/2015-03-13_18-42-45/zabbix/profiles.ibd
[01] ...done
[01] Copying ./zabbix/sessions.ibd to /tmp/2015-03-13_18-42-45/zabbix/sessions.ibd
[01] ...done
[01] Copying ./zabbix/user_history.ibd to /tmp/2015-03-13_18-42-45/zabbix/user_history.ibd
[01] ...done
[01] Copying ./zabbix/application_template.ibd to /tmp/2015-03-13_18-42-45/zabbix/application_template.ibd
[01] ...done
[01] Copying ./zabbix/item_condition.ibd to /tmp/2015-03-13_18-42-45/zabbix/item_condition.ibd
[01] ...done
[01] Copying ./zabbix/dbversion.ibd to /tmp/2015-03-13_18-42-45/zabbix/dbversion.ibd
[01] ...done
[01] Copying ./zabbix/trigger_discovery.ibd to /tmp/2015-03-13_18-42-45/zabbix/trigger_discovery.ibd
[01] ...done
[01] Copying ./zabbix/graph_discovery.ibd to /tmp/2015-03-13_18-42-45/zabbix/graph_discovery.ibd
[01] ...done
[01] Copying ./zabbix/group_prototype.ibd to /tmp/2015-03-13_18-42-45/zabbix/group_prototype.ibd
[01] ...done
[01] Copying ./zabbix/group_discovery.ibd to /tmp/2015-03-13_18-42-45/zabbix/group_discovery.ibd
[01] ...done
[01] Copying ./zabbix/httpstepitem.ibd to /tmp/2015-03-13_18-42-45/zabbix/httpstepitem.ibd
[01] ...done
[01] Copying ./zabbix/host_discovery.ibd to /tmp/2015-03-13_18-42-45/zabbix/host_discovery.ibd
[01] ...done
[01] Copying ./zabbix/hosts_groups.ibd to /tmp/2015-03-13_18-42-45/zabbix/hosts_groups.ibd
[01] ...done
[01] Copying ./zabbix/items_applications.ibd to /tmp/2015-03-13_18-42-45/zabbix/items_applications.ibd
[01] ...done
[01] Copying ./zabbix/sysmaps_link_triggers.ibd to /tmp/2015-03-13_18-42-45/zabbix/sysmaps_link_triggers.ibd
[01] ...done
[01] Copying ./zabbix/maintenances_windows.ibd to /tmp/2015-03-13_18-42-45/zabbix/maintenances_windows.ibd
[01] ...done
[01] Copying ./zabbix/auditlog_details.ibd to /tmp/2015-03-13_18-42-45/zabbix/auditlog_details.ibd
>> log scanned up to (2136559926)
[01] ...done
[01] Copying ./zabbix/service_alarms.ibd to /tmp/2015-03-13_18-42-45/zabbix/service_alarms.ibd
[01] ...done
[01] Copying ./zabbix/autoreg_host.ibd to /tmp/2015-03-13_18-42-45/zabbix/autoreg_host.ibd
[01] ...done
[01] Copying ./zabbix/host_inventory.ibd to /tmp/2015-03-13_18-42-45/zabbix/host_inventory.ibd
[01] ...done
xtrabackup: Creating suspend file '/tmp/2015-03-13_18-42-45/xtrabackup_suspended_2' with pid '2153'
150313 18:43:06 innobackupex: Continuing after ibbackup has suspended
150313 18:43:06 innobackupex: Executing FLUSH TABLES WITH READ LOCK...
150313 18:43:06 innobackupex: All tables locked and flushed to disk
150313 18:43:06 innobackupex: Starting to backup non-InnoDB tables and files
innobackupex: in subdirectories of '/data/mysql/user_3306/data/'
innobackupex: Backing up files '/data/mysql/user_3306/data//mysql/*.{frm,isl,MYD,MYI,MAD,MAI,MRG,TRG,TRN,ARM,ARZ,CSM,CSV,opt,par}' (74 files)
>> log scanned up to (2136559926)
innobackupex: Backing up files '/data/mysql/user_3306/data//test/*.{frm,isl,MYD,MYI,MAD,MAI,MRG,TRG,TRN,ARM,ARZ,CSM,CSV,opt,par}' (13 files)
innobackupex: Backing up files '/data/mysql/user_3306/data//performance_schema/*.{frm,isl,MYD,MYI,MAD,MAI,MRG,TRG,TRN,ARM,ARZ,CSM,CSV,opt,par}' (53 files)
innobackupex: Backing up file '/data/mysql/user_3306/data//dropdb/test.frm'
innobackupex: Backing up files '/data/mysql/user_3306/data//zabbix/*.{frm,isl,MYD,MYI,MAD,MAI,MRG,TRG,TRN,ARM,ARZ,CSM,CSV,opt,par}' (105 files)
>> log scanned up to (2136559926)
150313 18:43:07 innobackupex: Finished backing up non-InnoDB tables and files
150313 18:43:07 innobackupex: Executing FLUSH ENGINE LOGS...
150313 18:43:07 innobackupex: Waiting for log copying to finish
xtrabackup: The latest check point (for incremental): '2136559926'
xtrabackup: Stopping log copying thread.
.>> log scanned up to (2136559926)
xtrabackup: Creating suspend file '/tmp/2015-03-13_18-42-45/xtrabackup_log_copied' with pid '2153'
xtrabackup: Transaction log of lsn (2136559926) to (2136559926) was copied.
150313 18:43:08 innobackupex: All tables unlocked
innobackupex: Backup created in directory '/tmp/2015-03-13_18-42-45'
innobackupex: MySQL binlog position: filename 'mysql-bin.000032', position 120, GTID of the last change ''
150313 18:43:08 innobackupex: Connection to database server closed
150313 18:43:08 innobackupex: completed OK!
上に示すパスに注意
[root@o11204 user_3306]# ls /tmp/2015-03-13_18-42-45/
backup-my.cnf ibdata1 performance_schema xtrabackup_binlog_info xtrabackup_info zabbix
dropdb mysql test xtrabackup_checkpoints xtrabackup_logfile
このディレクトリをスレーブにコピーします
scp -r 192.168.56.3:/tmp/2015-03-13_18-42-45 /tmp/
スレーブに復元
バックアップ時に生成されたmyを使用します.cnfバックアップによるリカバリ
innobackupex --defaults-file=/tmp/2015-03-13_18-42-45/backup-my.cnf --apply-log/tmp/2015-03-13_18-42-45/
実行情報:
[root@keepalived13 user_3306]# innobackupex --defaults-file=/tmp/2015-03-13_18-42-45/backup-my.cnf --apply-log /tmp/2015-03-13_18-42-45/
InnoDB Backup Utility v1.5.1-xtrabackup; Copyright 2003, 2009 Innobase Oy
and Percona LLC and/or its affiliates 2009-2013. All Rights Reserved.
This software is published under
the GNU GENERAL PUBLIC LICENSE Version 2, June 1991.
Get the latest version of Percona XtraBackup, documentation, and help resources:
http://www.percona.com/xb/p
150317 09:55:55 innobackupex: Starting the apply-log operation
IMPORTANT: Please check that the apply-log run completes successfully.
At the end of a successful apply-log run innobackupex
prints "completed OK!".
150317 09:55:55 innobackupex: Starting ibbackup with command: xtrabackup --defaults-file="/tmp/2015-03-13_18-42-45/backup-my.cnf" --defaults-group="mysqld" --prepare --target-dir=/tmp/2015-03-13_18-42-45
xtrabackup version 2.2.6 based on MySQL server 5.6.21 Linux (x86_64) (revision id: )
xtrabackup: cd to /tmp/2015-03-13_18-42-45
xtrabackup: This target seems to be already prepared.
xtrabackup: notice: xtrabackup_logfile was already used to '--prepare'.
xtrabackup: using the following InnoDB configuration for recovery:
xtrabackup: innodb_data_home_dir = ./
xtrabackup: innodb_data_file_path = ibdata1:12M:autoextend
xtrabackup: innodb_log_group_home_dir = ./
xtrabackup: innodb_log_files_in_group = 2
xtrabackup: innodb_log_file_size = 50331648
xtrabackup: using the following InnoDB configuration for recovery:
xtrabackup: innodb_data_home_dir = ./
xtrabackup: innodb_data_file_path = ibdata1:12M:autoextend
xtrabackup: innodb_log_group_home_dir = ./
xtrabackup: innodb_log_files_in_group = 2
xtrabackup: innodb_log_file_size = 50331648
xtrabackup: Starting InnoDB instance for recovery.
xtrabackup: Using 104857600 bytes for buffer pool (set by --use-memory parameter)
InnoDB: Using atomics to ref count buffer pool pages
InnoDB: The InnoDB memory heap is disabled
InnoDB: Mutexes and rw_locks use GCC atomic builtins
InnoDB: Memory barrier is not used
InnoDB: Compressed tables use zlib 1.2.3
InnoDB: Not using CPU crc32 instructions
InnoDB: Initializing buffer pool, size = 100.0M
InnoDB: Completed initialization of buffer pool
InnoDB: Highest supported file format is Barracuda.
InnoDB: 128 rollback segment(s) are active.
InnoDB: Waiting for purge to start
InnoDB: 5.6.21 started; log sequence number 2136565539
[notice (again)]
If you use binary log and don't use any hack of group commit,
the binary log position seems to be:
InnoDB: Last MySQL binlog file position 0 6658754, file name mysql-bin.000031
xtrabackup: starting shutdown with innodb_fast_shutdown = 1
InnoDB: FTS optimize thread exiting.
InnoDB: Starting shutdown...
InnoDB: Shutdown completed; log sequence number 2136566968
150317 09:55:57 innobackupex: Restarting xtrabackup with command: xtrabackup --defaults-file="/tmp/2015-03-13_18-42-45/backup-my.cnf" --defaults-group="mysqld" --prepare --target-dir=/tmp/2015-03-13_18-42-45
for creating ib_logfile*
xtrabackup version 2.2.6 based on MySQL server 5.6.21 Linux (x86_64) (revision id: )
xtrabackup: cd to /tmp/2015-03-13_18-42-45
xtrabackup: This target seems to be already prepared.
xtrabackup: notice: xtrabackup_logfile was already used to '--prepare'.
xtrabackup: using the following InnoDB configuration for recovery:
xtrabackup: innodb_data_home_dir = ./
xtrabackup: innodb_data_file_path = ibdata1:12M:autoextend
xtrabackup: innodb_log_group_home_dir = ./
xtrabackup: innodb_log_files_in_group = 2
xtrabackup: innodb_log_file_size = 50331648
xtrabackup: using the following InnoDB configuration for recovery:
xtrabackup: innodb_data_home_dir = ./
xtrabackup: innodb_data_file_path = ibdata1:12M:autoextend
xtrabackup: innodb_log_group_home_dir = ./
xtrabackup: innodb_log_files_in_group = 2
xtrabackup: innodb_log_file_size = 50331648
xtrabackup: Starting InnoDB instance for recovery.
xtrabackup: Using 104857600 bytes for buffer pool (set by --use-memory parameter)
InnoDB: Using atomics to ref count buffer pool pages
InnoDB: The InnoDB memory heap is disabled
InnoDB: Mutexes and rw_locks use GCC atomic builtins
InnoDB: Memory barrier is not used
InnoDB: Compressed tables use zlib 1.2.3
InnoDB: Not using CPU crc32 instructions
InnoDB: Initializing buffer pool, size = 100.0M
InnoDB: Completed initialization of buffer pool
InnoDB: Highest supported file format is Barracuda.
InnoDB: 128 rollback segment(s) are active.
InnoDB: Waiting for purge to start
InnoDB: 5.6.21 started; log sequence number 2136566968
[notice (again)]
If you use binary log and don't use any hack of group commit,
the binary log position seems to be:
InnoDB: Last MySQL binlog file position 0 6658754, file name mysql-bin.000031
xtrabackup: starting shutdown with innodb_fast_shutdown = 1
InnoDB: FTS optimize thread exiting.
InnoDB: Starting shutdown...
InnoDB: Shutdown completed; log sequence number 2136568294
150317 09:55:59 innobackupex: completed OK!
ファイルをdataの下にコピーする
cp -r /tmp/2015-03-13_18-42-45 /data/mysql/user_3306/data
権限を変更して起動[root@keepalived13 user_3306]# chown -R mysql.mysql data
[root@keepalived13 user_3306]# ./mysql.server start
Starting MySQL.. [ ]
注意server_idとuuidはホストと同じではありません
[root@keepalived13 user_3306]# cat /etc/my.cnf | grep server_id
server_id = 133306
[root@keepalived13 user_3306]# cat data/auto.cnf
[auto]
server-uuid=207a797e-c867-11e4-a2fc-080027f30c9e
バックアップ時に生成された情報に基づいてremasterスクリプトを生成
[root@keepalived13 user_3306]# cat /tmp/2015-03-13_18-42-45/xtrabackup_binlog_info
mysql-bin.000032 120
change master to
master_host='192.168.56.3',
master_log_file='mysql-bin.000032',
master_log_pos=120,
master_user='repl',
master_password='repl4slave',
master_port=3306
スレーブ調製完了
mysql> show slave status\G
*************************** 1. row ***************************
Slave_IO_State: Waiting for master to send event
Master_Host: 192.168.56.3
Master_User: repl
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: mysql-bin.000032
Read_Master_Log_Pos: 776
Relay_Log_File: keepalived13-relay-bin.000002
Relay_Log_Pos: 939
Relay_Master_Log_File: mysql-bin.000032
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
Replicate_Do_DB:
Replicate_Ignore_DB:
Replicate_Do_Table:
Replicate_Ignore_Table:
Replicate_Wild_Do_Table:
Replicate_Wild_Ignore_Table:
Last_Errno: 0
Last_Error:
Skip_Counter: 0
Exec_Master_Log_Pos: 776
Relay_Log_Space: 1119
Until_Condition: None
Until_Log_File:
Until_Log_Pos: 0
Master_SSL_Allowed: No
Master_SSL_CA_File:
Master_SSL_CA_Path:
Master_SSL_Cert:
Master_SSL_Cipher:
Master_SSL_Key:
Seconds_Behind_Master: 0
Master_SSL_Verify_Server_Cert: No
Last_IO_Errno: 0
Last_IO_Error:
Last_SQL_Errno: 0
Last_SQL_Error:
Replicate_Ignore_Server_Ids:
Master_Server_Id: 23306
Master_UUID: 64f4a34e-9258-11e4-827c-08002796172a
Master_Info_File: /data/mysql/user_3306/data/master.info
SQL_Delay: 0
SQL_Remaining_Delay: NULL
Slave_SQL_Running_State: Slave has read all relay log; waiting for the slave I/O thread to update it
Master_Retry_Count: 86400
Master_Bind:
Last_IO_Error_Timestamp:
Last_SQL_Error_Timestamp:
Master_SSL_Crl:
Master_SSL_Crlpath:
Retrieved_Gtid_Set:
Executed_Gtid_Set:
Auto_Position: 0
1 row in set (0.00 sec)