-
Notifications
You must be signed in to change notification settings - Fork 230
[+] allow to specify multi-host connection string for configDB
with target_session_attrs
#647
Conversation
Would you please provide the situation when |
For example when Config DB is PG cluster and you want to set it to read-write node. Host field accepts currently already multiple hosts if you supply them and separate by comma. Connection String will be built out of the parameters supplied. However target_session_attrs is not supplied and its default value is 'any' if not supplied.
In our environment I have set up 2 pgwatch machines, one per site, they share config DB and it is clustered. Web is accessible on both nodes. PgWatch2 service itself I unfortunately have to stop and start depending on which site is mainly active. It is more in case something would happen to one site, then I can easily start monitoring service on machine located in 2nd site. After that change I can connect to Config DB RW node when provide those options in pgwatch2-webui.service file.
Maybe the Environment variable should be named to PW2_PGTARGET_SESSION_ATTRS just to align with other of it's PG related variables. |
I would suggest not to have the new |
This approach would accepts a certain risk when all nodes are degraded to standby for a while...but still OK I think as the config DB / UI is not operationally critical compared to the metrics collector - which does actually configuration caching to handle short config file / DB downtimes. |
Update ENV_VARIABLES.md
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm now!
configDB
with target_session_attrs
Would you please resolve conflicts? It's probably introduced by #646 |
OK, will resolve the conflict that other PR caused. I added row to documentation as well about read-write being default. |
Removes nested conditions
Thanks |
With that Config DB can be PG cluster. Should be combined with #646 to avoid either setting password in service file or having pg_hba rule with "trust"