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 stop HAWQ segment from the terminal?

Solved Go to solution
Highlighted

How to stop HAWQ segment from the terminal?

New Contributor

I am trying to restart the HAWQ service using Ambari. However, for some reason the segments are not Stopping and the operation is timing out after 600 seconds. Is there a way to stop the segments and/or restart them from the terminal?

I am using HDP 2.4.2 and HAWQ 2.0.1

1 ACCEPTED SOLUTION

Accepted Solutions

Re: How to stop HAWQ segment from the terminal?

New Contributor

Hi Piyush ,

You can login to the hawq segment server and can stop the segment with the following

ssh hawq-segment

su - gpadmin

source /usr/local/hawq/greenplum_path.sh

hawq stop segment

If it still not getting stopped ,look for the orphan segment process in the server and manually kill it (ps -ef|grep postgres ) .It would be good to the check segment logs in the server for the details .

Thanks

Pratheesh Nair

4 REPLIES 4

Re: How to stop HAWQ segment from the terminal?

New Contributor

waiting for server to shut down........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................... failed 20170108:19:26:51:311785 hawq_stop:datanode01-dev:gpadmin-[INFO]:-pg_ctl: server does not shut down 20170108:19:26:51:311785 hawq_stop:datanode01-dev:gpadmin-[ERROR]:-Segment stop failed, exit 20170108:19:36:55:313713 hawq_stop:datanode01-dev:gpadmin-[INFO]:-Prepare to do 'hawq stop' 20170108:19:36:55:313713 hawq_stop:datanode01-dev:gpadmin-[INFO]:-You can find log in: 20170108:19:36:55:313713 hawq_stop:datanode01-dev:gpadmin-[INFO]:-/home/gpadmin/hawqAdminLogs/hawq_stop_20170108.log 20170108:19:36:55:313713 hawq_stop:datanode01-dev:gpadmin-[INFO]:-GPHOME is set to: 20170108:19:36:55:313713 hawq_stop:datanode01-dev:gpadmin-[INFO]:-/usr/local/hawq/. 20170108:19:36:55:313713 hawq_stop:datanode01-dev:gpadmin-[DEBUG]:-Current user is 'gpadmin' 20170108:19:36:55:313713 hawq_stop:datanode01-dev:gpadmin-[DEBUG]:-Parsing config file: 20170108:19:36:55:313713 hawq_stop:datanode01-dev:gpadmin-[DEBUG]:-/usr/local/hawq/./etc/hawq-site.xml 20170108:19:36:55:313713 hawq_stop:datanode01-dev:gpadmin-[INFO]:-Stop hawq with args: ['stop', 'segment'] 20170108:19:36:55:313713 hawq_stop:datanode01-dev:gpadmin-[INFO]:-Stop hawq segment waiting for server to shut down........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................... failed 20170108:19:46:56:313713 hawq_stop:datanode01-dev:gpadmin-[INFO]:-pg_ctl: server does not shut down 20170108:19:46:56:313713 hawq_stop:datanode01-dev:gpadmin-[ERROR]:-Segment stop failed, exit 20170108:19:48:12:314792 hawq_stop:datanode01-dev:gpadmin-[INFO]:-Prepare to do 'hawq stop' 20170108:19:48:12:314792 hawq_stop:datanode01-dev:gpadmin-[INFO]:-You can find log in: 20170108:19:48:12:314792 hawq_stop:datanode01-dev:gpadmin-[INFO]:-/home/gpadmin/hawqAdminLogs/hawq_stop_20170108.log 20170108:19:48:12:314792 hawq_stop:datanode01-dev:gpadmin-[INFO]:-GPHOME is set to: 20170108:19:48:12:314792 hawq_stop:datanode01-dev:gpadmin-[INFO]:-/usr/local/hawq/. 20170108:19:48:12:314792 hawq_stop:datanode01-dev:gpadmin-[DEBUG]:-Current user is 'gpadmin' 20170108:19:48:12:314792 hawq_stop:datanode01-dev:gpadmin-[DEBUG]:-Parsing config file: 20170108:19:48:12:314792 hawq_stop:datanode01-dev:gpadmin-[DEBUG]:-/usr/local/hawq/./etc/hawq-site.xml 20170108:19:48:12:314792 hawq_stop:datanode01-dev:gpadmin-[INFO]:-Stop hawq with args: ['stop', 'segment'] 20170108:19:48:12:314792 hawq_stop:datanode01-dev:gpadmin-[INFO]:-Stop hawq segment waiting for server to shut down..........................................20170108:19:48:51:314926 hawq_stop:datanode01-dev:gpadmin-[INFO]:-Prepare to do 'hawq stop' 20170108:19:48:51:314926 hawq_stop:datanode01-dev:gpadmin-[INFO]:-You can find log in: 20170108:19:48:51:314926 hawq_stop:datanode01-dev:gpadmin-[INFO]:-/home/gpadmin/hawqAdminLogs/hawq_stop_20170108.log 20170108:19:48:51:314926 hawq_stop:datanode01-dev:gpadmin-[INFO]:-GPHOME is set to: 20170108:19:48:51:314926 hawq_stop:datanode01-dev:gpadmin-[INFO]:-/usr/local/hawq/. 20170108:19:48:51:314926 hawq_stop:datanode01-dev:gpadmin-[INFO]:-Stop hawq with args: ['stop', 'segment'] .......20170108:19:48:58:314926 hawq_stop:datanode01-dev:gpadmin-[INFO]:-Stop hawq segment waiting for server to shut down........................................................................................................................................................................................[root@datanode01-dev ~]#

Re: How to stop HAWQ segment from the terminal?

New Contributor

Hi Piyush ,

You can login to the hawq segment server and can stop the segment with the following

ssh hawq-segment

su - gpadmin

source /usr/local/hawq/greenplum_path.sh

hawq stop segment

If it still not getting stopped ,look for the orphan segment process in the server and manually kill it (ps -ef|grep postgres ) .It would be good to the check segment logs in the server for the details .

Thanks

Pratheesh Nair

Re: How to stop HAWQ segment from the terminal?

New Contributor

Killing the process(es) helped. Thanks!

Re: How to stop HAWQ segment from the terminal?

New Contributor

Hi Piyush,

Additionally, you can try using the following commands:

hawq stop segment -M fast

If the above does not work stop with option "immediate" should kill the process for you:

hawq stop segment -M immediate

If you do not provide any option with -M the stop/shutdown uses "smart" mode which does not really kill anything if there is any active connection or query.

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