Created 01-08-2017 07:46 PM
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
Created 01-08-2017 07:51 PM
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
Created 01-08-2017 07:51 PM
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 ~]#
Created 01-08-2017 07:51 PM
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
Created 01-08-2017 08:04 PM
Killing the process(es) helped. Thanks!
Created 02-17-2017 05:16 PM
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.