Here is the roadmap of what we cover in the rest of this document:
這裡列出相關的操作步驟:
backup server 172.16.1.166
production 數據庫(socket model backup) 172.16.1.162
production數據庫(ssh copy model) 172.16.1.165
. Setup MySQL-ZRM on the backup server “172.16.1.166” and create a backup set called DailyBackupDB1 to back up two databases on “172.16.1.162”
這裡166是Mysql backup center server, 162模擬 production 數據庫(socket model backup) 165 模擬 production數據庫(ssh copy model)
2. Prepare 162 to be backed up using the socket copy plug-in
對162使用socket copy plug-in模式
3. Configure firewall for backups between “166” and “db1.162”
166和162配置防火牆
4. Setup ZRM on the backup server and create a backup set called DailyBackupDB2 to backup MoviesMyISAM database on “165”
創建在備份服務器,并創建備份集叫做DailyBackupDB2來備份 db2.165
5. Prepare db2.zmanda.com for back up using the SSH copy plug-in
準備db2.162使用ssh copy 模式
6. Configure firewall for backups between “166” and “db2.165”
配置166,db2.166之間的防火墻
7. Perform the backup of both backup sets DailyBackupDB1 and DailyBackupDB2 from the command line
命令行執行 執行backup Daily BackupDB1 , Daily Backup DB2
8. Verify backup and check performance statistics
校驗和檢查性能
9. Set up Automated backups
自動化備份
10. Recover MySQL data
恢復實驗
1 配置 backup 服務器
a. backup server Mysql 安裝
[root@croracle02 software]# rpm -Uvh MySQL-server-community-5.1.36-0.rhel5.x86_64.rpm
Preparing... ########################################### [100%]
1:MySQL-server-community ########################################### [100%]
090813 6:07:22 [Warning] Forcing shutdown of 2 plugins
090813 6:07:22 [Warning] Forcing shutdown of 2 plugins
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h croracle02.localdomain password 'new-password'
Alternatively you can run:
/usr/bin/mysql_secure_installation
which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.
See the manual for more instructions.
Please report any problems with the /usr/bin/mysqlbug script!
The latest information about MySQL is available at http://www.mysql.com/
Support MySQL by buying support/licenses from http://shop.mysql.com/
Starting MySQL..........[ OK ]
Giving mysqld 2 seconds to start
[root@croracle02 software]#
[root@croracle02 software]# rpm -Uvh MySQL-client-community-5.1.36-0.rhel5.x86_64.rpm
Preparing... ########################################### [100%]
1:MySQL-client-community ########################################### [100%]
[root@croracle02 software]#
[root@croracle02 software]# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.1.36-community MySQL Community Server (GPL)
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
開發包安裝
[root@croracle02 software]# rpm -Uvh MySQL-devel-community-5.1.36-0.rhel5.x86_64.rpm
Preparing... ########################################### [100%]
1:MySQL-devel-community ########################################### [100%]
[root@croracle02 software]#
安裝所需要的 Perl 包
Install DBI Module
[root@croracle02 software]# rpm -qa |grep DBI
[root@croracle02 software]#
[root@croracle02 software]# tar xvfz DBI-1.609.tar.gz
DBI-1.609/
DBI-1.609/Changes
DBI-1.609/dbd_xsh.h
DBI-1.609/DBI.pm
DBI-1.609/DBI.xs
DBI-1.609/dbi_sql.h
DBI-1.609/dbilogstrip.PL
DBI-1.609/dbipport.h
DBI-1.609/dbiprof.PL
DBI-1.609/dbiproxy.PL
DBI-1.609/dbivport.h
DBI-1.609/DBIXS.h
DBI-1.609/dbixs_rev.h
DBI-1.609/dbixs_rev.pl
DBI-1.609/Driver.xst
DBI-1.609/Driver_xst.h
DBI-1.609/ex/
DBI-1.609/ex/perl_dbi_nulls_test.pl
DBI-1.609/ex/profile.pl
DBI-1.609/lib/
DBI-1.609/lib/Bundle/
DBI-1.609/lib/Bundle/DBI.pm
DBI-1.609/lib/DBD/
DBI-1.609/lib/DBD/DBM.pm
DBI-1.609/lib/DBD/ExampleP.pm
DBI-1.609/lib/DBD/File.pm
DBI-1.609/lib/DBD/Gofer/
DBI-1.609/lib/DBD/Gofer/Policy/
DBI-1.609/lib/DBD/Gofer/Policy/Base.pm
DBI-1.609/lib/DBD/Gofer/Policy/classic.pm
DBI-1.609/lib/DBD/Gofer/Policy/pedantic.pm
DBI-1.609/lib/DBD/Gofer/Policy/rush.pm
DBI-1.609/lib/DBD/Gofer/Transport/
DBI-1.609/lib/DBD/Gofer/Transport/Base.pm
DBI-1.609/lib/DBD/Gofer/Transport/null.pm
DBI-1.609/lib/DBD/Gofer/Transport/pipeone.pm
DBI-1.609/lib/DBD/Gofer/Transport/stream.pm
DBI-1.609/lib/DBD/Gofer.pm
DBI-1.609/lib/DBD/NullP.pm
DBI-1.609/lib/DBD/Proxy.pm
DBI-1.609/lib/DBD/Sponge.pm
DBI-1.609/lib/DBI/
DBI-1.609/lib/DBI/Const/
DBI-1.609/lib/DBI/Const/GetInfo/
DBI-1.609/lib/DBI/Const/GetInfo/ANSI.pm
DBI-1.609/lib/DBI/Const/GetInfo/ODBC.pm
DBI-1.609/lib/DBI/Const/GetInfoReturn.pm
DBI-1.609/lib/DBI/Const/GetInfoType.pm
DBI-1.609/lib/DBI/DBD/
DBI-1.609/lib/DBI/DBD/Metadata.pm
DBI-1.609/lib/DBI/DBD.pm
DBI-1.609/lib/DBI/FAQ.pm
DBI-1.609/lib/DBI/Gofer/
DBI-1.609/lib/DBI/Gofer/Execute.pm
DBI-1.609/lib/DBI/Gofer/Request.pm
DBI-1.609/lib/DBI/Gofer/Response.pm
DBI-1.609/lib/DBI/Gofer/Serializer/
DBI-1.609/lib/DBI/Gofer/Serializer/Base.pm
DBI-1.609/lib/DBI/Gofer/Serializer/DataDumper.pm
DBI-1.609/lib/DBI/Gofer/Serializer/Storable.pm
DBI-1.609/lib/DBI/Gofer/Transport/
DBI-1.609/lib/DBI/Gofer/Transport/Base.pm
DBI-1.609/lib/DBI/Gofer/Transport/pipeone.pm
DBI-1.609/lib/DBI/Gofer/Transport/stream.pm
DBI-1.609/lib/DBI/Profile.pm
DBI-1.609/lib/DBI/ProfileData.pm
DBI-1.609/lib/DBI/ProfileDumper/
DBI-1.609/lib/DBI/ProfileDumper/Apache.pm
DBI-1.609/lib/DBI/ProfileDumper.pm
DBI-1.609/lib/DBI/ProfileSubs.pm
DBI-1.609/lib/DBI/ProxyServer.pm
DBI-1.609/lib/DBI/PurePerl.pm
DBI-1.609/lib/DBI/SQL/
DBI-1.609/lib/DBI/SQL/Nano.pm
DBI-1.609/lib/DBI/Util/
DBI-1.609/lib/DBI/Util/_accessor.pm
DBI-1.609/lib/DBI/Util/CacheMemory.pm
DBI-1.609/lib/DBI/W32ODBC.pm
DBI-1.609/lib/Win32/
DBI-1.609/lib/Win32/DBIODBC.pm
DBI-1.609/Makefile.PL
DBI-1.609/MANIFEST
DBI-1.609/META.yml
DBI-1.609/Perl.xs
DBI-1.609/README
DBI-1.609/Roadmap.pod
DBI-1.609/t/
DBI-1.609/t/01basics.t
DBI-1.609/t/02dbidrv.t
DBI-1.609/t/03handle.t
DBI-1.609/t/04mods.t
DBI-1.609/t/05concathash.t
DBI-1.609/t/06attrs.t
DBI-1.609/t/07kids.t
DBI-1.609/t/08keeperr.t
DBI-1.609/t/09trace.t
DBI-1.609/t/10examp.t
DBI-1.609/t/11fetch.t
DBI-1.609/t/12quote.t
DBI-1.609/t/13taint.t
DBI-1.609/t/14utf8.t
DBI-1.609/t/15array.t
DBI-1.609/t/19fhtrace.t
DBI-1.609/t/20meta.t
DBI-1.609/t/30subclass.t
DBI-1.609/t/35thrclone.t
DBI-1.609/t/40profile.t
DBI-1.609/t/41prof_dump.t
DBI-1.609/t/42prof_data.t
DBI-1.609/t/43prof_env.t
DBI-1.609/t/50dbm.t
DBI-1.609/t/60preparse.t
DBI-1.609/t/65transact.t
DBI-1.609/t/70callbacks.t
DBI-1.609/t/72childhandles.t
DBI-1.609/t/80proxy.t
DBI-1.609/t/85gofer.t
DBI-1.609/t/86gofer_fail.t
DBI-1.609/t/87gofer_cache.t
DBI-1.609/t/pod-coverage.t
DBI-1.609/t/pod.t
DBI-1.609/TASKS.pod
DBI-1.609/test.pl
DBI-1.609/TODO_2005.txt
DBI-1.609/TODO_gofer.txt
DBI-1.609/typemap
[root@croracle02 software]# cd DBI-1.609
[root@croracle02 DBI-1.609]# perl Makefile.PL
*** Your LANG environment variable is set to 'en_US.UTF-8'
*** This may cause problems for some perl installations.
*** If you get test failures, please try again with LANG unset.
*** If that then works, please email dbi-dev@perl.org with details
*** including the output of 'perl -V'
*** You are using a perl configured with threading enabled.
*** You should be aware that using multiple threads is
*** not recommended for production environments.
Your perl was compiled with gcc (version 4.1.1 20070105 (Red Hat 4.1.1-52)), okay.
Creating test wrappers for DBI::PurePerl:
t/zvp_01basics.t
t/zvp_02dbidrv.t
t/zvp_03handle.t
t/zvp_04mods.t
t/zvp_05concathash.t
t/zvp_06attrs.t
t/zvp_07kids.t
t/zvp_08keeperr.t
t/zvp_09trace.t
t/zvp_10examp.t
t/zvp_11fetch.t
t/zvp_12quote.t
t/zvp_13taint.t
t/zvp_14utf8.t
t/zvp_15array.t
t/zvp_19fhtrace.t
t/zvp_20meta.t
t/zvp_30subclass.t
t/zvp_35thrclone.t (use threads)
t/zvp_40profile.t
t/zvp_41prof_dump.t
t/zvp_42prof_data.t
t/zvp_43prof_env.t
t/zvp_50dbm.t
t/zvp_60preparse.t
t/zvp_65transact.t
t/zvp_70callbacks.t
t/zvp_72childhandles.t
t/zvp_80proxy.t
t/zvp_85gofer.t
t/zvp_86gofer_fail.t
t/zvp_87gofer_cache.t
Creating test wrappers for DBD::Gofer:
t/zvg_01basics.t
t/zvg_02dbidrv.t
t/zvg_03handle.t
t/zvg_04mods.t
t/zvg_05concathash.t
t/zvg_06attrs.t
t/zvg_07kids.t
t/zvg_08keeperr.t
t/zvg_09trace.t
t/zvg_10examp.t
t/zvg_11fetch.t
t/zvg_12quote.t
t/zvg_13taint.t
t/zvg_14utf8.t
t/zvg_15array.t
t/zvg_19fhtrace.t
t/zvg_20meta.t
t/zvg_30subclass.t
t/zvg_35thrclone.t (use threads)
t/zvg_40profile.t
t/zvg_41prof_dump.t
t/zvg_42prof_data.t
t/zvg_43prof_env.t
t/zvg_50dbm.t
t/zvg_60preparse.t
t/zvg_65transact.t
t/zvg_70callbacks.t
t/zvg_72childhandles.t
t/zvg_80proxy.t
t/zvg_85gofer.t
t/zvg_86gofer_fail.t
t/zvg_87gofer_cache.t
Creating test wrappers for PurePerl & Gofer:
t/zvxgp_01basics.t
t/zvxgp_02dbidrv.t
t/zvxgp_03handle.t
t/zvxgp_04mods.t
t/zvxgp_05concathash.t
t/zvxgp_06attrs.t
t/zvxgp_07kids.t
t/zvxgp_08keeperr.t
t/zvxgp_09trace.t
t/zvxgp_10examp.t
t/zvxgp_11fetch.t
t/zvxgp_12quote.t
t/zvxgp_13taint.t
t/zvxgp_14utf8.t
t/zvxgp_15array.t
t/zvxgp_19fhtrace.t
t/zvxgp_20meta.t
t/zvxgp_30subclass.t
t/zvxgp_35thrclone.t (use threads)
t/zvxgp_40profile.t
t/zvxgp_41prof_dump.t
t/zvxgp_42prof_data.t
t/zvxgp_43prof_env.t
t/zvxgp_50dbm.t
t/zvxgp_60preparse.t
t/zvxgp_65transact.t
t/zvxgp_70callbacks.t
t/zvxgp_72childhandles.t
t/zvxgp_80proxy.t
t/zvxgp_85gofer.t
t/zvxgp_86gofer_fail.t
t/zvxgp_87gofer_cache.t
Checking if your kit is complete...
Looks good
I see you're using perl 5.008008 on x86_64-linux-thread-multi, okay.
Remember to actually *read* the README file!
Use 'make' to build the software (dmake or nmake on Windows).
Then 'make test' to execute self tests.
Then 'make install' to install the DBI and then delete this working
directory before unpacking and building any DBD::* drivers.
Writing Makefile for DBI
[root@croracle02 DBI-1.609]# make
/usr/bin/perl "-MExtUtils::Command" -e mkpath blib/lib/DBI
rm -f blib/lib/DBI/Changes.pm
cp Changes blib/lib/DBI/Changes.pm
/usr/bin/perl "-MExtUtils::Command" -e mkpath blib/lib/DBI
rm -f blib/lib/DBI/Roadmap.pm
cp Roadmap.pod blib/lib/DBI/Roadmap.pm
cp Driver_xst.h blib/arch/auto/DBI/Driver_xst.h
cp lib/DBI/Gofer/Response.pm blib/lib/DBI/Gofer/Response.pm
cp lib/DBD/Proxy.pm blib/lib/DBD/Proxy.pm
cp lib/DBI/Util/_accessor.pm blib/lib/DBI/Util/_accessor.pm
cp lib/DBI/Gofer/Transport/Base.pm blib/lib/DBI/Gofer/Transport/Base.pm
cp lib/DBD/DBM.pm blib/lib/DBD/DBM.pm
cp DBIXS.h blib/arch/auto/DBI/DBIXS.h
cp dbixs_rev.pl blib/lib/dbixs_rev.pl
cp Roadmap.pod blib/lib/Roadmap.pod
cp lib/DBI/Const/GetInfoType.pm blib/lib/DBI/Const/GetInfoType.pm
cp lib/DBI/Gofer/Serializer/DataDumper.pm blib/lib/DBI/Gofer/Serializer/DataDumper.pm
cp lib/DBI/DBD/Metadata.pm blib/lib/DBI/DBD/Metadata.pm
cp lib/DBI/Const/GetInfo/ODBC.pm blib/lib/DBI/Const/GetInfo/ODBC.pm
cp lib/DBD/Gofer/Transport/pipeone.pm blib/lib/DBD/Gofer/Transport/pipeone.pm
cp lib/DBI/ProfileDumper/Apache.pm blib/lib/DBI/ProfileDumper/Apache.pm
cp Driver.xst blib/arch/auto/DBI/Driver.xst
cp lib/DBD/File.pm blib/lib/DBD/File.pm
cp lib/DBI/Util/CacheMemory.pm blib/lib/DBI/Util/CacheMemory.pm
cp lib/DBI/ProfileSubs.pm blib/lib/DBI/ProfileSubs.pm
cp lib/DBD/NullP.pm blib/lib/DBD/NullP.pm
cp dbi_sql.h blib/arch/auto/DBI/dbi_sql.h
cp lib/DBD/Gofer.pm blib/lib/DBD/Gofer.pm
cp dbd_xsh.h blib/arch/auto/DBI/dbd_xsh.h
cp dbivport.h blib/arch/auto/DBI/dbivport.h
cp dbixs_rev.h blib/arch/auto/DBI/dbixs_rev.h
cp lib/DBD/Gofer/Transport/Base.pm blib/lib/DBD/Gofer/Transport/Base.pm
cp lib/DBI/FAQ.pm blib/lib/DBI/FAQ.pm
cp lib/DBD/Gofer/Policy/rush.pm blib/lib/DBD/Gofer/Policy/rush.pm
cp lib/DBI/SQL/Nano.pm blib/lib/DBI/SQL/Nano.pm
cp lib/DBI/Const/GetInfo/ANSI.pm blib/lib/DBI/Const/GetInfo/ANSI.pm
cp lib/DBI/Gofer/Request.pm blib/lib/DBI/Gofer/Request.pm
cp lib/DBD/Gofer/Transport/stream.pm blib/lib/DBD/Gofer/Transport/stream.pm
cp lib/DBD/Gofer/Policy/classic.pm blib/lib/DBD/Gofer/Policy/classic.pm
cp lib/DBI/Gofer/Transport/stream.pm blib/lib/DBI/Gofer/Transport/stream.pm
cp lib/DBI/Gofer/Serializer/Storable.pm blib/lib/DBI/Gofer/Serializer/Storable.pm
cp lib/DBI/Const/GetInfoReturn.pm blib/lib/DBI/Const/GetInfoReturn.pm
cp DBI.pm blib/lib/DBI.pm
cp lib/DBD/Gofer/Policy/Base.pm blib/lib/DBD/Gofer/Policy/Base.pm
cp lib/DBD/Sponge.pm blib/lib/DBD/Sponge.pm
cp lib/DBD/Gofer/Policy/pedantic.pm blib/lib/DBD/Gofer/Policy/pedantic.pm
cp lib/DBI/Gofer/Transport/pipeone.pm blib/lib/DBI/Gofer/Transport/pipeone.pm
cp lib/DBI/W32ODBC.pm blib/lib/DBI/W32ODBC.pm
cp lib/DBD/Gofer/Transport/null.pm blib/lib/DBD/Gofer/Transport/null.pm
cp lib/Bundle/DBI.pm blib/lib/Bundle/DBI.pm
cp TASKS.pod blib/lib/TASKS.pod
cp lib/DBI/Profile.pm blib/lib/DBI/Profile.pm
cp lib/DBI/ProfileDumper.pm blib/lib/DBI/ProfileDumper.pm
....
make test
[root@croracle02 DBI-1.609]# make test
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/01basics................ok
4/130 skipped: developer tests
t/02dbidrv................ok
t/03handle................ok
....
[root@croracle02 DBI-1.609]# make install
校驗腳本:
[root@croracle02 software]# cat perl-module.pl
#!/usr/bin/perl
use ExtUtils::Installed;
my $inst = ExtUtils::Installed->new();
print join "\n",$inst->modules();
[root@croracle02 software]# ./perl-module.pl
DBI <--OK
Perl[root@croracle02 software]#
B Install DBD-mysql
[root@croracle02 software]# tar xvfz DBD-mysql-4.012.tar.gz
DBD-mysql-4.012/
DBD-mysql-4.012/ChangeLog
DBD-mysql-4.012/constants.h
DBD-mysql-4.012/dbdimp.c
DBD-mysql-4.012/dbdimp.h
DBD-mysql-4.012/eg/
DBD-mysql-4.012/eg/._bug14979.pl
DBD-mysql-4.012/eg/bug14979.pl
DBD-mysql-4.012/eg/._bug21028.pl
DBD-mysql-4.012/eg/bug21028.pl
DBD-mysql-4.012/eg/bug30033.pl
DBD-mysql-4.012/eg/bug30033pg.pl
DBD-mysql-4.012/eg/decimal_test.pl
DBD-mysql-4.012/eg/issue21946.pl
DBD-mysql-4.012/eg/prepare_memory_usage.pl
DBD-mysql-4.012/eg/proc_example1.pl
DBD-mysql-4.012/eg/proc_example2.pl
DBD-mysql-4.012/eg/proc_example2a.pl
DBD-mysql-4.012/eg/proc_example2b.pl
DBD-mysql-4.012/eg/proc_example3.pl
DBD-mysql-4.012/eg/proc_example4.pl
DBD-mysql-4.012/INSTALL.html
DBD-mysql-4.012/lib/
DBD-mysql-4.012/lib/Bundle/
DBD-mysql-4.012/lib/Bundle/DBD/
DBD-mysql-4.012/lib/Bundle/DBD/mysql.pm
DBD-mysql-4.012/lib/DBD/
DBD-mysql-4.012/lib/DBD/mysql/
DBD-mysql-4.012/lib/DBD/mysql/GetInfo.pm
DBD-mysql-4.012/lib/DBD/mysql/INSTALL.pod
DBD-mysql-4.012/lib/DBD/mysql.pm
DBD-mysql-4.012/Makefile.PL
DBD-mysql-4.012/Makefile.PL.embedded
DBD-mysql-4.012/MANIFEST
DBD-mysql-4.012/MANIFEST.SKIP
DBD-mysql-4.012/META.yml
DBD-mysql-4.012/myld
DBD-mysql-4.012/mysql.xs
DBD-mysql-4.012/README
DBD-mysql-4.012/t/
DBD-mysql-4.012/t/00base.t
DBD-mysql-4.012/t/10connect.t
DBD-mysql-4.012/t/20createdrop.t
DBD-mysql-4.012/t/25lockunlock.t
DBD-mysql-4.012/t/29warnings.t
DBD-mysql-4.012/t/30insertfetch.t
DBD-mysql-4.012/t/31insertid.t
DBD-mysql-4.012/t/32insert_error.t
DBD-mysql-4.012/t/35limit.t
DBD-mysql-4.012/t/35prepare.t
DBD-mysql-4.012/t/40bindparam.t
DBD-mysql-4.012/t/40bindparam2.t
DBD-mysql-4.012/t/40blobs.t
DBD-mysql-4.012/t/40catalog.t
DBD-mysql-4.012/t/40keyinfo.t
DBD-mysql-4.012/t/40listfields.t
DBD-mysql-4.012/t/40nulls.t
DBD-mysql-4.012/t/40numrows.t
DBD-mysql-4.012/t/40server_prepare.t
DBD-mysql-4.012/t/40server_prepare_error.t
DBD-mysql-4.012/t/40types.t
DBD-mysql-4.012/t/41bindparam.t
DBD-mysql-4.012/t/41blobs_prepare.t
DBD-mysql-4.012/t/42bindparam.t
DBD-mysql-4.012/t/50chopblanks.t
DBD-mysql-4.012/t/50commit.t
DBD-mysql-4.012/t/51bind_type_guessing.t
DBD-mysql-4.012/t/55utf8.t
DBD-mysql-4.012/t/60leaks.t
DBD-mysql-4.012/t/65types.t
DBD-mysql-4.012/t/70takeimp.t
DBD-mysql-4.012/t/71impdata.t
DBD-mysql-4.012/t/75supported_sql.t
DBD-mysql-4.012/t/76multi_statement.t
DBD-mysql-4.012/t/80procs.t
DBD-mysql-4.012/t/lib.pl
DBD-mysql-4.012/t/mysql.dbtest
DBD-mysql-4.012/t/mysql.mtest
DBD-mysql-4.012/TODO
[root@croracle02 software]#
[root@croracle02 DBD-mysql-4.012]# perl Makefile.PL
PLEASE NOTE:
For 'make test' to run properly, you must ensure that the
database user 'root' can connect to your MySQL server
and has the proper privileges that these tests require such
as 'drop table', 'create table', 'drop procedure', 'create procedure'
as well as others.
mysql> grant all privileges on test.* to 'root'@'localhost' identified by 's3kr1t';
You can also optionally set the user to run 'make test' with:
perl Makefile.pl --testuser=username
I will use the following settings for compiling and testing:
cflags (mysql_config) = -I/usr/include/mysql -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -DUNIV_LINUX
embedded (mysql_config) =
libs (mysql_config) = -rdynamic -L/usr/lib64/mysql -lmysqlclient -lz -lcrypt -lnsl -lm -lmygcc
mysql_config (guessed ) = mysql_config
nocatchstderr (default ) = 0
nofoundrows (default ) = 0
ssl (guessed ) = 0
testdb (default ) = test
testhost (default ) =
testpassword (default ) =
testsocket (default ) =
testuser (guessed ) = root
To change these settings, see 'perl Makefile.PL --help' and
'perldoc INSTALL'.
Checking if your kit is complete...
Looks good
Unrecognized argument in LIBS ignored: '-rdynamic'
Using DBI 1.609 (for perl 5.008008 on x86_64-linux-thread-multi) installed in /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/auto/DBI/
Writing Makefile for DBD::mysql
[root@croracle02 DBD-mysql-4.012]#
[root@croracle02 DBD-mysql-4.012]# make
[root@croracle02 DBD-mysql-4.012]# make test
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/00base....................ok
t/10connect.................ok
t/20createdrop..............ok
t/25lockunlock..............ok
t/29warnings................ok
...
[root@croracle02 DBD-mysql-4.012]# make install
校驗:
[root@croracle02 software]# ./perl-module.pl
DBD::mysql
DBI
Perl[root@croracle02 software]#
c. Install XML-parser
[root@croracle02 software]# tar xvfz XML-Parser-2.36.tar.gz
XML-Parser-2.36/
XML-Parser-2.36/Changes
XML-Parser-2.36/Expat/
XML-Parser-2.36/Expat/encoding.h
XML-Parser-2.36/Expat/Expat.pm
XML-Parser-2.36/Expat/Expat.xs
XML-Parser-2.36/Expat/Makefile.PL
XML-Parser-2.36/Expat/typemap
XML-Parser-2.36/Makefile.PL
XML-Parser-2.36/MANIFEST
XML-Parser-2.36/META.yml
XML-Parser-2.36/Parser/
XML-Parser-2.36/Parser/Encodings/
XML-Parser-2.36/Parser/Encodings/big5.enc
XML-Parser-2.36/Parser/Encodings/euc-kr.enc
XML-Parser-2.36/Parser/Encodings/iso-8859-2.enc
XML-Parser-2.36/Parser/Encodings/iso-8859-3.enc
XML-Parser-2.36/Parser/Encodings/iso-8859-4.enc
XML-Parser-2.36/Parser/Encodings/iso-8859-5.enc
XML-Parser-2.36/Parser/Encodings/iso-8859-7.enc
XML-Parser-2.36/Parser/Encodings/iso-8859-8.enc
XML-Parser-2.36/Parser/Encodings/iso-8859-9.enc
XML-Parser-2.36/Parser/Encodings/Japanese_Encodings.msg
XML-Parser-2.36/Parser/Encodings/README
XML-Parser-2.36/Parser/Encodings/windows-1250.enc
XML-Parser-2.36/Parser/Encodings/windows-1252.enc
XML-Parser-2.36/Parser/Encodings/x-euc-jp-jisx0221.enc
XML-Parser-2.36/Parser/Encodings/x-euc-jp-unicode.enc
XML-Parser-2.36/Parser/Encodings/x-sjis-cp932.enc
XML-Parser-2.36/Parser/Encodings/x-sjis-jdk117.enc
XML-Parser-2.36/Parser/Encodings/x-sjis-jisx0221.enc
XML-Parser-2.36/Parser/Encodings/x-sjis-unicode.enc
XML-Parser-2.36/Parser/LWPExternEnt.pl
XML-Parser-2.36/Parser/Style/
XML-Parser-2.36/Parser/Style/Debug.pm
XML-Parser-2.36/Parser/Style/Objects.pm
XML-Parser-2.36/Parser/Style/Stream.pm
XML-Parser-2.36/Parser/Style/Subs.pm
XML-Parser-2.36/Parser/Style/Tree.pm
XML-Parser-2.36/Parser.pm
XML-Parser-2.36/README
XML-Parser-2.36/samples/
XML-Parser-2.36/samples/canonical
XML-Parser-2.36/samples/canontst.xml
XML-Parser-2.36/samples/ctest.dtd
XML-Parser-2.36/samples/REC-xml-19980210.xml
XML-Parser-2.36/samples/xmlcomments
XML-Parser-2.36/samples/xmlfilter
XML-Parser-2.36/samples/xmlstats
XML-Parser-2.36/t/
XML-Parser-2.36/t/astress.t
XML-Parser-2.36/t/cdata.t
XML-Parser-2.36/t/decl.t
XML-Parser-2.36/t/defaulted.t
XML-Parser-2.36/t/encoding.t
XML-Parser-2.36/t/ext.ent
XML-Parser-2.36/t/ext2.ent
XML-Parser-2.36/t/external_ent.t
XML-Parser-2.36/t/file.t
XML-Parser-2.36/t/finish.t
XML-Parser-2.36/t/foo.dtd
XML-Parser-2.36/t/namespaces.t
XML-Parser-2.36/t/parament.t
XML-Parser-2.36/t/partial.t
XML-Parser-2.36/t/skip.t
XML-Parser-2.36/t/stream.t
XML-Parser-2.36/t/styles.t
[root@croracle02 software]#
[root@croracle02 XML-Parser-2.36]# perl Makefile.PL
Checking if your kit is complete...
Looks good
Writing Makefile for XML::Parser::Expat
Writing Makefile for XML::Parser
[root@croracle02 XML-Parser-2.36]# make
[root@croracle02 XML-Parser-2.36]# make test
make[1]: Entering directory `/root/software/XML-Parser-2.36/Expat'
make[1]: Leaving directory `/root/software/XML-Parser-2.36/Expat'
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/astress.........ok
t/cdata...........ok
t/decl............ok
t/defaulted.......ok
t/encoding........ok
t/external_ent....ok
t/file............ok
t/finish..........ok
t/namespaces......ok
t/parament........ok
t/partial.........ok
t/skip............ok
t/stream..........ok
t/styles..........ok
All tests successful.
Files=14, Tests=130, 1 wallclock secs ( 0.60 cusr + 0.32 csys = 0.92 CPU)
[root@croracle02 XML-Parser-2.36]#
[root@croracle02 XML-Parser-2.36]# make install
校驗:
[root@croracle02 software]# ./perl-module.pl
DBD::mysql
DBI
Perl
XML::Parser[root@croracle02 software]#
. 安裝 MySQL-ZRM
rpm -ivh MySQL-zrm-2.1-1.noarch.rpm --nodeps
[root@croracle02 software]# rpm -Uvh MySQL-zrm-2.1-1.noarch.rpm
warning: MySQL-zrm-2.1-1.noarch.rpm: Header V3 DSA signature: NOKEY, key ID 3c5d1c92
error: Failed dependencies:
perl(XML::Parser) is needed by MySQL-zrm-2.1-1.noarch
perl-DBI is needed by MySQL-zrm-2.1-1.noarch
[root@croracle02 software]#
[root@croracle02 software]# rpm -ivh MySQL-zrm-2.1-1.noarch.rpm --nodeps
warning: MySQL-zrm-2.1-1.noarch.rpm: Header V3 DSA signature: NOKEY, key ID 3c5d1c92
Preparing... ########################################### [100%]
1:MySQL-zrm ########################################### [100%]
Checking and Migrating old ZRM data
[root@croracle02 software]#
. 創建備份腳本 Create directory and copy default configuration file to create the first ZRM backup set “DailyBackupDB1”
[root@croracle02 software]# mkdir /etc/mysql-zrm/DailyBackupDB1
[root@croracle02 software]#
cp /etc/mysql-zrm/mysql-zrm.conf /etc/mysql-zrm/DailyBackupDB1
[root@croracle02 software]# cp /etc/mysql-zrm/mysql-zrm.conf /etc/mysql-zrm/DailyBackupDB1
[root@croracle02 software]#
. Edit the /etc/mysql-zrm/DailyBackupDB1/mysql-zrm.conf and make the changes to the lines below:
配置信息編輯:
compress=1
compress-plugin=/usr/bin/gzip
encrypt=1
encrypt-plugin="/usr/share/mysql-zrm/plugins/encrypt.pl"
databases=moviesinnodb moviesmyisam
user="backup-user"
password="password"
host="172.16.1.162"
mailto="mysqldba@company.com"
copy-plugin=/usr/share/mysql-zrm/plugins/socket-copy.pl
.Create file that contains the passphrase used for backup encryption
密碼詞創建:
[root@croracle02 DailyBackupDB1]# touch /etc/mysql-zrm/.passphrase
[root@croracle02 DailyBackupDB1]# echo encryptpass > /etc/mysql-zrm/.passphrase
[root@croracle02 DailyBackupDB1]# chmod 700 /etc/mysql-zrm/.passphrase
[root@croracle02 DailyBackupDB1]#
.In order for encryption to work the /root/.gnupg directory must me created
[root@croracle02 DailyBackupDB1]# mkdir /root/.gnupg/
[root@croracle02 DailyBackupDB1]# chmod 600 /root/.gnupg/
[root@croracle02 DailyBackupDB1]#
2. Prepare “172.16.1.162準備” for backup by ZRM
[root@CRRACTEST ~]# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 5
Server version: 5.0.45 Source distribution
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>
. 162mysql 創建用戶及進行授權
GRANT LOCK TABLES, SELECT, FILE, CREATE, DROP, INDEX, SHUTDOWN, ALTER, INSERT, SUPER, RELOAD ON *.* TO 'backup-user'@'172.16.1.166' IDENTIFIED BY 'password';
mysql> GRANT LOCK TABLES, SELECT, FILE, CREATE, DROP, INDEX, SHUTDOWN, ALTER, INSERT, SUPER, RELOAD ON *.* TO 'backup-user'@'172.16.1.166' IDENTIFIED BY 'password';
Query OK, 0 rows affected (0.08 sec)
mysql>
. Give Privileges to "backup-user" to connect locally from "162"
本地授權
GRANT LOCK TABLES, SELECT, FILE, CREATE, DROP, INDEX, SHUTDOWN, ALTER, INSERT, SUPER, RELOAD ON *.* TO 'backup-user'@'172.16.1.162' IDENTIFIED BY 'password';
GRANT LOCK TABLES, SELECT, FILE, CREATE, DROP, INDEX, SHUTDOWN, ALTER, INSERT, SUPER, RELOAD ON *.* TO 'backup-user'@'localhost' IDENTIFIED BY 'password';
mysql> GRANT LOCK TABLES, SELECT, FILE, CREATE, DROP, INDEX, SHUTDOWN, ALTER, INSERT, SUPER, RELOAD ON *.* TO 'backup-user'@'172.16.1.162' IDENTIFIED BY 'password';
Query OK, 0 rows affected (0.00 sec)
mysql> GRANT LOCK TABLES, SELECT, FILE, CREATE, DROP, INDEX, SHUTDOWN, ALTER, INSERT, SUPER, RELOAD ON *.* TO 'backup-user'@'localhost' IDENTIFIED BY 'password';
Query OK, 0 rows affected (0.00 sec)
mysql>
mysql> flush privileges;
Query OK, 0 rows affected (0.02 sec)
mysql>
校驗
[root@CRRACTEST ~]# mysql -ubackup-user -ppassword
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 6
Server version: 5.0.45 Source distribution
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>
162 沒有問題
f. Enable binary logging on the MySQL server by editing the /etc/my.cnf file and specifying the “log-bin” parameter under the “[mysqld]” section. This will enable incremental backups of the InnoDB database “moviesinnodb” .
編輯 162 /etc/my.cnf 文件
log-bin=/var/lib/mysql/mysql-bin
[root@CRRACTEST init.d]# ./mysqld restart
Stopping MySQL: [ OK ]
Starting MySQL: [ OK ]
[root@CRRACTEST init.d]# cd /var/lib/mysql/
[root@CRRACTEST mysql]# ls
crontest ib_logfile0 importtest mysql-bin.000001 mysql.sock test2
ibdata1 ib_logfile1 mysql mysql-bin.index test
[root@CRRACTEST mysql]#
在162上安裝 zrm client端軟件:
[root@CRRACTEST ~]# rpm -Uvh MySQL-zrm-client-2.1-1.noarch.rpm
warning: MySQL-zrm-client-2.1-1.noarch.rpm: Header V3 DSA signature: NOKEY, key ID 3c5d1c92
Preparing... ########################################### [100%]
1:MySQL-zrm-client ########################################### [100%]
Aug 14 2009 15:27:41: Reloading xinetd configuration...Reloading configuration: [ OK ]
[root@CRRACTEST ~]#
Configure firewall for backups between “166” and “db1.162”
配置防火牆,因為是測試這裡沒有使用防火牆
4. Setting Up ZRM on “166” to backup the (moviesmyisam) database running on “172.16.1.165”
(ssh-copy模式)的配置
[root@croracle02 DailyBackupDB1]# mkdir /etc/mysql-zrm/DailyBackupDB2
[root@croracle02 DailyBackupDB1]# cp /etc/mysql-zrm/mysql-zrm.conf /etc/mysql-zrm/DailyBackupDB2
配置文件的內容:
[root@croracle02 DailyBackupDB2]# cat mysql-zrm.conf |grep -v ^# |grep -v ^$
compress=1
compress-plugin=/usr/bin/gzip
encrypt=1
encrypt-plugin="/usr/share/mysql-zrm/plugins/encrypt.pl"
databases=moviesmyisam
user="backup-user"
password="password"
host="172.16.1.165"
mailto=username@company.com
copy-plugin=/usr/share/mysql-zrm/plugins/socket-copy.pl
ssh-user="mysql"
Create ssh keys for user “root” on “166”
創建ssh public key
[root@croracle02 DailyBackupDB2]# mkdir /root/.ssh
mkdir: cannot create directory `/root/.ssh': File exists
[root@croracle02 DailyBackupDB2]# chmod 700 /root/.ssh
[root@croracle02 DailyBackupDB2]# ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
b8:0f:09:0f:bf:e8:08:cc:28:23:3a:10:85:76:73:f3 root@croracle02.localdomain
[root@croracle02 DailyBackupDB2]#
. Set up firewall for backups between “166” and “165”
這裡是測試環境沒有設置防火牆
權限設定
[root@croracle01 ~]# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.1.36-community-log MySQL Community Server (GPL)
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
GRANT LOCK TABLES, SELECT, FILE, CREATE, DROP, INDEX, SHUTDOWN, ALTER, INSERT, SUPER, RELOAD ON *.* TO 'backup-user'@'172.16.1.165' IDENTIFIED BY 'password';
GRANT LOCK TABLES, SELECT, FILE, CREATE, DROP, INDEX, SHUTDOWN, ALTER, INSERT, SUPER, RELOAD ON *.* TO 'backup-user'@'localhost' IDENTIFIED BY 'password';
GRANT LOCK TABLES, SELECT, FILE, CREATE, DROP, INDEX, SHUTDOWN, ALTER, INSERT, SUPER, RELOAD ON *.* TO 'backup-user'@'localhost' IDENTIFIED BY 'password';
mysql> GRANT LOCK TABLES, SELECT, FILE, CREATE, DROP, INDEX, SHUTDOWN, ALTER, INSERT, SUPER, RELOAD ON *.* TO 'backup-user'@'172.16.1.166' IDENTIFIED BY 'password';
Query OK, 0 rows affected (0.33 sec)
GRANT LOCK TABLES, SELECT, FILE, CREATE, DROP, INDEX, SHUTDOWN, ALTER, INSERT, SUPER, RELOAD ON *.* TO 'backup-user'@'croracle02.localdomain' IDENTIFIED BY 'password';
mysql>
mysql> GRANT LOCK TABLES, SELECT, FILE, CREATE, DROP, INDEX, SHUTDOWN, ALTER, INSERT, SUPER, RELOAD ON *.* TO 'backup-user'@'172.16.1.165' IDENTIFIED BY 'password';
Query OK, 0 rows affected (0.00 sec)
mysql> GRANT LOCK TABLES, SELECT, FILE, CREATE, DROP, INDEX, SHUTDOWN, ALTER, INSERT, SUPER, RELOAD ON *.* TO 'backup-user'@'localhost' IDENTIFIED BY 'password';
Query OK, 0 rows affected (0.00 sec)
mysql>
mysql> flush privileges;
Query OK, 0 rows affected (0.04 sec)
mysql>
校驗
[root@croracle01 ~]# mysql -ubackup-user -ppassword
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.1.36-community-log MySQL Community Server (GPL)
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
. The default “mysql” user will be used to connect to "db2.zmanda.com" and needs to be created if doesn't already exist.
檢查mysql用戶是否存在
mysql:x:100:103:MySQL server:/var/lib/mysql:/bin/bash
. Create the .ssh directory where the public ssh key will be stored. This user is needed to establish a connection from the MySQL-ZRM server “166”.
創建相應的ssh public key 存放路徑并授權
[root@croracle01 ~]# mkdir /var/lib/mysql/.ssh
[root@croracle01 ~]# chown mysql /var/lib/mysql/.ssh
[root@croracle01 ~]# chmod 700 /var/lib/mysql/.ssh
[root@croracle01 ~]#
. Copy the contents of /root/.ssh/id_rsa.pub file located on 166 to the file “authorized_keys” on db2.165
On server “166” run:
[root@quartz .ssh]# scp /root/.ssh/id_rsa.pub root@172.16.1.165:/var/lib/mysql/.ssh/authorized_keys
[root@croracle02 ~]# scp /root/.ssh/id_rsa.pub root@172.16.1.165:/var/lib/mysql/.ssh/authorized_keys
root@172.16.1.165's password:
id_rsa.pub 100% 409 0.4KB/s 00:00
[root@croracle02 ~]#
[root@croracle01 ~]# chmod 600 /var/lib/mysql/.ssh/authorized_keys
[root@croracle01 ~]# chown mysql /var/lib/mysql/.ssh/authorized_keys
[root@croracle01 ~]#
db1 創建測試數據
[root@CRRACTEST ~]# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.0.45-log Source distribution
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> create database moviesinnodb
-> ;
Query OK, 1 row affected (0.00 sec)
mysql> use moviesinnodb
Database changed
mysql> create table db1_test(id int);
Query OK, 0 rows affected (0.01 sec)
mysql> insert into db1_test values(1),(2),(3),(4);
Query OK, 4 rows affected (0.00 sec)
Records: 4 Duplicates: 0 Warnings: 0
mysql> select * from db1_test;
+------+
| id |
+------+
| 1 |
| 2 |
| 3 |
| 4 |
+------+
4 rows in set (0.00 sec)
mysql>
mysql> select database();
+--------------+
| database() |
+--------------+
| moviesinnodb |
+--------------+
1 row in set (0.00 sec)
mysql>
mysql> create database moviesmyisam;
Query OK, 1 row affected (0.00 sec)
mysql> use moviesmyisam
Database changed
mysql> create table db1_test2 (id int);
Query OK, 0 rows affected (0.00 sec)
mysql> insert into db1_test2 values(5),(6),(7),(8);
Query OK, 4 rows affected (0.00 sec)
Records: 4 Duplicates: 0 Warnings: 0
mysql> select * from db1_test2;
+------+
| id |
+------+
| 5 |
| 6 |
| 7 |
| 8 |
+------+
4 rows in set (0.00 sec)
mysql>
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| crontest |
| importtest |
| moviesinnodb |
| moviesmyisam |
| mysql |
| test |
| test2 |
+--------------------+
8 rows in set (0.00 sec)
mysql>
. Execute a test backup of databases on both “162” and “165”
執行backup測試(162,165)
. Execute backup of databases (moviesinnodb / moviesmyisam) on server “162”
先在162上進行試驗:
mysql-zrm-scheduler --backup-set DailyBackupDB1 --backup-level 0 --now
[root@croracle02 ~]# mysql-zrm-scheduler --backup-set DailyBackupDB1 --backup-level 0 --now
schedule:INFO: ZRM for MySQL Community Edition - version 2.1
Logging to /var/log/mysql-zrm/mysql-zrm-scheduler.log
backup:INFO: ZRM for MySQL Community Edition - version 2.1
DailyBackupDB1:backup:INFO: START OF BACKUP
DailyBackupDB1:backup:INFO: PHASE START: Initialization
DailyBackupDB1:backup:INFO: backup-set=DailyBackupDB1
DailyBackupDB1:backup:INFO: backup-date=20090813071855
DailyBackupDB1:backup:INFO: mysql-server-os=Linux/Unix
DailyBackupDB1:backup:INFO: backup-type=regular
DailyBackupDB1:backup:INFO: host=172.16.1.162
DailyBackupDB1:backup:INFO: backup-date-epoch=1250119135
DailyBackupDB1:backup:INFO: mysql-zrm-version=ZRM for MySQL Community Edition - version 2.1
DailyBackupDB1:backup:INFO: mysql-version=5.0.45-log
DailyBackupDB1:backup:INFO: backup-directory=/var/lib/mysql-zrm/DailyBackupDB1/20090813071855
DailyBackupDB1:backup:INFO: backup-level=0
DailyBackupDB1:backup:INFO: backup-mode=raw
DailyBackupDB1:backup:INFO: PHASE END: Initialization
DailyBackupDB1:backup:INFO: PHASE START: Running pre backup plugin
DailyBackupDB1:backup:INFO: PHASE END: Running pre backup plugin
DailyBackupDB1:backup:INFO: PHASE START: Flushing logs
DailyBackupDB1:backup:INFO: PHASE END: Flushing logs
DailyBackupDB1:backup:INFO: PHASE START: Find table type
DailyBackupDB1:backup:INFO: PHASE END: Find table type
DailyBackupDB1:backup:INFO: PHASE START: Creating raw backup
DailyBackupDB1:backup:INFO: raw-databases=moviesinnodb moviesmyisam
DailyBackupDB1:backup:INFO: PHASE END: Creating raw backup
DailyBackupDB1:backup:INFO: PHASE START: Calculating backup size & checksums
DailyBackupDB1:backup:INFO: next-binlog=mysql-bin.000002
DailyBackupDB1:backup:INFO: backup-size=0.03 MB
DailyBackupDB1:backup:INFO: PHASE END: Calculating backup size & checksums
DailyBackupDB1:backup:INFO: PHASE START: Compression/Encryption
DailyBackupDB1:backup:INFO: compress=/usr/bin/gzip
DailyBackupDB1:backup:INFO: encrypt=/usr/share/mysql-zrm/plugins/encrypt.pl
DailyBackupDB1:backup:INFO: decrypt-option=-d
DailyBackupDB1:backup:INFO: backup-size-compressed=0.00 MB
DailyBackupDB1:backup:INFO: PHASE END: Compression/Encryption
DailyBackupDB1:backup:INFO: read-locks-time=00:00:26
DailyBackupDB1:backup:INFO: flush-logs-time=00:00:05
DailyBackupDB1:backup:INFO: compress-encrypt-time=00:00:00
DailyBackupDB1:backup:INFO: backup-time=00:01:01
DailyBackupDB1:backup:INFO: backup-status=Backup succeeded
DailyBackupDB1:backup:INFO: Backup succeeded
DailyBackupDB1:backup:INFO: PHASE START: Running post backup plugin
DailyBackupDB1:backup:INFO: PHASE END: Running post backup plugin
DailyBackupDB1:backup:INFO: PHASE START: Mailing backup report
DailyBackupDB1:backup:INFO: PHASE END: Mailing backup report
DailyBackupDB1:backup:INFO: PHASE START: Cleanup
DailyBackupDB1:backup:INFO: PHASE END: Cleanup
DailyBackupDB1:backup:INFO: END OF BACKUP
/usr/bin/mysql-zrm started successfully
[root@croracle02 ~]#
備份成功!
建造db2的測試數據
[root@croracle01 ~]# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 5
Server version: 5.1.36-community-log MySQL Community Server (GPL)
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> create database moviesinnodb;
Query OK, 1 row affected (0.02 sec)
mysql> use moviesinnodb
Database changed
mysql> create table db2_test (id int);
Query OK, 0 rows affected (0.14 sec)
mysql> insert into db2_test values(9),(10),(11),(12);
Query OK, 4 rows affected (0.01 sec)
Records: 4 Duplicates: 0 Warnings: 0
mysql> select * from db2_test;
+------+
| id |
+------+
| 9 |
| 10 |
| 11 |
| 12 |
+------+
4 rows in set (0.01 sec)
mysql>
--DB2 安裝
[root@croracle01 ~]# rpm -Uvh MySQL-zrm-client-2.1-1.noarch.rpm
warning: MySQL-zrm-client-2.1-1.noarch.rpm: Header V3 DSA signature: NOKEY, key ID 3c5d1c92
Preparing... ########################################### [100%]
1:MySQL-zrm-client ########################################### [100%]
Aug 15 2009 00:08:42: Reloading xinetd configuration...Reloading configuration: [ OK ]
[root@croracle01 ~]#
mysql-zrm-scheduler --backup-set DailyBackupDB2 --backup-level 0 --now
備份測試:
[root@croracle02 DailyBackupDB2]# mysql-zrm-scheduler --backup-set DailyBackupDB2 --backup-level 0 --now --verbose
schedule:INFO: ZRM for MySQL Community Edition - version 2.1
schedule:INFO: Reading options from file /etc/mysql-zrm/mysql-zrm.conf
DailyBackupDB2:schedule:INFO: Reading options from file /etc/mysql-zrm/DailyBackupDB2/mysql-zrm.conf
DailyBackupDB2:schedule:WARNING: Could not open file /etc/mysql-zrm/DailyBackupDB2/last_backup. No such file or directory
Logging to /var/log/mysql-zrm/mysql-zrm-scheduler.log
backup:INFO: ZRM for MySQL Community Edition - version 2.1
DailyBackupDB2:backup:INFO: START OF BACKUP
DailyBackupDB2:backup:INFO: PHASE START: Initialization
DailyBackupDB2:backup:INFO: backup-set=DailyBackupDB2
DailyBackupDB2:backup:INFO: backup-date=20090813083956
DailyBackupDB2:backup:INFO: mysql-server-os=Linux/Unix
DailyBackupDB2:backup:INFO: backup-type=regular
DailyBackupDB2:backup:INFO: host=172.16.1.165
DailyBackupDB2:backup:INFO: backup-date-epoch=1250123996
DailyBackupDB2:backup:INFO: mysql-zrm-version=ZRM for MySQL Community Edition - version 2.1
DailyBackupDB2:backup:INFO: mysql-version=5.1.36-community-log
DailyBackupDB2:backup:INFO: backup-directory=/var/lib/mysql-zrm/DailyBackupDB2/20090813083956
DailyBackupDB2:backup:INFO: backup-level=0
DailyBackupDB2:backup:INFO: backup-mode=raw
DailyBackupDB2:backup:INFO: PHASE END: Initialization
DailyBackupDB2:backup:INFO: PHASE START: Running pre backup plugin
DailyBackupDB2:backup:INFO: PHASE END: Running pre backup plugin
DailyBackupDB2:backup:INFO: PHASE START: Flushing logs
DailyBackupDB2:backup:INFO: PHASE END: Flushing logs
DailyBackupDB2:backup:INFO: PHASE START: Find table type
DailyBackupDB2:backup:INFO: PHASE END: Find table type
DailyBackupDB2:backup:INFO: PHASE START: Creating raw backup
DailyBackupDB2:backup:ERROR: Output of command: 'mysqlhotcopy' is {
Can't locate DBI.pm in @INC (@INC contains: /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi /usr/lib64/perl5/site_perl/5.8.7/x86_64-linux-thread-multi /usr/lib64/perl5/site_perl/5.8.6/x86_64-linux-thread-multi /usr/lib64/perl5/site_perl/5.8.5/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl/5.8.7 /usr/lib/perl5/site_perl/5.8.6 /usr/lib/perl5/site_perl/5.8.5 /usr/lib/perl5/site_perl /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi /usr/lib64/perl5/vendor_perl/5.8.7/x86_64-linux-thread-multi /usr/lib64/perl5/vendor_perl/5.8.6/x86_64-linux-thread-multi /usr/lib64/perl5/vendor_perl/5.8.5/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl/5.8.7 /usr/lib/perl5/vendor_perl/5.8.6 /usr/lib/perl5/vendor_perl/5.8.5 /usr/lib/perl5/vendor_perl /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/5.8.8 .) at /usr/bin/mysqlhotcopy line 8.
BEGIN failed--compilation aborted at /usr/bin/mysqlhotcopy line 8.
mysqlhotcopy on host 172.16.1.165 failed at /usr/share/mysql-zrm/plugins/ssh-copy.pl line 322.
}
DailyBackupDB2:backup:ERROR: mysqlhotcopy did not succeed. Command used is /usr/share/mysql-zrm/plugins/ssh-copy.pl --mysqlhotcopy --user="backup-user" --password="*****" --host="172.16.1.165" --quiet moviesmyisam "/var/lib/mysql-zrm/DailyBackupDB2/20090813083956" > /tmp/BgXcvtmDX9 2>&1 Return value is 512
DailyBackupDB2:backup:INFO: PHASE START: Cleanup
DailyBackupDB2:backup:INFO: backup-status=Backup failed
DailyBackupDB2:backup:INFO: Backup failed
DailyBackupDB2:backup:INFO: PHASE END: Cleanup
DailyBackupDB2:backup:INFO: END OF BACKUP
ERROR: /usr/bin/mysql-zrm did not finish successfully
[root@croracle02 DailyBackupDB2]#
問題解決:
將
DBD-mysql-4.012.tar.gz DBI-1.609.tar.gz XML-Parser-2.36.tar.gz
安裝在db2.165上就可以了
[root@croracle02 ~]# mysql-zrm-scheduler --backup-set DailyBackupDB2 --backup-level 0 --now
schedule:INFO: ZRM for MySQL Community Edition - version 2.1
Logging to /var/log/mysql-zrm/mysql-zrm-scheduler.log
backup:INFO: ZRM for MySQL Community Edition - version 2.1
DailyBackupDB2:backup:INFO: START OF BACKUP
DailyBackupDB2:backup:INFO: PHASE START: Initialization
DailyBackupDB2:backup:INFO: backup-set=DailyBackupDB2
DailyBackupDB2:backup:INFO: backup-date=20090816175909
DailyBackupDB2:backup:INFO: mysql-server-os=Linux/Unix
DailyBackupDB2:backup:INFO: backup-type=regular
DailyBackupDB2:backup:INFO: host=172.16.1.165
DailyBackupDB2:backup:INFO: backup-date-epoch=1250416749
DailyBackupDB2:backup:INFO: mysql-zrm-version=ZRM for MySQL Community Edition - version 2.1
DailyBackupDB2:backup:INFO: mysql-version=5.1.36-community-log
DailyBackupDB2:backup:INFO: backup-directory=/var/lib/mysql-zrm/DailyBackupDB2/20090816175909
DailyBackupDB2:backup:INFO: backup-level=0
DailyBackupDB2:backup:INFO: backup-mode=raw
DailyBackupDB2:backup:INFO: PHASE END: Initialization
DailyBackupDB2:backup:INFO: PHASE START: Running pre backup plugin
DailyBackupDB2:backup:INFO: PHASE END: Running pre backup plugin
DailyBackupDB2:backup:INFO: PHASE START: Flushing logs
DailyBackupDB2:backup:INFO: PHASE END: Flushing logs
DailyBackupDB2:backup:INFO: PHASE START: Find table type
DailyBackupDB2:backup:INFO: PHASE END: Find table type
DailyBackupDB2:backup:INFO: PHASE START: Creating raw backup
DailyBackupDB2:backup:INFO: raw-databases=moviesmyisam
DailyBackupDB2:backup:INFO: PHASE END: Creating raw backup
DailyBackupDB2:backup:INFO: PHASE START: Calculating backup size & checksums
DailyBackupDB2:backup:INFO: next-binlog=mysql-bin.000027
DailyBackupDB2:backup:INFO: backup-size=0.02 MB
DailyBackupDB2:backup:INFO: PHASE END: Calculating backup size & checksums
DailyBackupDB2:backup:INFO: PHASE START: Compression/Encryption
DailyBackupDB2:backup:INFO: compress=/usr/bin/gzip
DailyBackupDB2:backup:INFO: encrypt=/usr/share/mysql-zrm/plugins/encrypt.pl
DailyBackupDB2:backup:INFO: decrypt-option=-d
DailyBackupDB2:backup:INFO: backup-size-compressed=0.00 MB
DailyBackupDB2:backup:INFO: PHASE END: Compression/Encryption
DailyBackupDB2:backup:INFO: read-locks-time=00:00:04
DailyBackupDB2:backup:INFO: flush-logs-time=00:00:00
DailyBackupDB2:backup:INFO: compress-encrypt-time=00:00:10
DailyBackupDB2:backup:INFO: backup-time=00:00:05
DailyBackupDB2:backup:INFO: backup-status=Backup succeeded
DailyBackupDB2:backup:INFO: Backup succeeded
DailyBackupDB2:backup:INFO: PHASE START: Running post backup plugin
DailyBackupDB2:backup:INFO: PHASE END: Running post backup plugin
DailyBackupDB2:backup:INFO: PHASE START: Mailing backup report
DailyBackupDB2:backup:INFO: PHASE END: Mailing backup report
DailyBackupDB2:backup:INFO: PHASE START: Cleanup
DailyBackupDB2:backup:INFO: PHASE END: Cleanup
DailyBackupDB2:backup:INFO: END OF BACKUP
/usr/bin/mysql-zrm started successfully
[root@croracle02 ~]#
Verify both backups and check performance stats
檢查狀態:
[root@croracle02 ~]# mysql-zrm --action verify-backup --backup-set DailyBackupDB1
verify-backup:INFO: ZRM for MySQL Community Edition - version 2.1
DailyBackupDB1:verify-backup:INFO: Verification successful
[root@croracle02 ~]# mysql-zrm --action verify-backup --backup-set DailyBackupDB2
verify-backup:INFO: ZRM for MySQL Community Edition - version 2.1
DailyBackupDB2:verify-backup:INFO: Verification successful
[root@croracle02 ~]#
[root@croracle02 ~]# mysql-zrm-reporter --show backup-performance-info
reporter:WARNING: Backup root directory not specified, Assigning default value as /var/lib/mysql-zrm
REPORT TYPE : backup-performance-info
backup_set backup_date backup_level backup_size backup_size_compressed backup_time backup_type compress_encrypt_time
----------------------------------------------------------------------------------------------------------------------------------------------------------------
DailyBackupDB2 Sun 16 Aug 2009 05:59:09 0 0.02 MB 0.00 MB 00:00:05 regular 00:00:10
PM HKT
DailyBackupDB2 Sun 16 Aug 2009 05:55:40 0 ---- ---- ---- regular ----
PM HKT
DailyBackupDB2 Sun 16 Aug 2009 05:44:05 0 ---- ---- ---- regular ----
PM HKT
DailyBackupDB2 Thu 13 Aug 2009 10:28:06 0 ---- ---- ---- regular ----
AM HKT
DailyBackupDB2 Thu 13 Aug 2009 10:00:20 0 ---- ---- ---- regular ----
AM HKT
DailyBackupDB2 Thu 13 Aug 2009 09:36:08 0 ---- ---- ---- regular ----
AM HKT
DailyBackupDB2 Thu 13 Aug 2009 09:30:18 0 ---- ---- ---- regular ----
AM HKT
DailyBackupDB2 Thu 13 Aug 2009 08:59:15 0 ---- ---- ---- regular ----
AM HKT
DailyBackupDB2 Thu 13 Aug 2009 08:58:11 0 ---- ---- ---- regular ----
AM HKT
DailyBackupDB2 Thu 13 Aug 2009 08:39:56 0 ---- ---- ---- regular ----
AM HKT
DailyBackupDB2 Thu 13 Aug 2009 08:37:34 0 ---- ---- ---- regular ----
AM HKT
DailyBackupDB2 Thu 13 Aug 2009 08:28:16 0 ---- ---- ---- regular ----
AM HKT
DailyBackupDB2 Thu 13 Aug 2009 08:23:46 0 ---- ---- ---- regular ----
AM HKT
DailyBackupDB2 Thu 13 Aug 2009 08:12:19 0 ---- ---- ---- regular ----
AM HKT
DailyBackupDB2 Thu 13 Aug 2009 08:05:53 0 ---- ---- ---- regular ----
AM HKT
DailyBackupDB2 Thu 13 Aug 2009 08:04:56 0 ---- ---- ---- regular ----
AM HKT
DailyBackupDB2 Thu 13 Aug 2009 08:00:30 0 ---- ---- ---- regular ----
AM HKT
DailyBackupDB1 Thu 13 Aug 2009 07:18:55 0 0.03 MB 0.00 MB 00:01:01 regular 00:00:00
AM HKT
[root@croracle02 ~]#
配置自動工作:
Setup Automated backups using ZRM scheduler
a. Configure automated Full and Incremental backups for DailyBackupDB1. Incremental Mon-Fri at 1:00am and Full on Saturday 1:00am.
[root@croracle02 ~]# mysql-zrm-scheduler --add --interval weekly --start-time 1:00 --day-of-week 1-5 --backup-level 1 --backup-set DailyBackupDB1
schedule:INFO: ZRM for MySQL Community Edition - version 2.1
Logging to /var/log/mysql-zrm/mysql-zrm-scheduler.log
DONE
[root@croracle02 ~]#
[root@croracle02 ~]# mysql-zrm-scheduler --add --interval weekly --start-time 1:00 --day-of-week 6 --backup-level 0 --backup-set DailyBackupDB1
schedule:INFO: ZRM for MySQL Community Edition - version 2.1
Logging to /var/log/mysql-zrm/mysql-zrm-scheduler.log
DONE
[root@croracle02 ~]#
[root@croracle02 ~]# mysql-zrm-scheduler --add --interval weekly --start-time 1:00 --day-of-week 1-5 --backup-level 0 --backup-set DailyBackupDB2
schedule:INFO: ZRM for MySQL Community Edition - version 2.1
Logging to /var/log/mysql-zrm/mysql-zrm-scheduler.log
DONE
[root@croracle02 ~]#
[root@croracle02 ~]# mysql-zrm-scheduler --query
schedule:INFO: ZRM for MySQL Community Edition - version 2.1
Logging to /var/log/mysql-zrm/mysql-zrm-scheduler.log
0 1 * * 1-5 /usr/bin/zrm-pre-scheduler --action backup --backup-set DailyBackupDB1 --backup-level 1 --interval weekly
0 1 * * 6 /usr/bin/zrm-pre-scheduler --action backup --backup-set DailyBackupDB1 --backup-level 0 --interval weekly
0 1 * * 1-5 /usr/bin/zrm-pre-scheduler --action backup --backup-set DailyBackupDB2 --backup-level 0 --interval weekly
[root@croracle02 ~]#
Perform a test recovery of the databases on both database servers
[root@croracle02 ~]# mysql-zrm-reporter --show restore-info --where backup-set=DailyBackupDB1
reporter:WARNING: Backup root directory not specified, Assigning default value as /var/lib/mysql-zrm
REPORT TYPE : restore-info
backup_set backup_date backup_level backup_directory backup_status comment
-----------------------------------------------------------------------------------------------------------------------------------------------------
DailyBackupDB1 Thu 13 Aug 2009 07:18:55 0 /var/lib/mysql-zrm/DailyBackupDB1/200908 Backup succeeded ----
AM HKT 13071855
[root@croracle02 ~]#
[root@croracle02 ~]# mysql-zrm-reporter --show restore-info --where backup-set=DailyBackupDB2
reporter:WARNING: Backup root directory not specified, Assigning default value as /var/lib/mysql-zrm
REPORT TYPE : restore-info
backup_set backup_date backup_level backup_directory backup_status comment
-----------------------------------------------------------------------------------------------------------------------------------------------------
DailyBackupDB2 Sun 16 Aug 2009 05:59:09 0 /var/lib/mysql-zrm/DailyBackupDB2/200908 Backup succeeded ----
PM HKT 16175909
DailyBackupDB2 Sun 16 Aug 2009 05:55:40 0 /var/lib/mysql-zrm/DailyBackupDB2/200908 Backup failed ----
PM HKT 16175540
DailyBackupDB2 Sun 16 Aug 2009 05:44:05 0 /var/lib/mysql-zrm/DailyBackupDB2/200908 Backup failed ----
PM HKT 16174405
DailyBackupDB2 Thu 13 Aug 2009 10:28:06 0 /var/lib/mysql-zrm/DailyBackupDB2/200908 Backup failed ----
AM HKT 13102806
DailyBackupDB2 Thu 13 Aug 2009 10:00:20 0 /var/lib/mysql-zrm/DailyBackupDB2/200908 Backup failed ----
AM HKT 13100020
DailyBackupDB2 Thu 13 Aug 2009 09:36:08 0 /var/lib/mysql-zrm/DailyBackupDB2/200908 Backup failed ----
AM HKT 13093608
DailyBackupDB2 Thu 13 Aug 2009 09:30:18 0 /var/lib/mysql-zrm/DailyBackupDB2/200908 Backup failed ----
AM HKT 13093018
DailyBackupDB2 Thu 13 Aug 2009 08:59:15 0 /var/lib/mysql-zrm/DailyBackupDB2/200908 Backup failed ----
AM HKT 13085915
DailyBackupDB2 Thu 13 Aug 2009 08:58:11 0 /var/lib/mysql-zrm/DailyBackupDB2/200908 Backup failed ----
AM HKT 13085811
DailyBackupDB2 Thu 13 Aug 2009 08:39:56 0 /var/lib/mysql-zrm/DailyBackupDB2/200908 Backup failed ----
AM HKT 13083956
DailyBackupDB2 Thu 13 Aug 2009 08:37:34 0 /var/lib/mysql-zrm/DailyBackupDB2/200908 Backup failed ----
AM HKT 13083734
DailyBackupDB2 Thu 13 Aug 2009 08:28:16 0 /var/lib/mysql-zrm/DailyBackupDB2/200908 Backup failed ----
AM HKT 13082816
DailyBackupDB2 Thu 13 Aug 2009 08:23:46 0 /var/lib/mysql-zrm/DailyBackupDB2/200908 Backup failed ----
AM HKT 13082346
DailyBackupDB2 Thu 13 Aug 2009 08:12:19 0 /var/lib/mysql-zrm/DailyBackupDB2/200908 Backup failed ----
AM HKT 13081219
DailyBackupDB2 Thu 13 Aug 2009 08:05:53 0 /var/lib/mysql-zrm/DailyBackupDB2/200908 Backup failed ----
AM HKT 13080553
DailyBackupDB2 Thu 13 Aug 2009 08:04:56 0 /var/lib/mysql-zrm/DailyBackupDB2/200908 Backup failed ----
AM HKT 13080456
DailyBackupDB2 Thu 13 Aug 2009 08:00:30 0 /var/lib/mysql-zrm/DailyBackupDB2/200908 Backup failed ----
AM HKT 13080030
[root@croracle02 ~]#
恢復實驗:
Perform a test recovery of the databases on both database servers
先將db1 中的database刪除,模擬數據庫被毀掉
[root@CRRACTEST ~]# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 17
Server version: 5.0.45-log Source distribution
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| crontest |
| importtest |
| moviesinnodb |
| moviesmyisam |
| mysql |
| test |
| test2 |
+--------------------+
8 rows in set (0.06 sec)
mysql> drop database moviesinnodb;
Query OK, 1 row affected (0.07 sec)
mysql> drop database moviesmyisam;
Query OK, 1 row affected (0.01 sec)
mysql>
Run this command to view restore information information for backup set DailyBackupDB1
[root@croracle02 ~]# mysql-zrm-reporter --show restore-info --where backup-set=DailyBackupDB1
reporter:WARNING: Backup root directory not specified, Assigning default value as /var/lib/mysql-zrm
REPORT TYPE : restore-info
backup_set backup_date backup_level backup_directory backup_status comment
-----------------------------------------------------------------------------------------------------------------------------------------------------
DailyBackupDB1 Mon 17 Aug 2009 01:00:03 1 /var/lib/mysql-zrm/DailyBackupDB1/200908 Backup succeeded ----
AM HKT 17010003
DailyBackupDB1 Thu 13 Aug 2009 07:18:55 0 /var/lib/mysql-zrm/DailyBackupDB1/200908 Backup succeeded ----
AM HKT 13071855
[root@croracle02 ~]#
mysql-zrm --action restore --backup-set DailyBackupDB1 --source-directory /var/lib/mysql-zrm/DailyBackupDB1/20090813071855
[root@croracle02 ~]# mysql-zrm --action restore --backup-set DailyBackupDB1 --source-directory /var/lib/mysql-zrm/DailyBackupDB1/20090813071855
restore:INFO: ZRM for MySQL Community Edition - version 2.1
DailyBackupDB1:restore:INFO: Restored database from raw backup: moviesinnodb
DailyBackupDB1:restore:INFO: Restored database from raw backup: moviesmyisam
DailyBackupDB1:restore:INFO: Restore done in 3 seconds.
MySQL server has been shutdown. Please restart after verification.
[root@CRRACTEST init.d]# ./mysqld restart
Stopping MySQL: [FAILED]
Starting MySQL: [ OK ]
[root@CRRACTEST init.d]# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 5
Server version: 5.0.45-log Source distribution
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| crontest |
| importtest |
| moviesinnodb |
| moviesmyisam |
| mysql |
| test |
| test2 |
+--------------------+
8 rows in set (0.01 sec)
mysql>
[root@croracle02 ~]# mysql-zrm-reporter --show restore-info --where backup-set=DailyBackupDB2
reporter:WARNING: Backup root directory not specified, Assigning default value as /var/lib/mysql-zrm
REPORT TYPE : restore-info
backup_set backup_date backup_level backup_directory backup_status comment
-----------------------------------------------------------------------------------------------------------------------------------------------------
DailyBackupDB2 Mon 17 Aug 2009 01:00:03 0 /var/lib/mysql-zrm/DailyBackupDB2/200908 Backup succeeded ----
AM HKT 17010003
DailyBackupDB2 Sun 16 Aug 2009 05:59:09 0 /var/lib/mysql-zrm/DailyBackupDB2/200908 Backup succeeded ----
PM HKT 16175909
DailyBackupDB2 Sun 16 Aug 2009 05:55:40 0 /var/lib/mysql-zrm/DailyBackupDB2/200908 Backup failed ----
PM HKT 16175540
DailyBackupDB2 Sun 16 Aug 2009 05:44:05 0 /var/lib/mysql-zrm/DailyBackupDB2/200908 Backup failed ----
PM HKT 16174405
DailyBackupDB2 Thu 13 Aug 2009 10:28:06 0 /var/lib/mysql-zrm/DailyBackupDB2/200908 Backup failed ----
AM HKT 13102806
DailyBackupDB2 Thu 13 Aug 2009 10:00:20 0 /var/lib/mysql-zrm/DailyBackupDB2/200908 Backup failed ----
AM HKT 13100020
DailyBackupDB2 Thu 13 Aug 2009 09:36:08 0 /var/lib/mysql-zrm/DailyBackupDB2/200908 Backup failed ----
AM HKT 13093608
DailyBackupDB2 Thu 13 Aug 2009 09:30:18 0 /var/lib/mysql-zrm/DailyBackupDB2/200908 Backup failed ----
AM HKT 13093018
DailyBackupDB2 Thu 13 Aug 2009 08:59:15 0 /var/lib/mysql-zrm/DailyBackupDB2/200908 Backup failed ----
AM HKT 13085915
DailyBackupDB2 Thu 13 Aug 2009 08:58:11 0 /var/lib/mysql-zrm/DailyBackupDB2/200908 Backup failed ----
AM HKT 13085811
DailyBackupDB2 Thu 13 Aug 2009 08:39:56 0 /var/lib/mysql-zrm/DailyBackupDB2/200908 Backup failed ----
AM HKT 13083956
DailyBackupDB2 Thu 13 Aug 2009 08:37:34 0 /var/lib/mysql-zrm/DailyBackupDB2/200908 Backup failed ----
AM HKT 13083734
DailyBackupDB2 Thu 13 Aug 2009 08:28:16 0 /var/lib/mysql-zrm/DailyBackupDB2/200908 Backup failed ----
AM HKT 13082816
DailyBackupDB2 Thu 13 Aug 2009 08:23:46 0 /var/lib/mysql-zrm/DailyBackupDB2/200908 Backup failed ----
AM HKT 13082346
DailyBackupDB2 Thu 13 Aug 2009 08:12:19 0 /var/lib/mysql-zrm/DailyBackupDB2/200908 Backup failed ----
AM HKT 13081219
DailyBackupDB2 Thu 13 Aug 2009 08:05:53 0 /var/lib/mysql-zrm/DailyBackupDB2/200908 Backup failed ----
AM HKT 13080553
DailyBackupDB2 Thu 13 Aug 2009 08:04:56 0 /var/lib/mysql-zrm/DailyBackupDB2/200908 Backup failed ----
AM HKT 13080456
DailyBackupDB2 Thu 13 Aug 2009 08:00:30 0 /var/lib/mysql-zrm/DailyBackupDB2/200908 Backup failed ----
AM HKT 13080030
[root@croracle02 ~]#
[root@croracle01 ~]# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 58
Server version: 5.1.36-community-log MySQL Community Server (GPL)
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| #mysql50#.ssh |
| moviesinnodb |
| moviesmyisam |
| mysql |
| replDB |
| test |
| test2 |
| zrmtest |
+--------------------+
9 rows in set (0.00 sec)
mysql>
mysql> drop database moviesmyisam;
Query OK, 1 row affected (0.02 sec)
mysql> drop database moviesinnodb;
Query OK, 1 row affected (0.00 sec)
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| #mysql50#.ssh |
| mysql |
| replDB |
| test |
| test2 |
| zrmtest |
+--------------------+
7 rows in set (0.00 sec)
mysql>
mysql-zrm --action restore --backup-set DailyBackupDB2 --source-directory /var/lib/mysql-zrm/DailyBackupDB2/20090817010003
[root@croracle02 ~]# mysql-zrm --action restore --backup-set DailyBackupDB2 --source-directory /var/lib/mysql-zrm/DailyBackupDB2/20090817010003
restore:INFO: ZRM for MySQL Community Edition - version 2.1
DailyBackupDB2:restore:INFO: Restored database from raw backup: moviesmyisam
DailyBackupDB2:restore:INFO: Restore done in 1 seconds.
MySQL server has been shutdown. Please restart after verification.
[root@croracle02 ~]#
[root@croracle01 ~]#
[root@croracle01 init.d]# ./mysql start
Starting MySQL.. [ OK ]
[root@croracle01 init.d]# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.1.36-community-log MySQL Community Server (GPL)
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| #mysql50#.ssh |
| moviesmyisam |
| mysql |
| replDB |
| test |
| test2 |
| zrmtest |
+--------------------+
8 rows in set (0.00 sec)
mysql>
good luck!
没有评论:
发表评论