Description:
If master/slave replication is set up with the replicate-rewrite-db option causing the slaves to have different database names than on the master, the ReplicationDriver can not be used to correctly connect to these renamed databases on the slaves.
jdbc:mysql:replication://master,slave1,slave2,slave3/test,test_renamed,test_renamed,test_renamed
or
jdbc:mysql:replication://address=(protocol=tcp)(host=master)(database=test),address=(protocol=tcp)(host=slave1)(database=test_renamed),address=(protocol=tcp)(host=slave2)(database=test_renamed),address=(protocol=tcp)(host=slave3)(database=test_renamed)
is not supported.
Therefore accessing a master/slave setup like this is not possible using the ReplicationDriver.
Is there a workaround beyond creating separate datasources in your application?
How to repeat:
Set up master/slave replication with the replicate-rewrite-db option and make sure the database being replicated is renamed on the slave.
Alternatively, for debugging purposes, create the identical databases on two servers, rename one of the databases.
Then try accessing the differently named databases with the ReplicationDriver.