Let say I deployed yugabyteDB on Amazon EKS with 3 nodes
I can use 1 of those nodes external IP to connect to yugabyteDB
If that node got some issue and stops working (let say I deleted the pods deliberately), is there any way to maintain the connection I made without reconnecting by using other 2 nodes external IP?
Furthermore, I believe the deleted pods will be replaces with new pods with new external IP, so the old external IP I used to connect supposedly will not work.
Hi @cyberboy
Do you intend to use the YSQL(PostgreSQL) api or the YCQL(Cassandra) api ?
@dorian_yugabyte
Thank you for the response
I intend to use the YSQL(PostgreSQL) api
You can use a load balancer in front of all the pods and connect to the load balancer from the application.
Or you can specify multiple hosts in the connection string when you connect to PostgreSQL.
If all ips change, then you need to update your app configuration.
Or use hostnames and update the dns.
@dorian_yugabyte
Is there any configuration file I can refer to set a load balancer in front of all the pods as you suggested?
You can use any TCP load balancer like haproxy, nginx, aws/google load balancer etc. Example setup in google cloud [docs] Load Balancer Configuration for YSQL in Google Cloud using Yugabyte Platform · Issue #5746 · yugabyte/yugabyte-db · GitHub
@dorian_yugabyte
Do you have any example with AWS for setting up load balancer in front of all the pods?
Thanks
@cyberboy it should be pretty straightforward if you limit max 1 pod in 1 server, and set it to a fixed port. Then the load-balancer can just connect to that port on all machines, say, port 5433 like we do normally.