【异常】ShardingSphere启动很慢的问题 Too slow to load meta data when start up

一、出现的场景

依赖的sharding-jdbc-core的版本从 <version>4.0.0</version>升级到<version>4.1.1</version>,导致项目启动特别慢

    <dependency>
            <groupId>org.apache.shardingsphere</groupId>
            <artifactId>sharding-jdbc-core</artifactId>
        </dependency>

二、解决办法

设置max.connections.size.per.query参数

Properties properties = new Properties();
properties.setProperty("max.connections.size.per.query", "50");
return ShardingDataSourceFactory.createDataSource(createDataSourceMap(), configuration, properties);

 

posted @ 2020-06-14 13:51  N!CE波  阅读(6722)  评论(2编辑  收藏  举报