vitabaks / postgresql_cluster

Automated database platform for PostgreSQL® — the open-source alternative to cloud-managed databases.
https://postgresql-cluster.org
MIT License
1.84k stars 418 forks source link

your own machine hetzner #801

Closed TrinityGale closed 6 days ago

TrinityGale commented 2 weeks ago

Hi I give 10.0.0.0.3 10.0.0.0.4 10.0.0.0.5 to the private ip addresses in your own server section to the server I opened before with vds in hetzner and 10.0.0.3 in Cluster VIP address section but it gives failed

vitabaks commented 2 weeks ago

Hi @TrinityGale try without a VIP address

Screenshot 2024-11-08 at 11 22 57 PM

Doc: https://postgresql-cluster.org/docs/deployment/your-own-machines

TrinityGale commented 2 weeks ago

thank you but now I get this error fatal: [10.0.0.5]: FAILED! => {"changed": false, "msg": "Unable to start service etcd: Job for etcd.service failed because the control process exited with error code.\nSee \"systemctl status etcd.service\" and \"journalctl -xeu etcd.service\" for details.\n"}

TrinityGale commented 2 weeks ago

I solved it, the hostnames must be different, how do I clean the operations logs? I have one more question, are the read and write ports different or does the haproxy redirect itself?

vitabaks commented 2 weeks ago

how do I clean the operations logs?

You can delete entries in the operations table in the console database, but why would you want to? The operations table is intended to serve as an audit log, recording all actions performed on the cluster.

vitabaks commented 2 weeks ago

are the read and write ports different or does the haproxy redirect itself?

Yes, different.

Your application must have support sending read requests to a custom address/port.

Doc: https://postgresql-cluster.org/docs/overview/architecture

TrinityGale commented 1 week ago

Do I have the chance to write read from a single port, can haproxy redirect according to the query, and can I rent 4-5 clusters on the same server separately? Sorry havre bad english and thank you

vitabaks commented 6 days ago

Do I have the chance to write read from a single port, can haproxy redirect according to the query

To read and write from a single port when using HAProxy, use port 5000, in which case all traffic will be directed to the Primary server.

Or use target_session_attrs (libpq), but this only works when connected directly without using pgbouncer

read-write:

"postgresql://host1:5432,host2:5432,host3:5432/?target_session_attrs=read-write"

read-only with load balancing:

"postgresql://host1:5432,host2:5432,host3:5432/?target_session_attrs=read-only?load_balance_hosts=random"

and can I rent 4-5 clusters on the same server separately?

Only one cluster within a single server is supported. You can simply create more VMs to create multiple database clusters.

TrinityGale commented 6 days ago

Thank you