ConnectionString for connecting 3 master nodes to MySQL

后端 未结 2 1683
既然无缘
既然无缘 2021-01-27 09:51

Backgroud

I am developing a .net project, which works with EF6 and MySQL DB. For High Availability, I am using Galera cluster, so I have 3 MySQL Master nodes up and ru

相关标签:
2条回答
  • 2021-01-27 10:18

    This isn't supported by MySQL.Data. As you observed, there are multiple bug reports (#81650, #88962) pointing out this problem, but it hasn't been fixed in three years.

    As explained here, there is an alternative MySQL library, MySqlConnector, that does support this connection string syntax. Unfortunately, there is no EF6 library available for it. (There is an EF.Core package, Pomelo.EntityFrameworkCore.MySql.)

    A workaround would be to create a layer 4 load balancer in front of your three Galera nodes. Galera provides documentation on how to do this with HAProxy. Your C# MySQL client would connect to HAProxy, and it would load balance connections between your Galera servers.

    0 讨论(0)
  • 2021-01-27 10:32

    This bug has been fixed in Connector/NET version 8.0.19

    See the release notes here: https://insidemysql.com/

    0 讨论(0)
提交回复
热议问题