storm-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Chew <>
Subject Too many connections error while using storm-JDBC
Date Wed, 08 Jun 2016 11:06:06 GMT
Hi all,

I got Too Many Connections error while running my topology in test environment. I am checking
below codes,

        //prepare JDBC configuration
        Map jdbcConfigMap = Maps.newHashMap();
        jdbcConfigMap.put("dataSourceClassName", prop.getProperty("mysql.dataSource.className"));//com.mysql.jdbc.jdbc2.optional.MysqlDataSource
        jdbcConfigMap.put("dataSource.url", prop.getProperty("mysql.url"));//jdbc:mysql://localhost/test
        jdbcConfigMap.put("dataSource.user", prop.getProperty("mysql.user"));//root
        jdbcConfigMap.put("dataSource.password", prop.getProperty("mysql.password"));//password
        config.put(JDBC_CONF, jdbcConfigMap);
        this.connectionProvider = new HikariCPConnectionProvider(jdbcConfigMap);

This will create a new HikariCPConnectionProvider each Spout/Bolt task. By default each connectionProvider
will initial 10 connections. Totally there have 48 tasks. This will create 480 connections
while MySQL max-conenctions is 400. I am going to change this,  but I don't know how to force
all tasks running on my 4 supervisor nodes to use the same dataSource?

Thanks in advance.


View raw message