Re: Connections info

2018-10-05 Thread Abdul Patel
Thanks will try both options

On Friday, October 5, 2018, Alain RODRIGUEZ  wrote:

> Hello Abdul,
>
> I was caught by a different topic while answering, sending the message
> over, even though it's similar to Romain's solution.
>
> There is the metric mentioned above, or to have more details such as the
> app node IP, you can use:
>
> $ sudo netstat -tupawn | grep 9042 | grep ESTABLISHED
>
> tcp0  0 ::::*9042*   :::*
>   LISTEN  -
>
> tcp0  0 ::::*9042*   ::::51486
> ESTABLISHED -
>
> tcp0  0 ::::*9042*   ::::37624
> ESTABLISHED -
> [...]
>
> tcp0  0 ::::*9042*   ::::49108
> ESTABLISHED -
>
> or to count them:
>
> $ sudo netstat -tupawn | grep 9042 | grep ESTABLISHED | wc -l
>
> 113
>
> I'm not sure about the '-tupawn' options, it gives me the format I need
> and I never wondered much about it I must say. Maybe some of the options
> are useless.
>
> Sending this command through ssh would allow you to gather the information
> in one place. You can also run similar commands on the clients (Apps) toI
> hope that helps.
>
> C*heers
> ---
> Alain Rodriguez - @arodream - al...@thelastpickle.com
> France / Spain
>
> The Last Pickle - Apache Cassandra Consulting
> http://www.thelastpickle.com
>
> Le ven. 5 oct. 2018 à 06:28, Max C.  a écrit :
>
>> Looks like the number of connections is available in JMX as:
>>
>> org.apache.cassandra.metrics:type=Client,name=connectedNativeClients
>>
>> http://cassandra.apache.org/doc/4.0/operating/metrics.html
>>
>> "Number of clients connected to this nodes native protocol server”
>>
>> As for where they’re coming from — I’m not sure how to get that from
>> JMX.  Maybe you’ll have to use “lsof” or something to get that.
>>
>> - Max
>>
>> On Oct 4, 2018, at 8:57 pm, Abdul Patel  wrote:
>>
>> Hi All,
>>
>> Can we get number of users connected to each node in cassandra?
>> Also can we get from whixh app node they are connecting from?
>>
>>
>>


Re: Connections info

2018-10-05 Thread Alain RODRIGUEZ
Hello Abdul,

I was caught by a different topic while answering, sending the message
over, even though it's similar to Romain's solution.

There is the metric mentioned above, or to have more details such as the
app node IP, you can use:

$ sudo netstat -tupawn | grep 9042 | grep ESTABLISHED

tcp0  0 ::::*9042*   :::*
LISTEN  -

tcp0  0 ::::*9042*
::::51486  ESTABLISHED
-

tcp0  0 ::::*9042*
::::37624  ESTABLISHED
-
[...]

tcp0  0 ::::*9042*
::::49108  ESTABLISHED
-

or to count them:

$ sudo netstat -tupawn | grep 9042 | grep ESTABLISHED | wc -l

113

I'm not sure about the '-tupawn' options, it gives me the format I need and
I never wondered much about it I must say. Maybe some of the options are
useless.

Sending this command through ssh would allow you to gather the information
in one place. You can also run similar commands on the clients (Apps) toI
hope that helps.

C*heers
---
Alain Rodriguez - @arodream - al...@thelastpickle.com
France / Spain

The Last Pickle - Apache Cassandra Consulting
http://www.thelastpickle.com

Le ven. 5 oct. 2018 à 06:28, Max C.  a écrit :

> Looks like the number of connections is available in JMX as:
>
> org.apache.cassandra.metrics:type=Client,name=connectedNativeClients
>
> http://cassandra.apache.org/doc/4.0/operating/metrics.html
>
> "Number of clients connected to this nodes native protocol server”
>
> As for where they’re coming from — I’m not sure how to get that from JMX.
> Maybe you’ll have to use “lsof” or something to get that.
>
> - Max
>
> On Oct 4, 2018, at 8:57 pm, Abdul Patel  wrote:
>
> Hi All,
>
> Can we get number of users connected to each node in cassandra?
> Also can we get from whixh app node they are connecting from?
>
>
>


Re: Connections info

2018-10-05 Thread Romain Hardouin
 Note that one "user"/application can open multiple connections. You have also 
the number of Thrift connections available in JMX if you run a legacy 
application.
Max is right, regarding where they're come from you can use lsof. For instance 
on AWS - but you can adapt it for your needs:
IP=...REGION=...
ssh $IP "sudo lsof -i -n | grep 9042 | grep -Po '(?<=->)[^:]+' | sort -u" | 
xargs -P 20 -I '{}' aws --output json --region $REGION ec2 describe-instances 
--filter Name=private-ip-address,Values={} --query 
'Reservations[].Instances[*].Tags[*]' | jq '.[0][0] | map(select(.Key == 
"Name")) | .[0].Value' | sort | uniq -c
You'll have number of instances grouped by AWS name :      3 "name_ABC"     15 
"name_example"     37 "name_test"
Best,Romain
Le vendredi 5 octobre 2018 à 06:28:51 UTC+2, Max C. 
 a écrit :  
 
 Looks like the number of connections is available in JMX as:
org.apache.cassandra.metrics:type=Client,name=connectedNativeClients
http://cassandra.apache.org/doc/4.0/operating/metrics.html
"Number of clients connected to this nodes native protocol server”
As for where they’re coming from — I’m not sure how to get that from JMX.  
Maybe you’ll have to use “lsof” or something to get that. 
- Max


On Oct 4, 2018, at 8:57 pm, Abdul Patel  wrote:
Hi All,
Can we get number of users connected to each node in cassandra?Also can we get 
from whixh app node they are connecting from?

  

Re: Connections info

2018-10-04 Thread Max C.
Looks like the number of connections is available in JMX as:

org.apache.cassandra.metrics:type=Client,name=connectedNativeClients

http://cassandra.apache.org/doc/4.0/operating/metrics.html 


"Number of clients connected to this nodes native protocol server”

As for where they’re coming from — I’m not sure how to get that from JMX.  
Maybe you’ll have to use “lsof” or something to get that. 

- Max

> On Oct 4, 2018, at 8:57 pm, Abdul Patel  wrote:
> 
> Hi All,
> 
> Can we get number of users connected to each node in cassandra?
> Also can we get from whixh app node they are connecting from?



Connections info

2018-10-04 Thread Abdul Patel
Hi All,

Can we get number of users connected to each node in cassandra?
Also can we get from whixh app node they are connecting from?