Connection string with failover hosts

8 views
Skip to first unread message

Timur Luchkin

unread,
Nov 28, 2022, 10:08:37 AM11/28/22
to citus-users
Is it possible to specify several hosts with citus_add_node? 

It will allow automatically redirect coordinator's connections in case of worker's failover.
For example , like libpq string for psql:
psql -d 'host=masterIP,replicaIP1,replicaIP2 port=5432 dbname=mydb user=postgres target_session_attrs=read-write'

If it is not supported, - do U have a plans to implements this any time soon?
Thanks.

jelte....@microsoft.com

unread,
Nov 28, 2022, 10:28:13 AM11/28/22
to citus-users
You can create multiple read replica clusters by using different clustername values for each of the nodes in the different clusters. 

Timur Luchkin

unread,
Nov 28, 2022, 10:37:01 AM11/28/22
to citus-users
Hi Jelte
I got your reply regarding READ replicas in other topic. 
But here I want to specify multiple connections to the WRITE worker (master db) . During the opening of connection from coordinator to worker it should choose the actual master DB from the list  (using libpq flag "target_session_attrs=read-write" flag or java's equivalent  "targetServerType=master").



jelte....@microsoft.com

unread,
Nov 28, 2022, 10:55:52 AM11/28/22
to citus-users
You cannot specify multiple hosts at the same time for a node. The current recommendation is to call citus_update_node as part of your worekr failover procedure to change the hostname/port of the worker that failed over. 

Timur Luchkin

unread,
Nov 28, 2022, 11:06:19 AM11/28/22
to citus-users
thank U
Reply all
Reply to author
Forward
0 new messages