新聞中心
這篇文章主要講解了“xtrabackup遠(yuǎn)程備份的方法教程”,文中的講解內(nèi)容簡(jiǎn)單清晰,易于學(xué)習(xí)與理解,下面請(qǐng)大家跟著小編的思路慢慢深入,一起來研究和學(xué)習(xí)“xtrabackup遠(yuǎn)程備份的方法教程”吧!
專注于為中小企業(yè)提供成都做網(wǎng)站、成都網(wǎng)站建設(shè)服務(wù),電腦端+手機(jī)端+微信端的三站合一,更高效的管理,為中小企業(yè)富平免費(fèi)做網(wǎng)站提供優(yōu)質(zhì)的服務(wù)。我們立足成都,凝聚了一批互聯(lián)網(wǎng)行業(yè)人才,有力地推動(dòng)了成百上千企業(yè)的穩(wěn)健成長(zhǎng),幫助中小企業(yè)通過網(wǎng)站建設(shè)實(shí)現(xiàn)規(guī)模擴(kuò)充和轉(zhuǎn)變。
生產(chǎn)環(huán)境中常常將數(shù)據(jù)庫備份至遠(yuǎn)程服務(wù)器,本次測(cè)試中,數(shù)據(jù)庫服務(wù)器:192.168.8.50,遠(yuǎn)程備份中心:192.168.8.63
1、配置SSH秘鑰認(rèn)證
ssh-keygen -t rsa
ssh-copy-id -i ~/.ssh/id_rsa.pub [email protected]
2、使用tar進(jìn)行備份并以時(shí)間對(duì)備份進(jìn)行命名
/usr/local/xtrabackup/bin/innobackupex --defaults-file=/etc/my.cnf --user=root --password=mysql --port 3306 --socket=/tmp/mysqld.sock --stream=tar ./ | ssh [email protected] \ "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 to180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/time_zone.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/help_relation.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/time_zone_transition_type.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/help_topic.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/db.MYD to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/slow_log.CSM to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/slow_log.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/general_log.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/slave_relay_log_info.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/tables_priv.MYI to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/ndb_binlog_index.MYD to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/slave_master_info.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/func.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/proc.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/time_zone_name.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/func.MYD to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/procs_priv.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/tables_priv.MYD to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/columns_priv.MYI to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/general_log.CSM to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/ndb_binlog_index.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/gtid_executed.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/procs_priv.MYD to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/func.MYI to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/help_keyword.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/columns_priv.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/proxies_priv.MYI to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/proc.MYI to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/time_zone_transition.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/time_zone_leap_second.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/general_log.CSV to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/servers.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/help_category.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/proxies_priv.MYD to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/event.MYD to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/engine_cost.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/user.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/ndb_binlog_index.MYI to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/db.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/plugin.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/user.MYI to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/columns_priv.MYD to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/innodb_table_stats.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/innodb_index_stats.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/event.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/slow_log.CSV to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/db.MYI to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./mysql/user.MYD to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/events_transactions_history.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/events_waits_history.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/events_statements_summary_by_digest.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/hosts.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/prepared_statements_instances.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/rwlock_instances.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/threads.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/setup_objects.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/objects_summary_global_by_type.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/replication_connection_status.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/events_statements_summary_by_thread_by_event_name.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/memory_summary_by_host_by_event_name.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/events_statements_summary_by_host_by_event_name.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/session_variables.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/replication_group_member_stats.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/setup_actors.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/memory_summary_by_account_by_event_name.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/events_transactions_history_long.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/users.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/setup_consumers.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/events_stages_history_long.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/events_waits_summary_global_by_event_name.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/events_statements_summary_by_program.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/file_instances.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/table_handles.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/variables_by_thread.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/memory_summary_global_by_event_name.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/events_transactions_summary_by_user_by_event_name.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/table_io_waits_summary_by_index_usage.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/events_transactions_summary_global_by_event_name.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/status_by_host.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/events_waits_summary_by_thread_by_event_name.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/events_stages_summary_by_account_by_event_name.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/session_connect_attrs.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/status_by_account.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/metadata_locks.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/events_transactions_summary_by_host_by_event_name.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/events_statements_history_long.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/global_variables.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/table_lock_waits_summary_by_table.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/mutex_instances.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/session_status.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/events_transactions_summary_by_account_by_event_name.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/events_stages_summary_by_user_by_event_name.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/table_io_waits_summary_by_table.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/events_statements_current.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/events_stages_current.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/replication_connection_configuration.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/memory_summary_by_thread_by_event_name.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/status_by_thread.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/replication_applier_status_by_worker.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/cond_instances.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/performance_timers.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/events_statements_summary_global_by_event_name.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/accounts.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/session_account_connect_attrs.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/events_waits_summary_by_instance.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/setup_instruments.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/events_waits_summary_by_user_by_event_name.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/events_waits_current.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/events_stages_summary_by_thread_by_event_name.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/events_waits_history_long.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/global_status.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/replication_group_members.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/events_stages_summary_by_host_by_event_name.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/replication_applier_status_by_coordinator.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/file_summary_by_instance.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/events_transactions_current.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/socket_summary_by_event_name.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/db.opt to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/socket_instances.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/events_stages_summary_global_by_event_name.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/setup_timers.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/host_cache.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/events_waits_summary_by_account_by_event_name.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/events_statements_history.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/events_transactions_summary_by_thread_by_event_name.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/user_variables_by_thread.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/file_summary_by_event_name.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/events_statements_summary_by_user_by_event_name.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/events_stages_history.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/replication_applier_status.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/events_statements_summary_by_account_by_event_name.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/socket_summary_by_instance.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/status_by_user.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/memory_summary_by_user_by_event_name.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/events_waits_summary_by_host_by_event_name.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 [01] Streaming ./performance_schema/replication_applier_configuration.frm to 180809 16:23:53 [01] ...done 180809 16:23:53 Finished backing up non-InnoDB tables and files 180809 16:23:53 [00] Streaming 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 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 180809 16:23:53 [00] ...done 180809 16:23:53 [00] Streaming 180809 16:23:53 [00] ...done xtrabackup: Transaction log of lsn (3504097424) to (3504097433) was copied. 180809 16:23:53 completed OK!
3、登錄備份服務(wù)器查看備份文件
[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遠(yuǎn)程備份的方法教程”的內(nèi)容了,經(jīng)過本文的學(xué)習(xí)后,相信大家對(duì)xtrabackup遠(yuǎn)程備份的方法教程這一問題有了更深刻的體會(huì),具體使用情況還需要大家實(shí)踐驗(yàn)證。這里是創(chuàng)新互聯(lián),小編將為大家推送更多相關(guān)知識(shí)點(diǎn)的文章,歡迎關(guān)注!
本文標(biāo)題:xtrabackup遠(yuǎn)程備份的方法教程
當(dāng)前地址:http://fisionsoft.com.cn/article/pjcjdg.html