Tableau HA environment, load balancer and PostgreSQL
I recently come across a tableau HA (High Availability) environment where a load balancer (you might guess it already…) divides the load of tableau traffic over multiple tableau servers.
We ran into an issue where we COULD connect to the PostgreSQL DB to hook up our user stats and server health views, but upon uploading them, the server COULDN’T reach the data source any longer.
Turns out the tableau servers within the HA and load balancer environment see one another through a different internal IP than we do from the outside.
I’ll try to explain it through the schematic below how we can connect to a single tableau server vs. the HA and load balancer environment.
In a single tableau environment, the tableau box most likely uses a DNS (domain name system) to link an easy name to the IP of the server you want to connect to (such as: tableau.yourcompanyname.com)
You could use this DNS to connect to your PostgreSQL DB using the DNS as it gets translated to the IP of the box and find the repository.
In a tableau HA environment with a load balancer, the DNS directs you to the load balancer, which sends you through to the tableau server.
From your desktop you can reach the DB by using the external facing IP of the node with the active repository (node 1 in the image). The servers themselves, however, see one another through internal IP’s. Therefore, the external IP used to setup the DB connection will fail once uploaded to the server.
Rather than using the external IP to reach the PostgresSQL on the node with the active Repository (node 1 in image), edit the connection once you’ve uploaded the data source/workbook, replacing the IP with localhost or the internal IP of the node.
Localhost should allow the PostgreSQL dB to be reaches even upon failure of the node as the HA environment would switch over the active repository the other node.
I would recommend testing your datasource connection directly from the node without the active repository (login through the tableau portal by typing in the external IP of node 2 into your browser), to check whether localhost allows you to reach the repository.
Navigate to the uploaded datasource connection, click edit and test connection.
If this fails, check whether the connection works with the internal IP of the node with the active repository. (If not, you might want to check the network and port setup, including firewall exceptions).