久々の更新。
技術ネタ。


設定絶対間違ってないのに、
MySQLのレプリケーションできない、


slave側で

mysql> start slave ;
ERROR 1200 (HY000): The server is not configured as slave; fix in config file or with CHANGE MASTER TO


てなってエラーでたwww
ちなみにエラーログは


-----
[ERROR] Slave I/O: Fatal error: The slave I/O thread stops because master and slave have equal MySQL server ids; these ids must be different for replication to work (or the --replicate-same-server-id option must be used on slave but this does not always make sense; please check the manual before using it). Error_code: 1593
-----
(長い・・・)


ようは server-id が同じだぞ!って言われてる。


設定確認。

mysql> show variables like 'server_id';

結果
master: server-id = 1
slave: server-id =2


ええー server-id 同じじゃないんですけどwww



【オチ】
slave 側で最初にレプリケーションを開始した時、
master のIPを間違って slave(自分自身) のIPにしてしまっていた。

その際に master.info が作成(誤った内容)された。
IPを正しいものに修正したが、master.info の内容は
変更されずに自分自身を見にいっていた。


なので


【対応】
slave 側で MySQL を停止

# rm -i /var/lib/mysql/master.info

して MySQLを起動。



でわーん