Skip to main content
bulbcat
Silver ⭐️⭐️⭐️
Jan 9, 2024 6:33 AM UTC
Solved

How to kill a connect on hiveserver2 which does not submit to yarn ?

As an admin of a CDH cluster , 

some query has submitted  to the hiveserver2 ,  but the query still  in the hiveserver make the explain stage , which does not submit to the yarn cluster and has no application id on yarn . And the query make the hiveserver2 wrong  which  has a too long query such as 

select * from aaa where code in ('xxx','xxx1','xxx3',.......'xxx2000000') ;

A sql has more than milion row  may make the hiveserver2 corrupt . 

 

The 10002 web page  seems does not have some action button like yarn web the deal with the query .

 

The cdh version is 6.3.2 . hive version 2.1.1 .

When this situation occur , I have to restart the hiveserver2 .

I want to know if there is some way to kill a query through hive queryid or hive sessionid o instead of yarn applicationid .

 

It is also usefull when someone query the metastore which multithread such as "use hadoop " sql with 30 or more active connect  ,  The adminastritor has the ability to kill them forcely . 

 

smruti
smrutiAnswer
Gold ⭐️⭐️⭐️
Jan 16, 2024 3:49 PM UTC

@bulbcat Hive has a KILL QUERY <queryId> command to achieve what you requested here. The feature got added through the following upstream Jiras HIVE-17483, HIVE-20549

But this command is not present in the Hive version you mentioned above. It got added in Hive 3.0, which is available in Cloudera CDP clusters.

2 replies

smruti
Gold ⭐️⭐️⭐️
smrutiAnswer
Gold ⭐️⭐️⭐️
Jan 16, 2024 3:49 PM UTC

@bulbcat Hive has a KILL QUERY <queryId> command to achieve what you requested here. The feature got added through the following upstream Jiras HIVE-17483, HIVE-20549

But this command is not present in the Hive version you mentioned above. It got added in Hive 3.0, which is available in Cloudera CDP clusters.

Translate
bulbcat
bulbcatAuthor
Silver ⭐️⭐️⭐️
Jan 19, 2024 6:04 AM UTC

Much Thanks . 

Translate