Cassandra: "Unable to complete the operation against any hosts" during session.execute()

Viewed 3187

Cassandra version: 1.2.2
Thrift API version: 19.35.0
CQL supported versions: 2.0.0,3.0.1 (default: 3.0.1)
cassandra-driver for python 3.4
running cassandra/bin/cassandra with sudo

Code sample:

from cassandra.cluster import Cluster
cluster = Cluster()
session = cluster.connect()    # 1
session.execute("use test")    # 2
cluster.shutdown()

Error message for # 2:
session.execute("use test")
File "cassandra/cluster.py", line 1581, in cassandra.cluster.Session.execute
File "cassandra/cluster.py", line 3145, in cassandra.cluster.ResponseFuture.result cassandra.cluster.NoHostAvailable: ('Unable to complete the operation against any hosts', {})

Confusion:
Since there's no error in # 1 in the code sample, the connection seems to be fine. But I don't quite understand why the query execution fails.

1 Answers
Related