반응형
Full dump 파일이 100MB 이상 되면 slave 에서 로드하다보면 제대로 되는지 확인이 안되서
시간은 급한데 억장이 무너진다면 아래의 방법을 써본다.
* Master: 10.10.0.200, Slave: 10.10.0.201
# mysql -uroot -prootpass
<Master> flush logs;
<Master> flush tables with read lock;
2. Rsync from master to slave(Slave)
# mysqladmin -uroot -prootpass shutdown
# rm -rf /user/services/mysql/data/*
# rsync -r -p -v root@10.10.0.200:/user/service/mysql/data /user/service/mysql/
* Check my.cnf
server-id=2 (or other number, not 1)
master-host=10.10.0.200
master-user=root
master-password=rootpass
# chown -R mysql.mysql /user/service/mysql/data
# mysqld_safe --user=mysql --log-bin-trust-function-creators=1 --skip-slave --relay-log=mysql-relay-bin &
# mysql -uroot -prootpass
<Slave> stop slave;
<Slave> reset slave;
3. Reset master & start slave thread
<Master> unlock tables;
<Master> reset master; -- purge all log-bins
<Master> show master status;
<Slave> start slave;
<Slave> show slave status;
* Slave_IO_State : Waiting for master to send event, Master_Host : master_ip, ... => Successful
- Barracuda -
반응형
'Technical > DBMS' 카테고리의 다른 글
CentOS 5.4, MySQL build를 위한 패키지들 (0) | 2010.10.01 |
---|---|
MySQL replication : Statement-Based vs. Row-Based replication (0) | 2010.08.01 |
MySQL 5.5.5m3 configure bug(Building MySQL 5.5.5m3) (0) | 2010.07.24 |
Building mongodb r1.4.4 (0) | 2010.07.22 |
MySQL innotop 설치 & 사용(OpenSUSE 11.2 or Fedora 14, MySQL 5.1.44~5.5.4m3) (0) | 2010.07.22 |