Documentation Home
MySQL 5.6 リファレンスマニュアル
Download this Manual
PDF (US Ltr) - 26.8Mb
PDF (A4) - 26.9Mb
HTML Download (TGZ) - 7.1Mb
HTML Download (Zip) - 7.2Mb レプリケーションスレーブ構成の設定

レプリケーションスレーブでは、一意サーバー ID を作成する必要があります。これがまだ行われていなかった場合、この部分のスレーブセットアップにはサーバーの再起動が必要です。

スレーブサーバー ID がまだ設定されていない場合、または現在の値がマスターサーバーに選択した値と競合する場合は、スレーブサーバーをシャットダウンし、構成ファイルの [mysqld] セクションを編集して、一意サーバー ID を指定します。例:



複数のスレーブをセットアップしている場合、それぞれのスレーブでは、一意 server-id 値がマスターのものおよびほかのすべてのスレーブのものと異なる必要があります。


server-id を省略すると (または明示的にデフォルト値の 0 に設定すると)、スレーブはマスターへの接続を拒否します。


User Comments
User comments in this section are, as the name implies, provided by MySQL users. The MySQL documentation team is not responsible for, nor do they endorse, any of the information provided here.
  Posted by Richard Lynch on November 4, 2011
WARNING: My fail-over experience is very tiny, despite using MySQL for dozens of sites with zero budget for decades...

Maybe I'm missing something, but unless you set the log-bin=mysql-bin to the SAME value as you set in the Master Setup[1] instructions, your slave isn't really ready to become the new master when you fail-over.

At least, that's what my one experiment so far has shown.

And when I changed the log-bin on the slave to match and re-started, any queries that happened in between didn't make it back to the former-master/new-slave when I started that back up.

So I believe these Master Setup and Slave Setup should both have log-bin=xyz values that match in these docs, or leave them out and use the defaults.

But don't document one and not the other, making readers think they can change it only on the Master setup.

Please forgive me if I'm just completely off-base. Will experiment more and try to give a Beginner's Guide in a blog.

It seems like there are so many options and scenarios being documented here, that the baseline "HowTo" is obscured by the "gothcas" and "edge cases" and "if this, then that" docs...

I'm not unwilling to help, once I actually plow through it for myself :-)


  Posted by Stephen Wylie on January 25, 2012
You should also put


into your my.cnf on the slave, so that the 'show slave hosts' command will work on the master.