sharding如何动态添加数据源

也看这个方案了 how to config actual-data-nodes while my actual-data-nodes tables is dynamic。 · Issue #16725 · apache/shardingsphere (github.com)
做起来很奇怪不说,5.1.2里dataSource.getContextManager()也没了

那还是建议使用ss-proy

因为元数据模块在调整,反射取出来吧233,参考 Confusion about changes to ShardingSphereDataSource and ContextManager · Issue #18494 · apache/shardingsphere · GitHub

感谢回复,已经取出来contextmanager了,现在有一个问题是,怎么把这个新租户的数据源添加进去,或者说有没有可能重新加载一下所有的数据源(我是用java的方式来配置的数据源),contextmanager里暂时还没有发现有相关的接口

org.apache.shardingsphere.mode.manager.ContextManager#alterDataSourceConfiguration这个方法应该可以

好的,谢谢,我尝试下

京ICP备2021015875号