Step1:主主节点/ect/my.cnf的配置
系统版本:CentOS-6.5-x86_64
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
##node1
[mysqld]
basedir=
/usr/local/mysql
datadir=
/var/lib/mysql
port=3306
socket=
/var/lib/mysql/mysql
.sock
server-
id
=1
log-bin=
/data/mysql/binlog/mysql-bin
relay-log=
/data/mysql/binlog/mysql-relay-bin
binlog-cache-size=10m
sync
-binlog=1
expire_logs_days=30
replicate-wild-
do
-table=testdb1.%
replicate-wild-
do
-table=testdb2.%
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
##node2
[mysqld]
basedir=
/usr/local/mysql
datadir=
/var/lib/mysql
port=3306
socket=
/var/lib/mysql/mysql
.sock
server-
id
=2
log-bin=
/data/mysql/binlog/mysql-bin
relay-log=
/data/mysql/binlog/mysql-relay-bin
binlog-cache-size=10m
sync
-binlog=1
expire_logs_days=30
replicate-wild-
do
-table=testdb1.%
replicate-wild-
do
-table=testdb2.%
|
本文转自 HMLinux 51CTO博客,原文链接:http://blog.51cto.com/7424593/1752507