配置多数据源出现dynamic-datasource Please check the setting of primary

通过错误信息我们可以定位到是这个类报的异常配置多数据源出现dynamic-datasource Please check the setting of primary

找到这个类发现异常位置配置多数据源出现dynamic-datasource Please check the setting of primary

通过断点发现这个map里没有值配置多数据源出现dynamic-datasource Please check the setting of primary

通过当前页面搜索发现在这里添加的

配置多数据源出现dynamic-datasource Please check the setting of primary

配置多数据源出现dynamic-datasource Please check the setting of primary

根据此处逻辑发现,判断数据库的名字里是否有下划线,有的话把下滑线前面的一部分当成组名,然后进行校验和添加操作。配置多数据源出现dynamic-datasource Please check the setting of primary

所以将数据源的名字添加了个master前缀

配置多数据源出现dynamic-datasource Please check the setting of primary

ok,项目可以正常启动。这里我记得之前配置好像不是这样也行的,可能是jar包版本不同,所以这里的配置有一点点差异吧。