Connect to mysql server with one url but have multiple masters
This isn't a replication problem to solve. Something like spider, max scale or vitess. Also, see the Percona toolkit for comparing tables.
Of course internally you could have some DNS based mechanism like p5.mydb.com to indicate these server has p5 and use this in the application's connection to the database.
If you have same databases in all slaves then you need a load balancer, which you can achieve with haproxy, ngnix. If you want to split read write between slave and master then you can look into proxySQL. If you have different databases then you need to manage that in the connection strings.