ch huang wrote:
> i set the m-s cluster ,it's works fine,but when i what to filter the single
> DB to slave server it can not work,i do not know why,can anyone help?
> the master config file:
>
You don't mention what the problem is?
However, when filtering on DB (or table etc.) you must be careful not to
filter out the mysql database as that is necessary for replication to
work correctly.
See
http://dev.mysql.com/doc/refman/5.1/en/mysql-cluster-replication-issues.html
under the heading "*Replication and binary log filtering rules with
replication between MySQL Clusters"*
> [mysqld]
> datadir=/data/mysql-old
> socket=/tmp/mysql.sock
> user=mysql
> # Default to using old password format for compatibility with mysql 3.x
> # clients (those using the mysqlclient10 compatibility package).
> old_passwords=1
> log-bin
> binlog-do-db=test
>
> server-id=1
> [mysqld_safe]
> log-error=/var/log/mysqld.log
> pid-file=/var/run/mysqld/mysqld.pid
>
> and slave server
> [mysqld]
> datadir=/var/lib/mysql
> socket=/var/lib/mysql/mysql.sock
> user=mysql
> # Default to using old password format for compatibility with mysql 3.x
> # clients (those using the mysqlclient10 compatibility package).
> old_passwords=1
>
> server-id=3
> relay-log=/var/run/mysqld/mysqld-relay-bin
> replicate-do-db=test
>
> [mysqld_safe]
> log-error=/var/log/mysqld.log
> pid-file=/var/run/mysqld/mysqld.pid
>
>
> slave > show processlist;
>
> +----+-------------+-----------+------+---------+------+-----------------------------------------------------------------------+------------------+
> | Id | User | Host | db | Command | Time |
> State |
> Info |
>
> +----+-------------+-----------+------+---------+------+-----------------------------------------------------------------------+------------------+
> | 1 | system user | | NULL | Connect | 687 | Waiting for master
> to send event | NULL |
> | 2 | system user | | NULL | Connect | 686 | Has read all relay
> log; waiting for the slave I/O thread to update it | NULL |
> | 4 | root | localhost | test | Query | 0 |
> NULL | show
> processlist |
>
> +----+-------------+-----------+------+---------+------+-----------------------------------------------------------------------+------------------+
> 3 rows in set (0.00 sec)
>
> master > show processlist;
>
> +----+--------+-------------------+------+-------------+------+----------------------------------------------------------------+------------------+
> | Id | User | Host | db | Command | Time |
> State |
> Info |
>
> +----+--------+-------------------+------+-------------+------+----------------------------------------------------------------+------------------+
> | 2 | myrepl | 172.16.1.19:32960 | NULL | Binlog Dump | 737 | Has sent all
> binlog to slave; waiting for binlog to be updated | NULL |
> | 3 | myrepl | 172.16.2.44:48119 | NULL | Binlog Dump | 715 | Has sent all
> binlog to slave; waiting for binlog to be updated | NULL |
> | 4 | root | localhost | test | Query | 0 |
> NULL | show
> processlist |
>
> +----+--------+-------------------+------+-------------+------+----------------------------------------------------------------+------------------+
> 3 rows in set (0.00 sec)
>
>
--
Frazer Clement, Software Engineer, MySQL Cluster
Sun Microsystems - www.mysql.com
Office: Edinburgh, UK
Are you MySQL certified? www.mysql.com/certification