I am able to connect to aws keyspace using ap-south-1 but when I change it to us-east-2 it says "NoHostAvailable('Unable to connect to any servers', {'3.12.23.133:9142': OperationTimedOut('errors=None, last_host=None')})"
I am using python for connection
if __name__ == '__main__':
sUsername = '******-at-43*****6380240297'
sPassword = '********'
sUrl = 'cassandra.us-east-2.amazonaws.com'
sSSLCertPath = 'C:\\Users\\KArora\\Downloads\\sf-class2-root.crt'
sPort = 9142
session = getDBClient(sUrl, sUsername, sPassword, sPort, sSSLCertPath)
def getDBClient(sURL, sUserName, sPassword, sPort, sSSLCertPath):
error = ""
try:
ssl_context = SSLContext(PROTOCOL_TLSv1_2)
ssl_context.load_verify_locations(sSSLCertPath)
ssl_context.verify_mode = CERT_REQUIRED
auth_provider = PlainTextAuthProvider(username=sUserName, password=sPassword)
sConn = []
sConn.append(sURL)
cluster = Cluster(sConn, ssl_context=ssl_context, auth_provider=auth_provider, port=sPort)
session = cluster.connect()
#error += "Success"
return session
except Exception as e:
#error += "Failure"
return str(e)