2011-10-10 73 views
2

我要實現同一個服務器的複製,這種方式會有兩個數據庫複製同一服務器上的一個數據庫MySQL的 - 兩個從數據庫複製

這是我在my.ini中

enter code here 


server-id=1 

log-bin 

report-host=master-is-slave-host 
log-bin=localhost-binlog 
relay-log=localhost-relaylog 

replicate-same-server-id=1 

binlog-do-db=test 
replicate-rewrite-db=test->myslave 

**#replicate-rewrite-db=test->myslave2 does not work** 

replicate-do-table=myslave.tblslave 

**#replicate-do-table=myslave2.tblslave does not work** 

配置上面的代碼工作正常複製從分貝測試,以相同的服務器

上myslave我也想實現從分貝測試複製與myslave沿着同一臺服務器上myslave2

基本上這將是一個主數據庫和兩個從數據庫複製相同的主數據庫

問候, RIZWAN

+0

所以你想的一樣mysqld充當master,slave1和slave2? –

+0

哪裏是奴隸的配置? – Gabriel

回答

1

這裏是我的my.cnf代碼:

[mysqld] 
server-id=1 
report-host=master-is-slave-host 
log-bin=/var/log/mysql/mysql-bin.log 
log-bin-index=/var/log/mysql/mysql-bin.index 
relay-log=/var/log/mysql/mysql-relay-bin.log 
relay-log-index=/var/log/mysql/mysql-relay-bin.index 
expire_logs_days=10 
replicate-same-server-id=1 
binlog-do-db=masterdb 
log-error=/var/log/mysql/error.log 
replicate-rewrite-db=masterdb->slavedb 
replicate-do-table=slavedb.some_table 
相關問題