Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

How to get number of live connections with HiveServer2 (HDP 2.2.4)

Solved Go to solution
Highlighted

How to get number of live connections with HiveServer2 (HDP 2.2.4)

Expert Contributor

HiveServer2 hangs silently, need to check how many live connections are on HS2, how can this be done ?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: How to get number of live connections with HiveServer2 (HDP 2.2.4)

on the host where hs2 is running do

lsof -i:10000|grep 'ESTABLISHED'|wc -l

View solution in original post

4 REPLIES 4
Highlighted

Re: How to get number of live connections with HiveServer2 (HDP 2.2.4)

on the host where hs2 is running do

lsof -i:10000|grep 'ESTABLISHED'|wc -l

View solution in original post

Highlighted

Re: How to get number of live connections with HiveServer2 (HDP 2.2.4)

Expert Contributor

Thanks @Rajkumar Singh thats works ... probably a wrong question from my end ... but was looking for live "sessions" on HS2 and if possible users

Highlighted

Re: How to get number of live connections with HiveServer2 (HDP 2.2.4)

@nyakkanti

I think there is no direct way to do this but you can try to grep some log text.

or

take a heap dump of hiveserver2 and use object query language ( SELECT toString(s.username) FROM INSTANCEOF org.apache.hive.service.cli.session.HiveSessionImpl s ) to know live sessions at that moment. to run object query language you can use jvisualvm or Eclipse MAT.

Re: How to get number of live connections with HiveServer2 (HDP 2.2.4)

Contributor

By connecting to web ui over port 10002 one could check the number of live sessions on that instance of hiveserver

Don't have an account?
Coming from Hortonworks? Activate your account here