Thoughts/Advice on Postgres SQL DB Cluster

Status
Not open for further replies.

Blastomatic

Wise, Aged Ars Veteran
119
Hi All, I'm not sure if anyone here has much experience in this, I certainly hope so. Here's the scenario:

I'm putting together a clustered Postgres DB and have done some research on it but nothing seems to clear this up for me. Basically, what I want to do is have two active nodes (1/2) and two passive nodes (3/4) that all read/write to the same iSCSI SAN over 10GbE. Essentially like this crude sketch shows:

nFzFy5p.png


What I need to know is 1: is this even possible? 2: Would different nodes reading/writing to the same data store cause problems (as opposed to 4 nodes with their own DBs replicating over DRBD)?

I have some time to come up with how I'm going to make the clustering work, so any advise from admins who have done this would be greatly appreciated. Another idea is to cluster the OS level (CentOS in a 4 node cluster) and have the Postgres DB run on that cluster, but again, I'm not finding a ton of documentation on how that would be done (specifically installing Postgres on a 4 node Cent/Linux cluster).

Thanks for any advice you can give me.
 

macker0407

Ars Scholae Palatinae
908
I suppose the first question is: why are you approaching this as a 4 node problem? Do you expect the 2 active nodes to be reading and serving the same data? If not, split the problem into 2 actice/passive node setups and just export 2 LUNs from the iSCSI SAN. The setup is fairly standard and covered by various LinuxHA guides out there(many include DRDB, but you can essentially just ignore that bit and treat your iSCSI LUN as a pre-configured DRDB device).

Otherwise if you need two active/active nodes serving up the same data you'll need to use something like Postgres-XC. However, this will mean that each DB node's data is independent even if it's backed by an iSCSI volume(so you'd divide it into 4 LUNs and give each one 1).
 

Blastomatic

Wise, Aged Ars Veteran
119
Well, I'm looking at it like this: Right now, we would be just fine with a two node cluster. However, I would like to be able to easily scale the system up without a significant re-design of the entire DB platform. So, if I plan out and build for a 4 node system, but only initially build a two node system, that breathing room I may need is not going to take a large scale re-build to accomplish. That's my reasoning, but I fully accept that the reasoning is based on maybe a 1/2 to 2/3rds understanding of the capability of the clustered system. If expanding the cluster is easy enough, then going with a dual node, active/passive setup, is going to be the initial deployment. Long story short, I'm familiar with MSSQL clustering and not Postgres clustering. As such I'm being conservative and probably over-provisioning as far as my plan goes. But thanks macker, your response basically sounds like something I'd say if I were more familiar with the subject.
 

macker0407

Ars Scholae Palatinae
908
Your choices are fairly binary: if you want to do a shared LUN cluster(for space efficiency reasons), you can only do active/passive, although there is technically nothing stopping you from doing active/passive/passive/passive with the right failover rules and some cleverness with multiple Postgres instances. Shared LUN clustering won't give you any performance benefits, it's purely for availability.

If you need performance scalability, then you have to look at log shipping/replication clustering schemes. These will generally give you fairly linear read performance scaling, but write scaling is significantly harder and depends on your redundancy and consistency requirements. If you have to ensure that a COMMIT doesn't return until *every* node in the cluster has the data then you probably won't get any write scaling. Even if not, write scaling via clustering will never be a linear increase and has an eventual cap. If you need/want linear scaling you have to go back to the application layer and look into sharding and similar strategies.
 

Blastomatic

Wise, Aged Ars Veteran
119
[url=http:/civis/viewtopic.php?p=25244201#p25244201:8ecps0vu said:
macker0407[/url]":8ecps0vu]Your choices are fairly binary: if you want to do a shared LUN cluster(for space efficiency reasons), you can only do active/passive, although there is technically nothing stopping you from doing active/passive/passive/passive with the right failover rules and some cleverness with multiple Postgres instances. Shared LUN clustering won't give you any performance benefits, it's purely for availability.

If you need performance scalability, then you have to look at log shipping/replication clustering schemes. These will generally give you fairly linear read performance scaling, but write scaling is significantly harder and depends on your redundancy and consistency requirements. If you have to ensure that a COMMIT doesn't return until *every* node in the cluster has the data then you probably won't get any write scaling. Even if not, write scaling via clustering will never be a linear increase and has an eventual cap. If you need/want linear scaling you have to go back to the application layer and look into sharding and similar strategies.
Nice, I really appreciate the feedback.
 
Status
Not open for further replies.