I need to implement a mysql multisource replication using mysql >=5.7.11, there are already a certain number of mysql servers running which will become masters for the single slave which is going to be installed soon. The main problem is that each master has same db name and I would like to avoid conflicts in slave and keep each db replica separated. Is there a way to configure the slave to, for example, put master name as prefix of its dbname? I mean something like this : master1.db master2.db
Or do I really need to choose one of the following : - Change db name on masters - Install one slave server for each master ?
Thanks in advance Best regards magowiz
UPDATE : As described in comments, in short :
I also tried something like that, using a solution borrowed by mariadb that I discovered it's not compatible with mysql : mariadb.com/blog/… . I write something like :
[mysqld] master1.replicate_rewrite_db=db->db1 master2.replicate_rewrite_db=db->db2
with master1 and master2 the two replication channels but it didn't work , I only obtain replication of first instance db to db1 . Is there a way to use replicate_rewrite_db directive on channel/master base ?
The answer I gave to myself it is NO , you can set up multisource replication, you can rename every replicated db on slave specify the mapping but this directive cannot be related to channel, so you need to have unique db names across all masters in order to make multisource replication work.
Currently it seems that mariadb implements this and mysql not.