We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
要求:
The text was updated successfully, but these errors were encountered:
Kurok1/microsphere-multiactive@f9a716b
数据库定义(classpath:/META-INF/microsphere-database-zone.properties)
microsphere.multiple.jdbc.defaultZone=localhost:33306,localhost:13306 microsphere.multiple.jdbc.AZone=localhost:3306
jdbcUrl定义 jdbc:mysql:replication://localhost:33306,localhost:13306,localhost:3306/test?ha.loadBalanceStrategy=io.microsphere.multiple.active.zone.jdbc.mysql.ZonePreferenceBalanceStrategy
jdbc:mysql:replication://localhost:33306,localhost:13306,localhost:3306/test?ha.loadBalanceStrategy=io.microsphere.multiple.active.zone.jdbc.mysql.ZonePreferenceBalanceStrategy
Sorry, something went wrong.
可直接使用 ReplicationConnectionProxy 多主多从策略,将同区域MySQL实例配置为SOURCE,其他区域MySQL实例配置为REPLICA),配置方式如下: jdbc:mysql:replication://root:root123456@(host=localhost,port=3309,type=SOURCE),root:root123456@(host=localhost,port=3310,type=SOURCE),root:root123456@(host=localhost,port=3311,type=REPLICA),root:root123456@(host=localhost,port=3312,type=REPLICA)/my_schema?ha.loadBalanceStrategy=random 参考代码:com.mysql.cj.conf.ConnectionUrlParser 配置效果:
jdbc:mysql:replication://root:root123456@(host=localhost,port=3309,type=SOURCE),root:root123456@(host=localhost,port=3310,type=SOURCE),root:root123456@(host=localhost,port=3311,type=REPLICA),root:root123456@(host=localhost,port=3312,type=REPLICA)/my_schema?ha.loadBalanceStrategy=random
优点:无入侵,完全使用MySQL驱动原生实现和配置;可在实现多区域多活、同区域优先的前提下,支持LoadBalance策略。 缺点:功能仅限于多区域多活、同区域优先,如果需要指定区域优先级等定制策略,还是需要自定义扩展。
No branches or pull requests
要求:
The text was updated successfully, but these errors were encountered: