本篇文章给大家分享的是有关Sharding Sphere Proxy该怎么理解,小编觉得挺实用的,因此分享给大家学习,希望大家阅读完这篇文章后可以有所收获,话不多说,跟着小编一起来看看吧。
定位为透明化的数据库代理端,提供封装了数据库二进制协议的服务端版本,用于完成对异构语言的支持。目前先提供MySQL/PostgreSQL版本,它可以使用任何兼容MySQL/PostgreSQL协议的访问客户端(如:MySQL Command Client, MySQL Workbench, Navicat等)操作数据,对DBA更加友好。
https://www.apache.org/dyn/closer.cgi?path=incubator/shardingsphere/4.0.1/apache-shardingsphere-incubating-4.0.1-sharding-proxy-bin.tar.gz
放开
schemaName: sharding_dbdataSources: ds1: url: jdbc:mysql://49.232.61.212:3306/sharding_1?useUnicode=true&characterEncoding=utf-8&useSSL=true&serverTimezone=Asia/Shanghai username: root password: connectionTimeoutMilliseconds: 30000 idleTimeoutMilliseconds: 60000 maxLifetimeMilliseconds: 1800000 maxPoolSize: 50shardingRule: tables: user: actualDataNodes: ds1.user_${1..2} tableStrategy: inline: shardingColumn: id algorithmExpression: user_$->{id % 2 + 1} keyGenerator: type: SNOWFLAKE column: id bindingTables: - user defaultDatabaseStrategy: inline: shardingColumn: id algorithmExpression: ds1 defaultTableStrategy: none:
这个驱动版本必须一致,不然连接不上,后来换成了8.0.17
这样就可以连接proxy库,而不用关心实际的读写分离,专注于业务开发
以上就是Sharding Sphere Proxy该怎么理解,小编相信有部分知识点可能是我们日常工作会见到或用到的。希望你能通过这篇文章学到更多知识。更多详情敬请关注亿速云行业资讯频道。
亿速云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。
原文链接:https://my.oschina.net/u/4431456/blog/4547670