您好,登錄后才能下訂單哦!
這篇文章主要講解了“xtrabackup遠程備份的方法教程”,文中的講解內容簡單清晰,易于學習與理解,下面請大家跟著小編的思路慢慢深入,一起來研究和學習“xtrabackup遠程備份的方法教程”吧!
生產環境中常常將數據庫備份至遠程服務器,本次測試中,數據庫服務器:192.168.8.50,遠程備份中心:192.168.8.63
1、配置SSH秘鑰認證
ssh-keygen -t rsa
ssh-copy-id -i ~/.ssh/id_rsa.pub mysql@192.168.8.63
2、使用tar進行備份并以時間對備份進行命名
/usr/local/xtrabackup/bin/innobackupex --defaults-file=/etc/my.cnf --user=root --password=mysql --port 3306 --socket=/tmp/mysqld.sock --stream=tar ./ | ssh mysql@192.168.8.63 \ "cat - > /backup_center/$(date +%Y-%m-%d_%H:%m:%S).tar" 。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/user_bak.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/time_zone.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/help_relation.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/time_zone_transition_type.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/help_topic.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/db.MYD to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/slow_log.CSM to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/slow_log.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/general_log.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/slave_relay_log_info.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/tables_priv.MYI to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/ndb_binlog_index.MYD to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/slave_master_info.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/func.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/proc.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/time_zone_name.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/func.MYD to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/procs_priv.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/tables_priv.MYD to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/columns_priv.MYI to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/general_log.CSM to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/ndb_binlog_index.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/gtid_executed.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/procs_priv.MYD to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/func.MYI to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/help_keyword.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/columns_priv.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/proxies_priv.MYI to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/proc.MYI to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/time_zone_transition.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/time_zone_leap_second.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/general_log.CSV to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/servers.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/help_category.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/proxies_priv.MYD to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/event.MYD to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/engine_cost.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/user.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/ndb_binlog_index.MYI to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/db.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/plugin.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/user.MYI to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/columns_priv.MYD to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/innodb_table_stats.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/innodb_index_stats.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/event.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/slow_log.CSV to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/db.MYI to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/user.MYD to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/events_transactions_history.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/events_waits_history.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/events_statements_summary_by_digest.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/hosts.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/prepared_statements_instances.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/rwlock_instances.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/threads.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/setup_objects.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/objects_summary_global_by_type.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/replication_connection_status.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/events_statements_summary_by_thread_by_event_name.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/memory_summary_by_host_by_event_name.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/events_statements_summary_by_host_by_event_name.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/session_variables.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/replication_group_member_stats.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/setup_actors.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/memory_summary_by_account_by_event_name.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/events_transactions_history_long.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/users.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/setup_consumers.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/events_stages_history_long.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/events_waits_summary_global_by_event_name.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/events_statements_summary_by_program.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/file_instances.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/table_handles.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/variables_by_thread.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/memory_summary_global_by_event_name.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/events_transactions_summary_by_user_by_event_name.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/table_io_waits_summary_by_index_usage.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/events_transactions_summary_global_by_event_name.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/status_by_host.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/events_waits_summary_by_thread_by_event_name.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/events_stages_summary_by_account_by_event_name.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/session_connect_attrs.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/status_by_account.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/metadata_locks.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/events_transactions_summary_by_host_by_event_name.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/events_statements_history_long.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/global_variables.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/table_lock_waits_summary_by_table.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/mutex_instances.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/session_status.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/events_transactions_summary_by_account_by_event_name.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/events_stages_summary_by_user_by_event_name.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/table_io_waits_summary_by_table.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/events_statements_current.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/events_stages_current.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/replication_connection_configuration.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/memory_summary_by_thread_by_event_name.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/status_by_thread.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/replication_applier_status_by_worker.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/cond_instances.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/performance_timers.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/events_statements_summary_global_by_event_name.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/accounts.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/session_account_connect_attrs.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/events_waits_summary_by_instance.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/setup_instruments.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/events_waits_summary_by_user_by_event_name.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/events_waits_current.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/events_stages_summary_by_thread_by_event_name.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/events_waits_history_long.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/global_status.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/replication_group_members.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/events_stages_summary_by_host_by_event_name.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/replication_applier_status_by_coordinator.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/file_summary_by_instance.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/events_transactions_current.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/socket_summary_by_event_name.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/db.opt to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/socket_instances.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/events_stages_summary_global_by_event_name.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/setup_timers.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/host_cache.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/events_waits_summary_by_account_by_event_name.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/events_statements_history.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/events_transactions_summary_by_thread_by_event_name.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/user_variables_by_thread.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/file_summary_by_event_name.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/events_statements_summary_by_user_by_event_name.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/events_stages_history.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/replication_applier_status.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/events_statements_summary_by_account_by_event_name.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/socket_summary_by_instance.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/status_by_user.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/memory_summary_by_user_by_event_name.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/events_waits_summary_by_host_by_event_name.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/replication_applier_configuration.frm to <STDOUT> 180809 16:23:53 [01] ...done 180809 16:23:53 Finished backing up non-InnoDB tables and files 180809 16:23:53 [00] Streaming <STDOUT> 180809 16:23:53 [00] ...done 180809 16:23:53 Executing FLUSH NO_WRITE_TO_BINLOG ENGINE LOGS... xtrabackup: The latest check point (for incremental): '3504097424' xtrabackup: Stopping log copying thread. .180809 16:23:53 >> log scanned up to (3504097433) 180809 16:23:53 Executing UNLOCK TABLES 180809 16:23:53 All tables unlocked 180809 16:23:53 [00] Streaming ib_buffer_pool to <STDOUT> 180809 16:23:53 [00] ...done 180809 16:23:53 Backup created in directory '/backup/full_backup/' MySQL binlog position: filename 'mysql-bin.000013', position '154' 180809 16:23:53 [00] Streaming <STDOUT> 180809 16:23:53 [00] ...done 180809 16:23:53 [00] Streaming <STDOUT> 180809 16:23:53 [00] ...done xtrabackup: Transaction log of lsn (3504097424) to (3504097433) was copied. 180809 16:23:53 completed OK!
3、登錄備份服務器查看備份文件
[root@oneproxy backup_center]# ll total 3683656 -rw-rw-r-- 1 mysql mysql 3772058112 Aug 9 16:24 2018-08-09_16:08:13.tar
感謝各位的閱讀,以上就是“xtrabackup遠程備份的方法教程”的內容了,經過本文的學習后,相信大家對xtrabackup遠程備份的方法教程這一問題有了更深刻的體會,具體使用情況還需要大家實踐驗證。這里是億速云,小編將為大家推送更多相關知識點的文章,歡迎關注!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。