cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X

Thingworx 9.1 cannot connect Azure Postgresql 12

burak
10-Marble

Thingworx 9.1 cannot connect Azure Postgresql 12

Hi all,

I'm trying to install Thingworx 9.1 on Redhat with Azure Postgresql Database.

 

When I start tomcat, I'm getting; "Connections could not be acquired from the underlying database!" error. I've tested connection (ping [db_ip]) and user_name password with PgAdmin.

 

I attached my platform-settings.json file and Application.logs

 

Thanks,

1 ACCEPTED SOLUTION

Accepted Solutions
burak
10-Marble
(To:burak)

Hi all,

 

I found the mistake. The missing part is from platform-settings.json

 

I added the below line into the PostgresPersistenceProviderPackage->ConnectionInformation then it worked. 

 

"sslMode": "prefer"

 

"PersistenceProviderPackageConfigs": {
"PostgresPersistenceProviderPackage": {
"ConnectionInformation": {
"jdbcUrl": "jdbc:postgresql://10.20.0.4:5432/thingworx",
"password": "123456",
"username": "twadmin",
"sslMode": "prefer"
}
}
}

 

View solution in original post

3 REPLIES 3

Hello @burak ,

 

Have you checked the port 5432 , it needs to be open and listening .

List all active connections
SELECT * FROM pg_stat_activity;
Validate the configured maximum connection limit
SHOW max_connections;

Please post the <tomcat_home>\logs\catalina.log

As well, what is the Redhat version and Tomcat version ?

 

Thank you,

 

Hello @Ciprian-Traian, thanks for your reply.

 

After posting my question, I got more information from Microsoft. Firstly, I would like to explain my network infrastructure.

Connectivity method of Azure Postgresql; Private access (VNet Integration)

My laptop is in same network via "Virtual network gateway" and gets ip from Address pool (point-to-site conf)

I can reach to Azure Postgresql via pgAdmin but when I try to access from Tomcat, I'm getting error.

 

Here is the error from Azure Postgresql; (172.0.0.4 is coming from address pool)

 

no pg_hba.conf entry for host "172.0.0.4", user "pgserveradmin", database "thingworx", SSL off

 

I've also answer from Microsoft. They suggested two workarounds;

1- You might need to integrate the tomcat application to get an IP address from the VNET where the database is located or 

2- Create a new database server with public access and use the Firewal rukes for IP entry list to add the public IPs you want to access the database including the one that Tomcat will be used. Remember the networking part of Flexible server cannot be changed after creation that's why you won't be able to modify the access for the actual database

I would like to go with option-1 but not sure that it is possible. 

burak
10-Marble
(To:burak)

Hi all,

 

I found the mistake. The missing part is from platform-settings.json

 

I added the below line into the PostgresPersistenceProviderPackage->ConnectionInformation then it worked. 

 

"sslMode": "prefer"

 

"PersistenceProviderPackageConfigs": {
"PostgresPersistenceProviderPackage": {
"ConnectionInformation": {
"jdbcUrl": "jdbc:postgresql://10.20.0.4:5432/thingworx",
"password": "123456",
"username": "twadmin",
"sslMode": "prefer"
}
}
}

 

Top Tags