default role = "primary" Not Working #747
Unanswered
aviralsingh21
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have setup of HA 3-nodes of PostgreSQL with the help of Patroni-ETCD in the docker swarm environment.
I am setting up pgcat and I want to redirect all the read-write transactions only to the primary role. But I have tried different valued for default_role like any, replica and primary. But no matter what is the value set but connections are happening completely random.
pgcat.toml:
`[general]
host = "0.0.0.0"
port = 6432
enable_prometheus_exporter = false
connect_timeout = 5000
idle_timeout = 30000
server_lifetime = 86400000
idle_client_in_transaction_timeout = 0
healthcheck_timeout = 1000
healthcheck_delay = 30000
log_client_connections = true
log_client_disconnections = true
worker_threads = 1
tcp_keepalives_idle = 480
tcp_keepalives_count = 5
tcp_keepalives_interval = 5
admin_username = "postgres"
admin_password = "postgres"
[plugins.query_logger]
enabled = true
[pools.patroni]
pool_mode = "session"
query_parser_enabled = false
default_role = "primary"
prepared_statements_cache_size = 500
[pools.patroni.users.0]
username = "postgres"
password = "postgres"
pool_size = 10
min_pool_size = 1
[pools.patroni.shards.0]
servers = [["192.168.1.25", 6437, "primary"], ["192.168.1.26", 6438, "replica"], ["192.168.1.27", 6439, "replica"]]
database = "patroni"`
Beta Was this translation helpful? Give feedback.
All reactions