Two nodes in each data center (I think we need a node in a third data center to avoid split brain, but we haven’t done that yet).
So it is like this:
center1-node1
center1-node2
center2-node1
center2-node2
We have Haproxy load balancers in both locations. In center1, there is an entry for dbserver on the HAproxy server. The config is center1-node1 & center1-node2 as primaries, center2-node1 and center2-node2 as backup. In center2, haproxy is set with center2-node1 and center2-node2 as dbserver, with center1-node1 and center2-node2 as backups.
For our setup, we have a /24 block that is announced out both data centers, so “dbserver” is an IP in that /24 so it works from both data centers. But you could just as easily configure the IP for dbserver in your /etc/hosts files. We do this with NFS servers in the two locations; nfs-server is a 10.10.10.0/255.255.255.0 address and there is one in each location that floats between servers within a data center using heartbeat.
sean