Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

567
Views
What is the proper way to stop hiveserver2?

I've installed hive 0.14 on top of hadoop 2.6.0.

The setup mainly involved just extracting the tar.bin file.

I followed this guide to do the setup.

http://www.ishaanguliani.com/content/hive-0140-setup-ubuntu

I start hiveserver2 with a command line:

( $HIVE_HOME/bin/hiveserver2 &> hiveserver.log & )

Now, I am wondering what is the proper to stop hiveserver2. I can kill it but I doubt that provides a graceful exit.

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

write a small shell script to find hiveserver2 process and stop it. I used below shell script to stop hiveserver2 and hive metastore process. Hope this helps.

hive2_pid=`pgrep -f org.apache.hive.service.server.HiveServer2`

    if [[ -n "$hive2_pid" ]]
    then
        echo "Found hivesevrer2 PID-- "$hive2_pid
        kill $hive2_pid
        # if process is still around, use kill -9
        if ps -p $hive2_pid > /dev/null ; then
            echo "Initial kill failed, killing with -9 "
            kill -9 $hive2_pid
        fi
    echo "Hive server2 stopped successfully"
    else
        echo "Hiveserver2 process not found , HIveserver2 is not running !!!"
    fi

    meta_pid=`pgrep -f org.apache.hadoop.hive.metastore.HiveMetaStore`

    if [[ -n "$meta_pid" ]]
    then
        echo "Found hivesevrer2 PID-- "$meta_pid
        kill $meta_pid
        # if process is still around, use kill -9
        if ps -p $meta_pid > /dev/null ; then
            echo "Initial kill failed, killing with -9 "
            kill -9 $meta_pid
        fi
    echo "Hive metastore stopped successfully"
    else
        echo "Hive metastore process not found , Hive metastore is not running !!!"
    fi
over 4 years ago · Santiago Trujillo Report

0

$ sudo service hive-server2 stop 

refer this link : http://www.cloudera.com/documentation/archive/cdh/4-x/4-2-0/CDH4-Installation-Guide/cdh4ig_topic_18_8.html

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!