To configure a master to use binary log file position based replication, you must ensure that binary logging is enabled, and establish a unique server ID. If this has not already been done, a server restart is required.
Binary logging is required on the master because the binary log
is the basis for replicating changes from the master to its
slaves. Binary logging is enabled by default (the
log_bin system variable is set
to ON). The
tells the server what base name to use for binary log files. It
is recommended that you specify this option to give the binary
log files a non-default base name, so that if the host name
changes, you can easily continue to use the same binary log file
names (see Section B.6.7, “Known Issues in MySQL”).
Each server within a replication topology must be configured
with a unique server ID, which you can specify using the
--server-id option. This server
ID is used to identify individual servers within the replication
topology, and must be a positive integer between 1 and
(232)−1. If you set a server ID
of 0 on a master, it refuses any connections from slaves, and if
you set a server ID of 0 on a slave, it refuses to connect to a
master. Other than that, how you organize and select the numbers
is your choice, so long as each server ID is different from
every other server ID in use by any other server in the
replication topology. The
server_id system variable is
set to 1 by default. A server can be started with this default
server ID, but an informational message is issued if you did not
specify a server ID explicitly.
The following options also have an impact on the replication master:
For the greatest possible durability and consistency in a replication setup using
InnoDBwith transactions, you should use
sync_binlog=1in the replication master's
Ensure that the
skip-networkingoption is not enabled on the replication master. If networking has been disabled, the slave cannot communicate with the master and replication fails.