backup from a slave

backup from a slave

am 04.05.2009 22:28:49 von urkapd

I have a master-slave replication that works well (thank you MySQL's
team) :D

each night I make a backup from my slave; this is my crontab line:

mysqldump --opt -Q -u root --master-data -pxyz mydb >/var/
mydb_backup.sql

even that works well

I'd like to use that backup to setup a new slave (from the same (and
unique) master); the problem is I don't know how set-up this new
slave, since I don't know the right master binary-log num and
position; in the backup I have the "slave's" binary-log/pos and not
the master ones :(

any suggestion?

thank you in advance

regards

MAS!




--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org

Re: backup from a slave

am 05.05.2009 01:10:42 von Joshua Miller

MAS! wrote:
> I'd like to use that backup to setup a new slave (from the same (and
> unique) master); the problem is I don't know how set-up this new slave,
> since I don't know the right master binary-log num and position; in the
> backup I have the "slave's" binary-log/pos and not the master ones :(

One way to do this would be to issue a 'stop slave;' on the slave you
are taking a backup from just before the backup starts. Then issue a
'show slave status\G' to get the master log file and position. You can
use this to setup the new slave properly.

Remember to issue a 'start slave;' after taking the backup, but also
after you obtain the master log file and position.

HTH,
--
Josh Miller, RHCE/VCP
Seattle, WA
Linux Solutions Provider
Website: http://itsecureadmin.com/

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org

Re: backup from a slave

am 05.05.2009 10:01:03 von urkapd

> One way to do this would be to issue a 'stop slave;' on the slave
> you are taking a backup from just before the backup starts. Then
> issue a 'show slave status\G' to get the master log file and
> position. You can use this to setup the new slave properly.

ok, thanks, I was thinking it'd be a better solution.

btw, I have to get the Master_Log_File and Read_Master_Log_Pos or
Relay_Master_Log_File and Exec_Master_Log_Pos to start the new slave
correctly !?

may be my slave is not updated in 'realtime'

thank you in advance

MAS!



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org

Re: backup from a slave

am 05.05.2009 17:53:19 von urkapd

> One way to do this would be to issue a 'stop slave;' on the slave
> you are taking a backup from just before the backup starts. Then
> issue a 'show slave status\G' to get the master log file and
> position. You can use this to setup the new slave properly.
>

ok, thanks, I was thinking it'd be a better solution.

btw, I have to get the Master_Log_File and Read_Master_Log_Pos or
Relay_Master_Log_File and Exec_Master_Log_Pos to start the new slave
correctly !?

(my slave is not always updated in 'realtime')

thank you in advance

MAS!

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org

Re: backup from a slave

am 05.05.2009 17:59:18 von urkapd

> One way to do this would be to issue a 'stop slave;' on the slave
> you are taking a backup from just before the backup starts. Then
> issue a 'show slave status\G' to get the master log file and
> position. You can use this to setup the new slave properly.
>

ok, thanks, I was thinking it'd be a better solution.

btw, I have to get the Master_Log_File and Read_Master_Log_Pos or
Relay_Master_Log_File and Exec_Master_Log_Pos to start the new slave
correctly !?

may be my slave is not updated in 'realtime'

thank you in advance

MAS!

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org

Re: backup from a slave

am 05.05.2009 18:28:44 von Joshua Miller

MAS! wrote:
> btw, I have to get the Master_Log_File and Read_Master_Log_Pos or
> Relay_Master_Log_File and Exec_Master_Log_Pos to start the new slave
> correctly !?

If the Master_Log_File and Exec_Master_Log_Pos are not equivalent,
you'll want to note the Exec_Master_Log_Pos value as that is the value
which determines where in the binary logs you're slave is currently at.


--
Josh Miller, RHCE/VCP
Seattle, WA
Linux Solutions Provider
Website: http://itsecureadmin.com/

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org

Re: backup from a slave

am 05.05.2009 18:36:44 von Lawrence Sorrillo

Are the values of these variables all accessible via the command: "show
variables"?


Josh Miller wrote:
> MAS! wrote:
>> btw, I have to get the Master_Log_File and Read_Master_Log_Pos or
>> Relay_Master_Log_File and Exec_Master_Log_Pos to start the new slave
>> correctly !?
>
> If the Master_Log_File and Exec_Master_Log_Pos are not equivalent,
> you'll want to note the Exec_Master_Log_Pos value as that is the value
> which determines where in the binary logs you're slave is currently at.
>
>



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org

Re: backup from a slave

am 05.05.2009 18:50:01 von Joshua Miller

Lawrence Sorrillo wrote:
> Are the values of these variables all accessible via the command: "show
> variables"?
>
>> If the Master_Log_File and Exec_Master_Log_Pos are not equivalent,
>> you'll want to note the Exec_Master_Log_Pos value as that is the value
>> which determines where in the binary logs you're slave is currently at.

These values are accessible via 'show slave status\G';


--
Josh Miller, RHCE/VCP
Seattle, WA
Linux Solutions Provider
Website: http://itsecureadmin.com/

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org