Dhiru
Dhiru

Reputation: 179

kubernetes pod unable to connect to external database

I have an external postgres database (using digital ocean); I am able to connect to it from my laptop but I get a connection timeout from my minikube kubernetes pod. This is in dotnet core (not sure if that matters)

fail: Program[0] identity-55595689b5-qb8gh identity Npgsql.NpgsqlException (0x80004005): Failed to connect to :25060

I also added external IP and external name service .. but still getting timeouts.. could anyone please let me know what I might be doing wrong

Upvotes: 0

Views: 725

Answers (1)

Sai Chandini Routhu
Sai Chandini Routhu

Reputation: 1

The below information derived from santiesuite Help portal

Cause: The cause lies with an overflow of connections against the PostgreSQL server. This is very common when hosting the IMS on AWS or other hosted providers which limit the number of concurrent connections to the server.

Below workarounds can help:

1)increasing the maximum connections settings in postgres.config

2)force-disconnect all clients on your database by running the following command

select pg_terminate_backend(pid)
from pg_stat_activity
where datname = 'yourdatabasename

'

3)disable multi-threaded fetches from the data store with the following setting on your element

 <openiz.persistence.data.ado>
         <connectionManager stm="true" 
              maxRequests="4"
              />

4)reduce the number of IMS instances contacting the particular database server

5)scale-out the database to introduce read-only nodes,reducing the load on the primary data server.

Upvotes: 0

Related Questions