wintektiv
Goto Top

Binar Logs nicht mehr aktuell auf dem Slave-Server (MySQL-Replikation)

Hallo zusammen,


ich hab das Problem auf meinen Slave-Server, dass der aktuell bei der mysql.00005.bin Datei ist und der Master-Server benutzt akutell die mysql.00012.bin Datei.

Jetzt repliziert mein Server nicht mehr mit dem Master.

Wie krieg ich das hin, dass mein Server mit der neusten mysql000012.bin Datei sich synchronisiert.

Gibt es da eine Config-Datei? Muss ich dabei etwas beachten? was mache mit den alten bin Dateien eigentlich?

Die mysqll.00005.bin liegt aktuell auf dem Master und die mysql.00012 auf dem Slave.


Wenn mehr Information benötigt werden, einfach anfragen.

Danke für eure Aufmerksamkeit.


VG

Wintektiv

Content-Key: 344437

Url: https://administrator.de/contentid/344437

Ausgedruckt am: 19.03.2024 um 06:03 Uhr

Mitglied: kaiand1
kaiand1 25.07.2017 um 17:55:44 Uhr
Goto Top
Sehr spärliche Angaben.
Aber ich nehme an das dies auf deinen anderen Tread Aufbaut
MySQL Slave I.O Error 1045

Und du da nun was Verändert hast..

Aber für die Grundsache was stand in den Logs als du das Problem erkannt hast?
Was haben die Datenbankenlogs gemeldet das die nicht mehr Abgleichen wollen und was wurde Verändert ?
Mitglied: Wintektiv
Wintektiv 25.07.2017 um 18:50:45 Uhr
Goto Top
Moment, die kriegst du jetzt gesendet:
Mitglied: kaiand1
kaiand1 25.07.2017 um 18:55:44 Uhr
Goto Top
Zitat von @Wintektiv:

Moment, die kriegst du jetzt gesendet:

Die brauchst du mir nicht Senden sondern kannst des hier Angeben für Alle Leute.
Mitglied: Wintektiv
Wintektiv 25.07.2017 um 19:06:10 Uhr
Goto Top
mysql> SHOW PROCESSLIST \G;
* 1. row *
Id: 8
User: root
Host: localhost:52165
db: NULL
Command: Query
Time: 0
State: starting
Info: SHOW PROCESSLIST
* 2. row *
Id: 91
User: system user
Host:
db: NULL
Command: Connect
Time: 5094
State: Waiting for master to send event
Info: NULL
* 3. row *
Id: 92
User: system user
Host:
db: NULL
Command: Connect
Time: 481
State: Slave has read all relay log; waiting for more updates
Info: NULL
3 rows in set (0.00 sec)

ERROR:
No query specified
Mitglied: Wintektiv
Wintektiv 25.07.2017 um 19:06:48 Uhr
Goto Top
Meinte ich damit. face-smile
Mitglied: Wintektiv
Wintektiv 25.07.2017 um 19:12:27 Uhr
Goto Top
Es kommen gleich noch mehr Informationen...
Mitglied: Wintektiv
Wintektiv 25.07.2017 um 19:16:13 Uhr
Goto Top
mysql> SHOW SLAVE STATUS \G;
* 1. row *
Slave_IO_State: Waiting for master to send event
Master_Host: 32498234master.net
Master_User: slave_sync
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: mysql-bin.000005
Read_Master_Log_Pos: 15252340
Relay_Log_File: relay.000006
Relay_Log_Pos: 1941
Relay_Master_Log_File: mysql-bin.000005
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
Replicate_Do_DB: db01
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: 15252340
Relay_Log_Space: 2304
Until_Condition: None
Until_Log_File:
Until_Log_Pos: 0
Master_SSL_Allowed: Yes
Master_SSL_CA_File: D:/mysql/cert/ca-cert.pem
Master_SSL_CA_Path:
Master_SSL_Cert: D:/mysql/cert/client-cert.pem
Master_SSL_Cipher:
Master_SSL_Key: D:/mysql/cert/client-key.pem
Seconds_Behind_Master: 0
Master_SSL_Verify_Server_Cert: No
Last_IO_Errno: 0
Last_IO_Error:
Last_SQL_Errno: 0
Last_SQL_Error:
Replicate_Ignore_Server_Ids:
Master_Server_Id: 1
Master_UUID: f6f77101-a9d8-11e6-93b2-0cc47ac69bea
Master_Info_File: C:\ProgramData\MySQL\MySQL Server 5.7\Data\master
.info
SQL_Delay: 0
SQL_Remaining_Delay: NULL
Slave_SQL_Running_State: Slave has read all relay log; waiting for more up
dates
Master_Retry_Count: 86400
Master_Bind:
Last_IO_Error_Timestamp:
Last_SQL_Error_Timestamp:
Master_SSL_Crl:
Master_SSL_Crlpath:
Retrieved_Gtid_Set:
Executed_Gtid_Set:
Auto_Position: 0
Replicate_Rewrite_DB:
Channel_Name:
Master_TLS_Version:
1 row in set (0.00 sec)

ERROR:
No query specified
Mitglied: Wintektiv
Wintektiv 25.07.2017 um 19:29:18 Uhr
Goto Top
LOG-Datei:

2017-07-25T13:55:36.128920Z 26 [ERROR] Slave I/O for channel '': error connecting to master 'slave@master.net:3306' - retry-time: 60  retries: 10, Error_code: 1045  
2017-07-25T13:56:36.274079Z 26 [ERROR] Slave I/O for channel '': error connecting to master 'slave@master.net:3306' - retry-time: 60  retries: 11, Error_code: 1045  
2017-07-25T13:57:36.419311Z 26 [ERROR] Slave I/O for channel '': error connecting to master 'slave@master.net:3306' - retry-time: 60  retries: 12, Error_code: 1045  
2017-07-25T13:58:36.564484Z 26 [ERROR] Slave I/O for channel '': error connecting to master 'slave@master.net:3306' - retry-time: 60  retries: 13, Error_code: 1045  
2017-07-25T13:59:36.710286Z 26 [ERROR] Slave I/O for channel '': error connecting to master 'slave@master.net:3306' - retry-time: 60  retries: 14, Error_code: 1045  
2017-07-25T14:00:36.855891Z 26 [ERROR] Slave I/O for channel '': error connecting to master 'slave@master.net:3306' - retry-time: 60  retries: 15, Error_code: 1045  
2017-07-25T14:01:37.003710Z 26 [ERROR] Slave I/O for channel '': error connecting to master 'slave@master.net:3306' - retry-time: 60  retries: 16, Error_code: 1045  
2017-07-25T14:02:37.151074Z 26 [ERROR] Slave I/O for channel '': error connecting to master 'slave@master.net:3306' - retry-time: 60  retries: 17, Error_code: 1045  
2017-07-25T14:03:37.298221Z 26 [ERROR] Slave I/O for channel '': error connecting to master 'slave@master.net:3306' - retry-time: 60  retries: 18, Error_code: 1045  
2017-07-25T14:04:37.448022Z 26 [Note] Slave I/O thread for channel '': connected to master 'slave@master.net:3306',replication started in log 'mysql-bin.000005' at position 8127820  
2017-07-25T14:06:03.267128Z 27 [Note] Slave SQL thread for channel '' exiting, replication stopped in log 'mysql-bin.000005' at position 9080452  
2017-07-25T14:06:03.329635Z 26 [Note] Slave I/O thread killed while reading event for channel ''  
2017-07-25T14:06:03.329635Z 26 [Note] Slave I/O thread exiting for channel '', read up to log 'mysql-bin.000005', position 15250145  
2017-07-25T14:06:08.111245Z 35 [Warning] Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.  
2017-07-25T14:06:08.126868Z 36 [Warning] Slave SQL for channel '': If a crash happens this configuration does not guarantee that the relay log info will be consistent, Error_code: 0  
2017-07-25T14:06:08.126868Z 36 [Note] Slave SQL thread for channel '' initialized, starting replication in log 'mysql-bin.000005' at position 9080452, relay log 'D:\mysql\relay.000003' position: 952952  
2017-07-25T14:06:08.251878Z 35 [Note] Slave I/O thread for channel '': connected to master 'slave@master.net:3306',replication started in log 'mysql-bin.000005' at position 15250145  
2017-07-25T14:32:24.146006Z 36 [Note] Error reading relay log event for channel '': slave SQL thread was killed  
2017-07-25T14:32:24.192884Z 35 [Note] Slave I/O thread killed while reading event for channel ''  
2017-07-25T14:32:24.192884Z 35 [Note] Slave I/O thread exiting for channel '', read up to log 'mysql-bin.000005', position 15250719  
2017-07-25T14:32:43.071421Z 57 [Warning] Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.  
2017-07-25T14:32:43.087016Z 58 [Warning] Slave SQL for channel '': If a crash happens this configuration does not guarantee that the relay log info will be consistent, Error_code: 0  
2017-07-25T14:32:43.087016Z 58 [Note] Slave SQL thread for channel '' initialized, starting replication in log 'mysql-bin.000005' at position 15250719, relay log 'D:\mysql\relay.000004' position: 894  
2017-07-25T14:32:43.212056Z 57 [Note] Slave I/O thread for channel '': connected to master 'slave@master.net:3306',replication started in log 'mysql-bin.000005' at position 15250719  
2017-07-25T14:37:26.890592Z 58 [Note] Error reading relay log event for channel '': slave SQL thread was killed  
2017-07-25T14:37:26.921844Z 57 [Note] Slave I/O thread killed while reading event for channel ''  
2017-07-25T14:37:26.921844Z 57 [Note] Slave I/O thread exiting for channel '', read up to log 'mysql-bin.000005', position 15250719  
2017-07-25T15:06:40.108943Z 91 [Warning] Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.  
2017-07-25T15:06:40.140195Z 92 [Warning] Slave SQL for channel '': If a crash happens this configuration does not guarantee that the relay log info will be consistent, Error_code: 0  
2017-07-25T15:06:40.140195Z 92 [Note] Slave SQL thread for channel '' initialized, starting replication in log 'mysql-bin.000005' at position 15250719, relay log 'D:\mysql\relay.000005' position: 320  
2017-07-25T15:06:40.249547Z 91 [Note] Slave I/O thread for channel '': connected to master 'slave@master.net:3306',replication started in log 'mysql-bin.000005' at position 15250719  
Mitglied: Wintektiv
Wintektiv 25.07.2017 um 19:40:50 Uhr
Goto Top
mysql> SHOW MASTER STATUS;
+------------------+----------+--------------+------------------+---------------
+
| File | Position | Binlog_Do_DB | Binlog_Ignore_DB | Executed_Gtid_
Set |
+------------------+----------+--------------+------------------+---------------
+
| mysql-bin.000012 | 154 | | |
|
+------------------+----------+--------------+------------------+---------------
+
1 row in set (0.00 sec)

mysql>


Das warst damit ....

Ich hoffe die Informationen können helfen,

ich vermute, es liegt an der Binar-Log-Datei.

Vor her hatte ich das Problem, dass der Slave sich nicht verbinden wollte mit dem Master, dies habe ich gelöst. Es lag daran, dass das Passwort in der master.info Datei anders gewesen ist, als dies in PHP-Admin und mySQL-Workbench.
Mitglied: kaiand1
kaiand1 26.07.2017 um 02:02:14 Uhr
Goto Top
Zitat von @Wintektiv:

2017-07-25T14:03:37.298221Z 26 [ERROR] Slave I/O for channel '': error connecting to master 'slave@master.net:3306' - retry-time: 60  retries: 18, Error_code: 1045   
10.
2017-07-25T14:04:37.448022Z 26 [Note] Slave I/O thread for channel '': connected to master 'slave@master.net:3306',replication started in log 'mysql-bin.000005' at position 8127820   
11.
2017-07-25T14:06:03.267128Z 27 [Note] Slave SQL thread for channel '' exiting, replication stopped in log 'mysql-bin.000005' at position 9080452   
12.
2017-07-25T14:06:03.329635Z 26 [Note] Slave I/O thread killed while reading event for channel ''   

Da sind doch schon Angaben zum Problem.
Was war der Grund für den Verbindungsabbruch sowie wer hat da den Prozess gekillt als der wieder eine Verbindung hatte und Daten Empfangen hat ?
Mitglied: Wintektiv
Wintektiv 26.07.2017 aktualisiert um 09:14:55 Uhr
Goto Top
Ein einfacher neustart. Ich hab den Server letzter Zeit wieder Sicherheitsupdates installieren lassen.

Ansonsten habe ich Slave Thread nach den Anleitungen, die ich gelesen habe, mal gestoppt und wieder gestartet ...


Was kann ich machen, wenn ich weiß, ich muss den Server neustarten?
Wie kann ich sauber den Slave neustarten oder das der nachher wieder Probleme macht oder sich nicht synchronisiert.

Ansonsten denke ich immer noch das es hier was mit den Log auf sich hat.

Nun, der Slave ist ja noch bei einer älteren log-Datei hängen geblieben und der Master ist schon weiter...

Wenn man den Serve neustarten, wird automatisch eine neue Binär-Log Datei erstellt..immer wieder...also der counten das immer.

Ich vergaß zu sagen, ich benutze hierbei ein Windows Sever 2012 R2 und arbeite hier PHP-Admin und mit MySQL-Workbench.

Hmm...

In den Status hier, die ich gepostet habe, sieh ich, wie die Server zwei unterschiedliche Binär-Log Dateien benutzen und nicht auf der selben "Position" arbeiten...Kann es daran liegen, dass der Server aktuell keinen neuen Events bekommen? Keinen neuen Daten-Änderungen?

Oder der Cache vom der binlog zu klein ist für die masse an änderungen...
Mitglied: Wintektiv
Wintektiv 26.07.2017 aktualisiert um 12:15:32 Uhr
Goto Top
hat sich erledigt...


es lag wo anders ran....die Datenbank ist inkonsistent vom slave server

mehr dazu später