blob: d154a5289f27174e7bde1fc350fe7527c3eafc4c [file] [log] [blame]
---
title: hawq stop
---
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
Stops or restarts a HAWQ system.
## <a id="topic1__section2"></a>Synopsis
``` pre
hawq stop <object> [-a | --prompt]
[-M (smart|fast|immediate) | --mode (smart|fast|immediate)]
[-t <timeout_seconds> | --timeout <timeout_seconds>]
[-l <logfile_directory> | --logdir <logfile_directory>]
[(-v | --verbose) | (-q | --quiet)]
hawq stop [-? | -h | --help]
```
## <a id="topic1__section3"></a>Description
The `hawq stop` utility is used to stop the database servers that comprise a HAWQ system. When you stop a HAWQ system, you are actually stopping several `postgres` database server processes at once (the master and all of the segment instances). The `hawq stop` utility handles the shutdown of the individual instances. Each instance is shut down in parallel.
By default, you are not allowed to shut down HAWQ if there are any client connections to the database. Use the `-M fast` option to roll back all in progress transactions and terminate any connections before shutting down. If there are any transactions in progress, the default behavior is to wait for them to commit before shutting down.
With the `-u` option, the utility uploads changes made to the master `pg_hba.conf` file or to *runtime* configuration parameters in the master `hawq-site.xml` file without interruption of service. Note that any active sessions will not pick up the changes until they reconnect to the database.
If the HAWQ cluster has active connections, use the command `hawq stop cluster -u -M fast` to ensure that changes to the parameters are reloaded.
## Objects
<dt>cluster </dt>
<dd>Stop a HAWQ cluster.</dd>
<dt>master </dt>
<dd>Shuts down a HAWQ master instance that was started in maintenance mode.</dd>
<dt>segment </dt>
<dd>Stop a local segment node.</dd>
<dt>standby </dt>
<dd>Stop the HAWQ standby master process.</dd>
<dt>allsegments </dt>
<dd>Stop all segments.</dd>
## <a id="topic1__section4"></a>Options
<dt>-a, -\\\-prompt </dt>
<dd>Do not prompt the user for confirmation before executing.</dd>
<dt>-l, -\\\-logdir \<logfile\_directory\> </dt>
<dd>The directory to write the log file. The default is `~/hawqAdminLogs/`.</dd>
<dt>-M, -\\\-mode (smart | fast | immediate) </dt>
<dd>Smart shutdown is the default. Shutdown fails with a warning message, if active connections are found.
Fast shut down interrupts and rolls back any transactions currently in progress .
Immediate shutdown aborts transactions in progress and kills all `postgres` processes without allowing the database server to complete transaction processing or clean up any temporary or in-process work files. Because of this, immediate shutdown is not recommended. In some instances, it can cause database corruption that requires manual recovery.</dd>
<dt>-q, -\\\-quiet </dt>
<dd>Run in quiet mode. Command output is not displayed on the screen, but is still written to the log file.</dd>
<dt>-t, -\\\-timeout \<timeout\_seconds\> </dt>
<dd>Specifies a timeout threshold (in seconds) to wait for a segment instance to shutdown. If a segment instance does not shut down in the specified number of seconds, `hawq stop` displays a message indicating that one or more segments are still in the process of shutting down and that you cannot restart HAWQ until the segment instance(s) are stopped. This option is useful in situations where `hawq stop` is executed and there are very large transactions that need to rollback. These large transactions can take over a minute to rollback and surpass the default timeout period of 600 seconds.</dd>
<dt>-u, -\\\-reload </dt>
<dd>This option reloads configuration parameter values without restarting the HAWQ cluster.</dd>
<dt>-v, -\\\-verbose </dt>
<dd>Displays detailed status, progress and error messages output by the utility.</dd>
<dt>-?, -h, -\\\-help (help) </dt>
<dd>Displays the online help.</dd>
## <a id="topic1__section5"></a>Examples
Stop a HAWQ system in smart mode:
``` shell
$ hawq stop cluster -M smart
```
Stop a HAWQ system in fast mode:
``` shell
$ hawq stop cluster -M fast
```
Stop a master instance that was started in maintenance mode:
``` shell
$ hawq stop master -m
```
Reload the `hawq-site.xml` and `pg_hba.conf` files after making configuration changes but do not shutdown the HAWQ array:
``` shell
$ hawq stop cluster -u
```
## <a id="topic1__section6"></a>See Also
[hawq start](hawqstart.html#topic1)