Configuration of Crowd for Postgres DR setup
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
Configuration of Postgres DR(active/standby) setup in Confluence or Crowd
Environment
Crowd
Diagnosis
In Crowd, we can't configure active,standby database servers through standard C3po. It adds an extra backslash when we start the crowd after changes
Cause
The reason is Crowd adds the parameter manually reWriteBatchedInserts=true on detecting the Postgres database thus causing the URL to break
e.g If the following URL is configured in crowd.cfg.xml
1
jdbc:postgresql://172.16.158.177:5432,172.16.158.178:5432/crowd?targetServerType=master&reWriteBatchedInserts=true
It will be modified into the following that is not valid
1
dbc:postgresql://172.16.158.177:5432/,172.16.158.178:5432/crowd?targetServerType=master&reWriteBatchedInserts=true
Solution
The solution is to use a Datasource connection rather c3p0 by configuring like below in CROWD_INSTALL>/apache-tomcat/conf/Catalina/localhost/crowd.xml
1
2
3
4
5
6
7
8
<Resource name="jdbc/crowdDS" auth="Container" type="javax.sql.DataSource"
username="postgres"
password=""
driverClassName="org.postgresql.Driver"
url="jdbc:postgresql://172.16.158.177:5432,172.16.158.178:5432/crowd235?targetServerType=master"
maxTotal="60"
maxIdle="20"
validationQuery="select 1"/>
Note:
1) Due to targetServerType=master the standby node has to be made master before the crowd can connect to it.
2) As also already mentioned removing reWriteBatchedInsert can decrease the performance of the application.
Was this helpful?