Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to know Native Clients connected to Cassandra

I am able to see 160 Native clients on a particular node from OpsCenter. But none of the application is pointing to this DC or any of the nodes from this DC.

If above is the situtation what are those 160 Native clients?

  • Few of them are because I have connected to that node using DevCenter.
  • Rest can be because of Inter DC communication??
  • No keyspace has RF set also for this DC. I am about to decommission this DC.

OpsCenter Native Clients

But not sure what are those clients.

Any idea??

like image 905
Anil Kapoor Avatar asked Jan 16 '19 07:01

Anil Kapoor


People also ask

How do I see how many connections I have in Cassandra?

In a future release of Apache Cassandra (4.0+) and DSE (likely 7.0+), there will be a nodetool clientstats command (CASSANDRA-14275), and a corresponding system_views. clients table (CASSANDRA-14458) that includes connection info. This will include the driver name, if the driver client provides one (newer ones do).

How do I check my Cassandra?

Check the status of the Cassandra nodes in your cluster - Go to the /<Install_Dir>/apache-cassandra/bin/ directory and type the ./nodetool status command. If the status for all the nodes shows as UN , then the nodes are up and running. If the status for any node shows as DN , then that particular node is down.

How many connections can Cassandra handle?

For older Cassandra versions (1.2 and 2.0), the default amount of connections per host are: Local datacenter: two core connection per host, with eight connections as maximum if the simultaneous requests threshold is reached. Remote datacenter: one core connection per host (being two the maximum).

What is Cassandra client?

Apache Cassandra® is a free and open-source, distributed, wide column store, NoSQL database management system designed to handle large amounts of data across many commodity servers, providing high availability with no single point of failure.


2 Answers

In latest versions you can use nodetool clientlist or select * from system_views.clients ; in cqlsh to view the actual connections. This will give you the host and port which you can then track on the system what application is bound to it.

In older DSE versions you can also use dsetool perf userlatencytracking [enable|disable] to enable the userlatency tracking to do something similar with select * from dse_perf.user_io;.

like image 194
Chris Lohfink Avatar answered Sep 23 '22 16:09

Chris Lohfink


I have used below command to find connecting clients:

sudo lsof -i -n -P | grep 9042 | grep ESTABLISHED

By running above, I found processes & those processes were all the java applications connecting to Cassandra. But I have not mentioned any of these hosts in connection, still requests were coming on them.

I found all those requests were because of Consistency Level: QUORUM by client applications. Although applications are not referring to those DCs directly but to achieve QUORUM requests were going on all DCs.

1 more thing was there: Java client aplications were using username(superuser) 'cassandra', this also need consistency level QUORUM.

Inter DC communication does not happen on 9042, so my assumption of some connections from Inter DC was also not correct.

Above was solution to my problem.

like image 25
Anil Kapoor Avatar answered Sep 21 '22 16:09

Anil Kapoor