3

I am trying to connect to AWS Managed Cassandra using Perl. It's not working due to a vague error Error 0: Internal Server Error.

Using the DBD::Cassandra Library, I can connect to self hosted Cassandra clusters, but not AWS Cassandra. I think I have the AWS Root CA correct because it verifies with openssl s_client -connect cassandra.us-east-1.amazonaws.com:9142

DBI->connect("dbi:Cassandra:host=cassandra.us-east-1.amazonaws.com;port=9142;tls=1;keyspace=keyspace",
 "**username**", "**password**");

The error response from the connection is

Unable to connect to any Cassandra server. 
  Last error: On cassandra.us-east-1.amazonaws.com: 
  Error 0: Internal Server Error

I can also connect using the cqlsh client and verified that the connection details are correct.

Any hints or a working example would be very helpful.

Community
  • 1
  • 1
Steve E.
  • 9,003
  • 6
  • 39
  • 57

1 Answers1

0

The issue appears to be setting the keyspace. Doing this either on the connection or subsequently with use keyspace results in a Error 0: Internal Server Error response from the server.

Also note that AWS Managed Cassandra only supports consistency local_quorum. The following will result in a valid connection:

DBI->connect("dbi:Cassandra:host=cassandra.us-east-1.amazonaws.com;
   port=9142;tls=1;consistency=local_quorum",
   "**username**", "**password**");

Since there are issues setting the keyspace, tables must be referenced using keyspace.tablename in queries.

Steve E.
  • 9,003
  • 6
  • 39
  • 57