1

I have set up a Cassandra (3.11.10) cluster with 3 nodes on 3 AWS EC2 instances with identical hardware configuration in the same internal network recently. Each of them sees each other. By logging into each of them, you can get access to the tables in the Cassandra database. It works well with cqlsh, everything seems perfect.

Instance Type: t3.medium.

Amazon Machine Image (AMI): CentOS 8 (x86_64) - with Updates HVM.

By the way, I used instructions from this article in each EC2 instance to set up Cassandra.

My configurion file (/etc/cassandra/default.conf/cassandra.yaml) looks like this:

seeds: "node1_public_ip_address, node2_public_ip_address, node3_public_ip_address"
listen_address: "node_private_ip_address"
broadcast_address: "node_public_ip_address"
start_rpc: true
rpc_address: 0.0.0.0  # default value: localhost.
broadcast_rpc_address: "node_private_ip_address"  # default value: 1.2.3.4
endpoint_snitch: SimpleSnitch  # I also tried Ec2Snitch, but it raise problems.

After these settings, I noticed that the connection process to the database takes a very long time (it takes more than 5 seconds). I tried to connect to the Cassandra database via SQL client called DBeaver which use Cassandra Java Driver 3.5.5. I also tried to connect to the Cassandra database from AWS Lambda functions which was written in Python. So in the last case, I used the official Datastax Python Driver.

QUESTION: What is the reason for this strange behavior and how can it be improved?

Nurzhan Nogerbek
  • 4,806
  • 16
  • 87
  • 193
  • where is your application running - on AWS near servers, or from on-premise? – Alex Ott May 11 '21 at 07:37
  • The `Cassandra` database (three `EC2` instances) and `AWS Lambda` functions in the same region. AWS Lambda functions work like a black box. They run on request and die if not used. In fact, the database and the application that is trying to connect to it are located on different servers. – Nurzhan Nogerbek May 11 '21 at 08:53
  • I'm facing the same problem. It takes 5.9s to connect to a local Cassandra instance! – Esmailian Aug 01 '21 at 01:14

0 Answers0