Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

How to stop HAWQ segment from the terminal?

avatar
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

avatar

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

View solution in original post

4 REPLIES 4

avatar
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 ~]#

avatar

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

avatar
Contributor

Killing the process(es) helped. Thanks!

avatar
New Member

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.