connection pool configuration in kubernetes

4/21/2020

How to set Tomcat JDBC Connection Pool configuration parameters like maxActive, removeAbandonedTimeout in kubernetes yaml file? my yaml file is like :

    logging:
       config: classpath:logback/logback-spring.xml
    spring:
       profiles:
       active: dev
    mvc:
        view:
        prefix: /WEB-INF/jsp/
        suffix: .jsp
   datasource:
      xyz:
         url: jdbc:oracle:thin:@xyz:1522/abc
         driverClassName: oracle.jdbc.OracleDriver
         username: user
         password: pwd

i need to set below parameters in yaml file:

<Resource
      name="jdbc/pcmDB"
      auth="Container"
      type="javax.sql.DataSource"
      factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"
      initialSize="34"
      maxActive="377"
      maxIdle="233"
      minIdle="89"
      timeBetweenEvictionRunsMillis="34000"
      minEvictableIdleTimeMillis="55000"
      validationQuery="SELECT 1"
      validationInterval="34000"
      testOnBorrow="true"
      removeAbandoned="true"
      removeAbandonedTimeout="55"
      username="xxx"
      password="yyy"
      driverClassName="com.mysql.jdbc.Driver"
      url="jdbc:mysql://localhost:3306/pcmdb?allowMultiQueries=true"
   />

Please help.

-- kalyani
kubernetes

0 Answers