vitabaks / postgresql_cluster

PostgreSQL High-Availability Cluster (based on Patroni). Automating with Ansible.
https://postgresql-cluster.org
MIT License
1.69k stars 411 forks source link

Ports, Type A #356

Closed zuhataslan closed 1 year ago

zuhataslan commented 1 year ago

Hi!

I'll run a application on network A and db cluster (type A) on network B and have a firewall between. Which of the ports listed here need to be open on the firewall. I'm guessing that most of the ports are needed only on the internal network for the cluster.

Edit: Is defaultl port 5432 enough for Type B mode?

vitabaks commented 1 year ago

Hello @zuhataslan

For client access from application network (A) to the database network (B), it is enough to open ports:

Type A

Optional:

Type B

Or (if pgbouncer_install: false)

zuhataslan commented 1 year ago

Hi @vitabaks, Thanks for your response. Regarding Type A In your answer, The read only ports are listed as optional, yet in README, it's says:

:heavy_exclamation_mark: Your application must have support sending read requests to a custom port (ex 5001), and write requests (ex 5000).

My application takes only one port for the db so I though Type A do require using at least one read and one write port, or doesn't it?

vitabaks commented 1 year ago

If your application does not support a read-only connection to the database on another port and if you do not have the task of balancing the read load, then you do not need scheme A, scheme B is sufficient, which assumes only a connection to one server - primary.