0
from cassandra.cluster import Cluster

hostname = ['contact_point_name']
port = '10350'
cluster = Cluster(hostname, control_connection_timeout=None, port = port)
session = cluster.connect()

Error: NoHostAvailable: ('Unable to connect to any servers', {'23.96.242.234:10350': OperationTimedOut('errors=Timed out creating connection (5 seconds), last_host=None')})

Erick Ramirez
  • 13,964
  • 1
  • 18
  • 23

1 Answers1

1

The error you posted indicates that it couldn't connect to the cluster at all.

The possible causes are:

  • There is no network connectivity to the node(s).
  • The node is not listening on port 10350 on IP 23.96.242.234

Cassandra is listening for client connections on IP rpc_address and port native_transport_port (default is 9042). Confirm that you have the correct details and ensure there's connectivity between your machine and the cluster using Linux tools such as telnet or nc. Cheers!

Erick Ramirez
  • 13,964
  • 1
  • 18
  • 23
  • Hey, The Ip address is correct. but Im getting a timed out error always for any method. my aim is to try and delete records from azure cosmos cassandra api through pyspark. Can you help? – Solon Das Jul 29 '21 at 08:01
  • If it's CosmosDB then you probably need to configure SSL/TLS. You'll need to consult the docs for details or get in contact with Azure support. Cheers! – Erick Ramirez Jul 29 '21 at 08:35