After we realize that our backups (dump) where taking too long, and an incident where the VPS provider shutdown our database vps for 2 hours, we decided to try replication (not going to remove backup, just do the backup in the replication server).
I followed a guide on replication for mysql 8, but did not realize that such guide was made for clean installation without databases already running. Then I tried to import our morning backups wishing that magically the logs would know where to start to replicate, but I was wrong.
Anyone can give me a light in how I should do it? We have some 30 databases that must be 50GB total. I really don't want to stop both servers to take a dump and them import in the other server...
This is my slave status:
*************************** 1. row ***************************
Slave_IO_State: Waiting for master to send event
Master_Host: SERVER_IP
Master_User: replicador
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: mysql-bin.000002
Read_Master_Log_Pos: 24876902
Relay_Log_File: pergamum-relay-bin.000004
Relay_Log_Pos: 714
Relay_Master_Log_File: mysql-bin.000001
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: 1032
Last_Error: Could not execute Update_rows event on table gc57125800.ate_rondas_virtuais_pontos_registro; Can't find record in 'ate_rondas_virtuais_pontos_registro', Error_code: 1032; handler error HA_ERR_KEY_NOT_FOUND; the event's master log mysql-bin.000001, end_log_pos 905
Skip_Counter: 0
Exec_Master_Log_Pos: 546
Relay_Log_Space: 293925133
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: NULL
Master_SSL_Verify_Server_Cert: No
Last_IO_Errno: 0
Last_IO_Error:
Last_SQL_Errno: 1032
Last_SQL_Error: Could not execute Update_rows event on table gc57125800.ate_rondas_virtuais_pontos_registro; Can't find record in 'ate_rondas_virtuais_pontos_registro', Error_code: 1032; handler error HA_ERR_KEY_NOT_FOUND; the event's master log mysql-bin.000001, end_log_pos 905
Replicate_Ignore_Server_Ids:
Master_Server_Id: 1
Master_UUID: bef45e1b-99d6-11ea-a355-3e2547e4f083
Master_Info_File: mysql.slave_master_info
SQL_Delay: 0
SQL_Remaining_Delay: NULL
Slave_SQL_Running_State:
Master_Retry_Count: 86400
Master_Bind:
Last_IO_Error_Timestamp:
Last_SQL_Error_Timestamp: 200810 19:53:10
Master_SSL_Crl:
Master_SSL_Crlpath:
Retrieved_Gtid_Set:
Executed_Gtid_Set:
Auto_Position: 0
Replicate_Rewrite_DB:
Channel_Name:
Master_TLS_Version:
Master_public_key_path:
Get_master_public_key: 0
Network_Namespace:
1 row in set (0.00 sec)
UPDATE: I was doing it wrong. I used the slave log file reference and failed to get the reference at the backup time. If anyone is reading this and scratching his head thinking about your first replication, this guide was very useful to me.
Basically I needed to take a full dump with the log position, so I would be able to tell my slave where to start to replicate.