Revision [4156]

Last edited on 2011-09-29 23:26:00 by KenFong
Additions:
Or perhaps
stop slave; set global slave_skip_errors=1062; start slave;


Revision [4155]

Edited on 2011-09-29 23:03:22 by KenFong
Additions:
Do this in a loop:
while [ `mysql -e "show slave status\G" | grep Slave_SQL_Running | awk '{print $2}'` == "No" ]
do
mysql -e "stop slave; SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1; start slave;"
sleep 2
done


Revision [4107]

Edited on 2011-08-21 23:42:51 by KenFong
Additions:
MYSQL> stop slave; SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1; START SLAVE;
Deletions:
mysql> SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1;
mysql> START SLAVE;


Revision [4103]

Edited on 2011-08-17 01:40:09 by KenFong
Additions:
===Slave status===
Show slave status filtering lines I don't want:
mysql> pager grep Slave
PAGER set to 'grep Slave'
Slave_IO_State: Waiting for master to send event
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
1 row in set (0.00 sec)


Revision [3839]

Edited on 2010-09-15 08:34:05 by KenFong
Additions:
SLAVE_LOG=""
SHARED_PWD="xxxx"
Deletions:
SLAVE_LOG="" SHARED_PWD="j4s0n1"


Revision [3838]

Edited on 2010-09-15 08:32:58 by KenFong
Deletions:
# maintained by kfong@datapipe.com


Revision [3672]

Edited on 2010-03-16 00:55:38 by KenFong
Additions:
===Seeing difference with compression===
tcpdump -i eth0 -s 0 -l -w - dst port 3306


Revision [3671]

Edited on 2010-03-16 00:53:51 by KenFong
Additions:
slave_compressed_protocol=1


Revision [3659]

Edited on 2010-03-08 21:12:25 by WikiAdmin
Additions:
replicate-wild-do-table=database1.%
Deletions:
replicate-do-db=database2
replicate-do-db=database3


Revision [3445]

Edited on 2009-07-23 22:17:34 by WikiAdmin
Additions:
# selectively replicate
# binlog-do-db=db_name
7.Restore snapsnot backup taken in step 1 to slave database. One can also use mysqldump-restore to achieve the same. dump with the --with-master-data option. then the master log position will be recorded in first 30 lines or so in the dump file.
Deletions:
7.Restore snapsnot backup taken in step 1 to slave database


Revision [2234]

Edited on 2009-02-26 02:15:23 by WikiAdmin
Additions:
# rename relay-log.info which contains info about the problematic relay log


Revision [2208]

Edited on 2009-02-16 03:04:23 by WikiAdmin
Additions:
===Fix broken relay logs===
You may instruct mysql to purge current relay logs and restart replication at a certain point. See the following example:
mysql> show slave status\G
*************************** 1. row ***************************
Slave_IO_State:
...
Master_Log_File: db01-bin.000009
Read_Master_Log_Pos: 127484667
Relay_Log_File: ws01-relay.000032
Relay_Log_Pos: 115781533
Relay_Master_Log_File: db01-bin.000009 <-- set master_log_file to this
Slave_IO_Running: No
Slave_SQL_Running: No
...
Exec_Master_Log_Pos: 115781384 <-- set master_log_pos to this
...
1 row in set (0.92 sec)
mysql> stop slave
mysql> change master to master_log_file='db01-bin.000009', master_log_pos=115781384;
mysql> start slave


Revision [2085]

Edited on 2008-11-07 02:28:18 by WikiAdmin
Additions:
log-bin=hostname-bin
relay-log=hostname-relay
Deletions:
log-bin=mysql-bin


Revision [2066]

Edited on 2008-11-03 00:13:58 by WikiAdmin
Additions:
==Missing relay logs==
What if your relay logs are missing? As long as the binlogs are still here, one can do the followings and mysql will fetch fresh copies of relay logs automatically:
service mysql stop
rm -f $MYSQL_DATADIR/relay-log.info
rm -f $MYSQL_RELAYLOG/hostname-relay-bin.*
service mysql start


Revision [1917]

Edited on 2008-09-01 22:04:44 by WikiAdmin
Additions:
log_slave_updates=1
read_only=1


Revision [1781]

Edited on 2008-06-30 08:48:38 by WikiAdmin
Additions:
Some poorly designed software do uses custom functions for primary key and they may cause duplicate entry error when that function generates repeated string as the key. The following tells MySQL to ignore duplicate entry error and move on.
%%(text;my.cnf)
slave-skip-errors = 1062


Revision [1746]

Edited on 2008-06-02 21:34:55 by WikiAdmin
Additions:
MYSQL>grant replication [slave] on *.* to repl@'%' identified by 'blah';
Deletions:
MYSQL>grant replication on *.* to repl@'%' identified by 'blah';


Revision [1621]

Edited on 2008-04-08 00:56:02 by WikiAdmin
Additions:
==Fix broken replication==
If replication is stalled because of a query does not run on slave and you are sure that query is of no significance, do these:
mysql> SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1;
mysql> START SLAVE;


Revision [1577]

Edited on 2008-03-31 01:17:58 by WikiAdmin
Additions:
Fix broken replication: http://homepage.mac.com/kelleherk/iblog/C711669388/E226281480/index.html
# master logs are applied to slave and can be purged
mysql -p$SHARED_PWD -h$MASTER_HOST -se "purge master logs to '$MASTER_LOG'"
Deletions:
# master logs are applied to slave and can be purged
mysql -p$SHARED_PWD -h$MASTER_HOST -se "purge master logs to '$MASTER_LOG'"


Revision [1490]

The oldest known version of this page was created on 2008-03-13 02:17:36 by WikiAdmin
Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by WikkaWiki