English 中文(简体)
Do I absolutely need a minimum of 3 nodes/servers for a Cassandra cluster or will 2 suffice?
原标题:

Surely one can run a single node cluster but I d like some level of fault-tolerance.

At present I can afford to lease two servers (8GB RAM, private VLAN @1GigE) but not 3.

My understanding is that 3 nodes is the minimum needed for a Cassandra cluster because there s no possible majority between 2 nodes, and a majority is required for resolving versioning conflicts. Oh wait, am I thinking of "vector clocks" and Riak? Ack! Cassandra uses timestamps for conflict resolution.

For 2 nodes, what is the recommended read/write strategy? Should I generally write to ALL (both) nodes and read from ONE (N=2; W=N/2+1; W=2/2+1=2)? Cassandra will use hinted-handoff as usual even for 2 nodes, yes?

These 2 servers are located in the same data center FWIW.

Thanks!

最佳回答

If you need availability on a RF=2, clustersize=2 system, then you can t use ALL or you will not be able to write when a node goes down.

That is why people recommend 3 nodes instead of 2, because then you can do quorum reads+writes and still have both strong consistency and availability if a single node goes down.

With just 2 nodes you get to choose whether you want strong consistency (write with ALL) or availability in the face of a single node failure (write with ONE) but not both. Of course if you write with ONE cassandra will do hinted handoff etc as needed to make it eventually consistent.

问题回答

暂无回答




相关问题
Error monitoring/handling on webservers

We have a web server that we re about to launch a number of applications onto. They will all share database and memcached servers, but each application has it s own mySQL database and all memcached ...

Articles about replication schemes/algorithms?

I m designing a distributed system with a certain flow of data in it. I d like to guarantee that at least N nodes have almost-current data at any given time. I do not need complete consistency, only ...

热门标签