Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Postgres multimaster support #4934

Open
hillout opened this issue Jul 17, 2024 · 3 comments
Open

Postgres multimaster support #4934

hillout opened this issue Jul 17, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@hillout
Copy link

hillout commented Jul 17, 2024

Is your feature request related to a problem? Please describe.
I have a two node Postgres multimaster cluster based on repmgr bitnami. One node has a primary status, whereas the second node has secondary status. In case of failure secondary became a primary and vice versa.

Describe the solution you'd like
Keycloak for example can use this type of configuration by using configuration like this: postgresql://db1-keycloak.domain.org:5432,db2-keycloak.domain.org:5432/keycloak?connectTimeout=1&hostRecheckSeconds=2&socketTimeout=600&targetServerType=primary&ssl=true&sslmode=require

Would be nice if boundary controller had such support as well.

Describe alternatives you've considered
Alternative for me is using reverse proxy, which I'd wanna avoid.

@hillout hillout added the enhancement New feature or request label Jul 17, 2024
@achetronic
Copy link

Hey @hillout this can be useful for you:

https://github.com/achetronic/pg-selector

Basically it creates a service that always point to the master. I have the same setup and it's working fine :)

@hillout
Copy link
Author

hillout commented Aug 8, 2024

@achetronic hi! Thanks for the tip.

For now I'm dealing with this by using VRRP and Keepalived, so both primary and secondary utilize one IP and VIP is on "primary" whilst its state persist, once secondary become "primary" VIP goes to this node.

@achetronic
Copy link

@achetronic hi! Thanks for the tip.

For now I'm dealing with this by using VRRP and Keepalived, so both primary and secondary utilize one IP and VIP is on "primary" whilst its state persist, once secondary become "primary" VIP goes to this node.

Welcome! In my repos you will find a lot of useful tools for a variety of use cases :)

The solution seems to be much more complex. How does it work?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants