PDA

View Full Version : Last binlog file & position from backup



robinbowes
January 15th, 2010, 07:08 AM
[I already sent this to the mysql-zrm-users mailing list, but that seems dead (archives stop in 2008) so I'm posting here too]

Hi,

I'm looking at replacing an ibbackup solution with mysql-zrm and have a
question about bin logs.

With our current backup, we get a message like this in the log:

ibbackup: Last MySQL binlog file position 0 784922852, file name
/var/lib/mysql/s8-bin.002178

This tells us the log file and position of the backup. So, when we want
to restore to a slave server, we simply restore the backup and reset the
slave to the current log position like this:

CHANGE MASTER TO MASTER_HOST='s8.example.com', MASTER_USER =
'replicator', MASTER_PASSWORD = 'secret',
master_log_file='s8-bin.002178', master_log_pos=784922852;

I've set up a mysql-zrm backup that uses an lvm snapshot.

How can I get the log file and log position information from the
mysql-zrm backup?

Looking at this another way: if I restore a mysql-zrm backup from a
replication master onto a slave, how can I establish the master log file
and master log position from which I need to restart replication?

R.

robinbowes
January 15th, 2010, 07:09 AM
Following up...

I've had a look in the index file of a mysql-zrm snapshot backup and see
this line:

next-binlog=mysql-bin.000052

Would I be correct in assuming that means that, given my previous
example, that replication should start from master log file
mysql-bin.000052 at position 0? ie:

CHANGE MASTER TO MASTER_HOST='s8.example.com', MASTER_USER =
'replicator', MASTER_PASSWORD = 'secret',
master_log_file='mysql-bin.000052', master_log_pos=0;

Is there some way to show that file name without looking at the "index"
file directly?

R.

gsat
January 15th, 2010, 10:43 AM
correct, this info is available in index file, but reporter is not picking up this value as it is not a valid field for custom reports. This will be fixed in next release (2.2). Preview of 2.2 custom report looks as follows:

/usr/bin/mysql-zrm-reporter --fields backup-set,backup-date,backup-level,next-binlog
reporter:WARNING: Backup root directory not specified, Assigning default value as /var/lib/mysql-zrm
backup_set backup_date backup_level next_binlog
-------------------------------------------------------------------------------------
test12 Fri 15 Jan 2010 07:27:22 1 mysql-bin.000003
AM PST
test12 Fri 15 Jan 2010 07:22:28 0 mysql-bin.000002
AM PST
test Thu 06 Nov 2008 01:59:40 0 ----
PM PST
test Thu 06 Nov 2008 01:56:55 0 ----
PM PST
test Thu 06 Nov 2008 01:55:17 0 ----
PM PST
test-encrypt Thu 06 Nov 2008 01:53:50 0 ----
PM PST

robinbowes
January 15th, 2010, 10:49 AM
Great, thanks.

Will that be included in one of the standard reports?

R.