マスター:
スレーブ:
現在の環境
sen@ubuntu:~$ uname -a Linux ubuntu 4.2.0-16-generic #19-Ubuntu SMP Thu Oct 8 15:35:06 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux sen@ubuntu:~$ mysql -V mysql バージョン 14.14 Distrib 5.5.32、Linux (x86_64) 用、readline 5.1 を使用
現在のステータス
マスター、3306:
my.cnf : https://www.dropbox.com/s/nmelrjhrp6wn2oj/my_3306.cnf?dl=0
show processlist: マスターはすべての binlog をスレーブに送信しました。バイナリログが更新されるのを待っています
sen@ubuntu:/data/3306$ sudo /application/mysql/bin/mysqlbinlog mysql-bin.000007
[sudo] password for sen:
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/;
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
# at 4
# #161106 10:39:40 server id 1 end_log_pos 107 Start: binlog v 4, server
# v 5.5.32-log created 161106 10:39:40 at startup
# # Warning: this binlog is either in use or was not closed properly.
# ROLLBACK/*!*/;
# BINLOG '
# 7JceWA8BAAAAZwAAAGsAAAABAAQANS41LjMyLWxvZwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
# AAAAAAAAAAAAAAAAAADslx5YEzgNAAgAEgAEBAQEEgAAVAAEGggAAAAICAgCAA==
# '/*!*/;
# DELIMITER ;
# # End of log file
# ROLLBACK /* added by mysqlbinlog */;
# /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
# /*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/;
#
スレーブ、3307:
my.cnf : https://www.dropbox.com/s/5t6mruzuo3wo1l7/my_3307.cnf?dl=0
show processlist: マスターがイベントを送信するのを待っています
mysql> show slave status \G;
*************************** 1. row ***************************
Slave_IO_State: Waiting for master to send event
Master_Host: 192.168.80.2
Master_User: rep
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: mysql-bin.000007
Read_Master_Log_Pos: 107
Relay_Log_File: relay-bin.000011
Relay_Log_Pos: 253
Relay_Master_Log_File: mysql-bin.000003
Slave_IO_Running: Yes
Slave_SQL_Running: No
Replicate_Do_DB:
Replicate_Ignore_DB: mysql
Replicate_Do_Table:
Replicate_Ignore_Table:
Replicate_Wild_Do_Table:
Replicate_Wild_Ignore_Table:
Last_Errno: 1049
Last_Error: Error 'Unknown database 'sen'' on query. Default
database: 'sen'. Query: 'create table t(id int(11), primary key(id))'
Skip_Counter: 0
Exec_Master_Log_Pos: 107
Relay_Log_Space: 2873
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: 1049
Last_SQL_Error: Error 'Unknown database 'sen'' on query. Default
database: 'sen'. Query: 'create table t(id int(11), primary key(id))'
Replicate_Ignore_Server_Ids:
Master_Server_Id: 1
1 row in set (0.00 sec)
ERROR:
No query specified
リレー ビン ログ:
sen@ubuntu:/data/3307$ sudo /application/mysql/bin/mysqlbinlog relay-bin.000020
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/;
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
# at 4
# #161106 17:00:43 server id 2 end_log_pos 107 Start: binlog v 4, server
# v 5.5.32 created 161106 17:00:43
# BINLOG '
# O/EeWA8CAAAAZwAAAGsAAAAAAAQANS41LjMyAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
# AAAAAAAAAAAAAAAAAAAAAAAAEzgNAAgAEgAEBAQEEgAAVAAEGggAAAAICAgCAA==
# '/*!*/;
# # at 107
# #700101 8:00:00 server id 1 end_log_pos 0 Rotate to mysql-bin.000007
# pos: 107
# # at 150
# #161106 10:39:40 server id 1 end_log_pos 0 Start: binlog v 4, server
# v 5.5.32-log created 161106 10:39:40
# BINLOG '
# 7JceWA8BAAAAZwAAAAAAAAAAAAQANS41LjMyLWxvZwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
# AAAAAAAAAAAAAAAAAAAAAAAAEzgNAAgAEgAEBAQEEgAAVAAEGggAAAAICAgCAA==
# '/*!*/;
# DELIMITER ;
# # End of log file
# ROLLBACK /* added by mysqlbinlog */;
# /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
# /*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/;
#
エラーログ:
$ less -R mysql_3307.err
161105 19:39:04 InnoDB: Waiting for the background threads to start
161105 19:39:05 InnoDB: 5.5.32 started; log sequence number 1601853
161105 19:39:05 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3307
161105 19:39:05 [Note] - '0.0.0.0' resolves to '0.0.0.0';
161105 19:39:05 [Note] Server socket created on IP: '0.0.0.0'.
161105 19:39:05 [Warning] 'user' entry 'root@ubuntu' ignored in --skip-name-resolve mode.
161105 19:39:05 [Warning] 'user' entry '@ubuntu' ignored in --skip-name-resolve mode.
161105 19:39:05 [Warning] 'proxies_priv' entry '@ root@ubuntu' ignored in --skip-name-resolve mode.
161105 19:39:05 [Note] Slave SQL thread initialized, starting replication in log 'mysql-bin.000003' at position 107, relay log '/data/3307/relay-bin.000011' position: 253
161105 19:39:05 [ERROR] Slave I/O: error connecting to master 'rep@192.168.80.2:3306' - retry-time: 60 retries: 86400, Error_code: 2003
161105 19:39:05 [ERROR] Slave SQL: Error 'Unknown database 'sen'' on query. Default database: 'sen'. Query: 'create table t(id int(11), primary key(id))', Error_code: 1049
161105 19:39:05 [Warning] Slave: Unknown database 'sen' Error_code: 1049
161105 19:39:05 [ERROR] Error running query, slave SQL thread aborted. Fix the problem, and restart the slave SQL thread with "SLAVE START". We stopped at log 'mysql-bin.000003' position 107
161105 19:39:05 [Note] Event Scheduler: Loaded 0 events
161105 19:39:05 [Note] /application/mysql-5.5.32/bin/mysqld: ready for connections. Version: '5.5.32' socket: '/data/3307/mysql.sock' port: 3307 Source distribution
161105 19:40:05 [Note] Slave I/O thread: connected to master 'rep@192.168.80.2:3306',replication started in log 'mysql-bin.000004' at position 317
グーグルで検索したら出てきた
https://bugs.mysql.com/bug.php?id=19344
私はやった
1. 2 つの mysql プロセス 3306 および 3307 を再起動します。
2. スレーブ データベース: スレーブを停止します。スレーブを開始します。
しかし、それはうまくいきません。
ちょっとお願いがあるんですが!わかりました。
センによって。