我们有一台服务器的数据库太多。我们一直在不断增长,并添加了更多的数据库。
我们希望能够添加更多的mysql服务器,并让我们的客户端透明地访问代理(sqlproxy?),并使其通过数据库名称将查询定向到正确的服务器。
可以将sqlproxy配置为执行此操作吗?我只看到通过查询重定向。
有什么解决办法吗?
答案 0 :(得分:1)
I can understand the -1s above: a simple google throws up many articles that explain how to do this, but I'll answer the question regardless of this.
Yes it's possible: you basically can do it with maxscale and proxysql. Proxysql is easier to implement and offers query routing out of the box. You basically create for each of the sharded/partitioned hosts a hostgroup. Then you create a rule matching the schema you wish to redirect and insert the designated hostgroup here.
This tutorial will explain everything you need to know and is easy to follow:
https://severalnines.com/blog/tips-and-tricks-how-shard-mysql-proxysql-clustercontrol