$mysql -u root -pSetalah itu lanjukan dengan mengecek status slave, jika salah satu Slave_IO_Running atau Slave_SQL_Running status tidak menunjukkan Yes maka mysql replikasi sedang tidak berjalan normal
mysql> show slave status \G;
*************************** 1. row ***************************
Slave_IO_State: Waiting for master to send event
Master_Host: 192.168.1.3
Master_User: slave_user
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: mysqld-bin.000497
Read_Master_Log_Pos: 7716250
Relay_Log_File: mysqld-relay-bin.000002
Relay_Log_Pos: 14925
Relay_Master_Log_File: mysqld-bin.000497
Slave_IO_Running: Yes
Slave_SQL_Running: No
Replicate_Do_DB:
Replicate_Ignore_DB:
Replicate_Do_Table:
Replicate_Ignore_Table:
Replicate_Wild_Do_Table:
Replicate_Wild_Ignore_Table:
Last_Errno: 0
Last_Error:
Skip_Counter: 0
Exec_Master_Log_Pos: 7716250
Relay_Log_Space: 14925
Until_Condition: None
Until_Log_File:
Until_Log_Pos: 0
Master_SSL_Allowed: No
Master_SSL_CA_File:
Master_SSL_CA_Path:
Master_SSL_Cert:
Master_SSL_Cipher:
Master_SSL_Key:
Seconds_Behind_Master: 0
1 row in set (0.00 sec)
Untuk memperbaikinya stop dahulu slave:
mysql> STOP SLAVE;Ubah SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1, ini untuk mencegah replikasi berhenti karena 1 query.
mysql> SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1;Start ulang slavenya:
mysql> START SLAVE;Cek status slave nya pastikan Slave_IO_Running atau Slave_SQL_Running statusnya YES.
mysql> show slave status \G;
*************************** 1. row ***************************
Slave_IO_State: Waiting for master to send event
Master_Host: 192.168.1.3
Master_User: slave_user
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: mysqld-bin.000497
Read_Master_Log_Pos: 7716250
Relay_Log_File: mysqld-relay-bin.000002
Relay_Log_Pos: 14925
Relay_Master_Log_File: mysqld-bin.000497
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
Replicate_Do_DB:
Replicate_Ignore_DB:
Replicate_Do_Table:
Replicate_Ignore_Table:
Replicate_Wild_Do_Table:
Replicate_Wild_Ignore_Table:
Last_Errno: 0
Last_Error:
Skip_Counter: 0
Exec_Master_Log_Pos: 7716250
Relay_Log_Space: 14925
Until_Condition: None
Until_Log_File:
Until_Log_Pos: 0
Master_SSL_Allowed: No
Master_SSL_CA_File:
Master_SSL_CA_Path:
Master_SSL_Cert:
Master_SSL_Cipher:
Master_SSL_Key:
Seconds_Behind_Master: 0
1 row in set (0.00 sec)
Jika tidak ada error, maka replikasi berjalan normal. Saya tidak menjamin bahwa tutorial ini berjalan baik untuk anda.
Tidak ada komentar:
Posting Komentar