For replication to work you must enable binary logging on the master. If binary logging is not enabled, replication will not be possible as it is the binary log that is used to exchange data between the master and slaves.
Each server within a replication group must be configured with a
unique server-id
value. The server ID is used
to identify individual servers within the group, and must be
positive integer between 1 and
(232)–1. How you organize and
select the numbers is entirely up to you.
To configure the binary log and server ID options, you will need
to shut down your MySQL server and edit the configuration of the
my.cnf
or my.ini
file.
You will need to add the following options to the configuration
file within the [mysqld]
section. If these
options already exist, but are commented out, uncomment the
options and alter them according to your needs. For example, to
enable binary logging, using a log file name prefix of
mysql-bin
, and setting a server ID of 1:
[mysqld] log-bin=mysql-bin server-id=1
For the greatest possible durability and consistency in a
replication setup using InnoDB
with
transactions, you should use
innodb_flush_log_at_trx_commit=1
and
sync_binlog=1
in the master
my.cnf
file.
Ensure that the skip-networking
option has
not been enabled on your replication master. If networking has
been disabled, then your slave will not able to communicate
with the master and replication will fail.
User Comments
Add your own comment.