简体   繁体   中英

Mysql Database Replication,

I have a setup where the same Database structure is replicated across 4 servers. but the problem is, that the data isnt the same between the servers, so i cant just replicate them. as far as i know, replication master/slave should have same data and same structure, so i think its not my case.

my case : All Database have a table called Transaction with column UserID

  • Slave A have 2 rows, (12,15)
  • Slave B have 3 rows, (1,4)
  • Slave C have 1 Row (8)
  • Slave D have 7 Rows ( 2,3,5,6,7,9,10 )

now of course the Master DB needs to include all the rows.

  • Master have 13 Rows ( 12,15,1,4,8,2,3,5,6,7,9,10 ) ( after the slaves sync their data to Master )

after I sync, the rows inside the Master DB should be replicated to all the "slaves" ...

This scenario will happen every day. new rows will be inserted into the slaves DB.... then all the slaves should report to the Master, and finally, the master will push all the data back to the slaves again.

so my questions are:

  • is it a master/slave concept?
  • do I need to have a different structure?
  • if yes, how can i make Mysql do it for me ?

I searched for a question similar but i couldn't find one. if you can refer me to a question already asked, it would be awesome

thanks

Your requirement can be fulfill by implementing multi master mysql server instead of Master-slave replication. In master-slave replication: traffic flows from master to slave only (only in one direction).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM