Cassandra Consistency Level I have 3 virtual Cassandra nodes cluster.
Node1, Node2 &amp; Node3.

I have written a small python code to bulk load data into it.

1st time only 2 nodes out of three are available online, Node1 &amp; Node2 when I execute the python code with

session.default_consistency_level = 2

I got and error:

cassandra.Unavailable: Error from server: code=1000 [Unavailable exception] message="Cannot achieve consistency level TWO" info={'consistency': 'TWO', 'required_replicas': 2, 'alive_replicas': 1}

After that I brought my third node (Node3) online and executed the python program, it executed successfully.

As I understand Consistency Level = 2 means at least 2 nodes out of 3 should be available every time.

Thanks!
Consistency level refers to the number of replicas required, but the number of total replicas that exists is independent of the number of nodes. It is set by your Replication_Strategy. If your strategy for this keyspace only has 2 replicas then there are many situations where a CL of 2 would fail.

For nodes A, B and C

Imagine the data you want has been replicated to A and B.

But only A and C are alive. You can only get one replica even though 2 nodes are alive.