Skip to main content
Nil_kharat
Silver ⭐️⭐️
August 10, 2021
Solved

How many users connected to HiveServer2

Hi Folks,

Can anyone tell me how to check how many users are connected to the hive server2?

And  along with can we see which user is connected ?

Shifu
ShifuAnswer
Gold ⭐️⭐️
August 11, 2021

Hi @Nil_kharat 

 

Question: Can anyone tell me how to check how many users are connected to the hive server2?

Answer: Login to the server where hiveserver2 is running and run the below command to figure out the number of connections to the HS2

# netstat -ntpl | grep 10000
In the above command 10000 is the HS2 port number

You can also check this from Cloudera manager

CM > Hive_on_Tez > Instances > HiveServer2 > Open Connections


And along with can we see which user is connected?

If you enable Hiveserver2 UI then under Active Sessions you can see which user connected from which IP.
Please check the below link.
https://cwiki.apache.org/confluence/display/Hive/Setting+Up+HiveServer2#SettingUpHiveServer2-WebUIforHiveServer2

 

If you are happy with the answer, mark it Accept as solution

3 replies

Shifu
Gold ⭐️⭐️
ShifuAnswer
Gold ⭐️⭐️
August 11, 2021

Hi @Nil_kharat 

 

Question: Can anyone tell me how to check how many users are connected to the hive server2?

Answer: Login to the server where hiveserver2 is running and run the below command to figure out the number of connections to the HS2

# netstat -ntpl | grep 10000
In the above command 10000 is the HS2 port number

You can also check this from Cloudera manager

CM > Hive_on_Tez > Instances > HiveServer2 > Open Connections


And along with can we see which user is connected?

If you enable Hiveserver2 UI then under Active Sessions you can see which user connected from which IP.
Please check the below link.
https://cwiki.apache.org/confluence/display/Hive/Setting+Up+HiveServer2#SettingUpHiveServer2-WebUIforHiveServer2

 

If you are happy with the answer, mark it Accept as solution

Translate
Nil_kharat
Silver ⭐️⭐️
August 13, 2021

Thank you so much @Shifu 

can we have these command also

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

Translate
Shifu
Gold ⭐️⭐️
Gold ⭐️⭐️
August 15, 2021

Hi @Nil_kharat 

 

Yes, you can also use the particular lsof command as well to figure out the number of established connections to the particular port. 

Translate