Иван Атлас
Иван Атлас

Reputation: 1

wso2 api manager change database Carbon_DB to connect to postgres

I am currently deploying a wso2 api manager to Kubernetes. I want to change the Carbon_DB H2 database to connect to PostgreSQL. But I can't figure out if each node needs a separate database or if it can be shared?

I couldn't find the information, but I don't want to do H2 on PVC. Thanks for the help.

Upvotes: 0

Views: 18

Answers (1)

Siluni Pathirana
Siluni Pathirana

Reputation: 429

You can share the database between nodes. In order to change the database from H2 to Postgres, you need to add the database configuration as follows in the deployment.toml file

Sample configuration will be as follows.

[database.shared_db]
type = "postgre"
url = "jdbc:postgresql://localhost:5432/shared_db"
username = "sharedadmin"
password = "sharedadmin"
driver = "org.postgresql.Driver"
validationQuery = "SELECT 1"

[database.apim_db]
type = "postgre"
url = "jdbc:postgresql://localhost:5432/apim_db"
username = "apimadmin"
password = "apimadmin"
driver = "org.postgresql.Driver"
validationQuery = "SELECT 1"

Please refer to the documentation [1] for more info.

[1] https://apim.docs.wso2.com/en/latest/install-and-setup/setup/setting-up-databases/changing-default-databases/changing-to-postgresql/

Upvotes: 0

Related Questions