PHP Forum

PHP Forum (http://www.selfphp.de/forum/index.php)
-   MySQLi/PDO/(MySQL) (http://www.selfphp.de/forum/forumdisplay.php?f=22)
-   -   Replikation will nicht funzen (http://www.selfphp.de/forum/showthread.php?t=20459)

niels_jende 04.11.2008 11:38:32

Replikation will nicht funzen
 
Hallo zusammen,

an und für sich, so dachte ich, sollte eine Replikation (Master <-> Slave) ja kein großes problem sein. Aber das war wohl ein gehöriger Irrtum. Was habe ich? ich habe also einen Server der als Master agieren und einen der als Slave agieren soll.

Den Slave habe ich mittels GRANT REPLICATION SLAVE on *.* TO username@IP IDENTIFIED BY 'PWD';

am Master angemeldet.

meine Slave my.cnf sieht so aus:

Zitat:


[mysqld]
#
# * Basic Settings
#
#user = mysql
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
port = 3306
basedir = /usr
datadir = /var/lib/mysql
tmpdir = /tmp
language = /usr/share/mysql/english
skip-external-locking
server-id = 1
master-host = IP des Master
master-user = replikator
master-password = PWD
master-port = 3306
report-host = IP des Slave

ist das da oben schon falsch?

und die my.cnf vom Master sieht so aus:

Zitat:

[mysqld]
#
# * Basic Settings
#
user = mysql
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
port = 3306
basedir = /usr
datadir = /var/lib/mysql
tmpdir = /tmp
language = /usr/share/mysql/english
skip-external-locking
#
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address = 127.0.0.1
#
# * Fine Tuning
#
key_buffer = 16M
max_allowed_packet = 16M
thread_stack = 128K
thread_cache_size = 8
#max_connections = 100
#table_cache = 64
#thread_concurrency = 10
#
# * Query Cache Configuration
#
query_cache_limit = 1M
query_cache_size = 16M
#
# * Logging and Replication
#
# Both location gets rotated by the cronjob.
# Be aware that this log type is a performance killer.
log = /var/log/mysql/mysql.log
#
# Error logging goes to syslog. This is a Debian improvement :)
#
# Here you can see queries with especially long duration
#log_slow_queries = /var/log/mysql/mysql-slow.log
#long_query_time = 2
#log-queries-not-using-indexes
#
# The following can be used as easy to replay backup logs or for replication.
server-id = 1
log_bin = binary

Also irgendwo muss da ja wohl der Fehler sein. Aber wo???

Die Ausgabe von show slave status\G
sieht so aus:

Zitat:


mysql> show slave status\G
*************************** 1. row ***************************
Slave_IO_State: Connecting to master
Master_Host: 10.2.2.22
Master_User: replikator
Master_Port: 3306
Connect_Retry: 60
Master_Log_File:
Read_Master_Log_Pos: 4
Relay_Log_File: test3-relay-bin.000005
Relay_Log_Pos: 98
Relay_Master_Log_File:
Slave_IO_Running: No
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: 0
Relay_Log_Space: 98
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
Wer kann mir denn wohl helfen?

Danke und Gruß

niels_jende 04.11.2008 12:02:15

AW: Replikation will nicht funzen
 
Ach ja,

und das sagt ein show slave staus\G;

Zitat:


show slave status\G;
*************************** 1. row ***************************
Slave_IO_State: Connecting to master
Master_Host: 10.2.2.22
Master_User: replikator
Master_Port: 3306
Connect_Retry: 60
Master_Log_File:
Read_Master_Log_Pos: 4
Relay_Log_File: test3-relay-bin.000005
Relay_Log_Pos: 98
Relay_Master_Log_File:
Slave_IO_Running: No
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: 0
Relay_Log_Space: 98
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

und das ist der adäquate output auf em master:

Zitat:


show master status;
+---------------+----------+-----------------------+-----------------------+
| File | Position | Binlog_Do_DB | Binlog_Ignore_DB |
+---------------+----------+-----------------------+-----------------------+
| binary.000056 | 98 | include_database_name | include_database_name |
+---------------+----------+-----------------------+-----------------------+
1 row in set (0.00 sec)

Ich vermute mal, dass die beiden Binlog einträge in der my.cnf auskommentiert werden können. Das habe ich auch mal gemacht, hat aber auch keine Besserung gebracht. Sprich bei SLAVE_IO_RUNNING steht immer noch NO und bei Seconds behind master sollte doch 0 also als Zahl stehen und nicht NULL als Wort.

So, jetzt hoffe ich grad ganz arg auf schlaue Hilfe aus Euren Reihen.


Alle Zeitangaben in WEZ +2. Es ist jetzt 14:53:36 Uhr.

Powered by vBulletin® Version 3.8.3 (Deutsch)
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.