markdown/reference/cli/admin_utilities/hawqrestart.html.md.erb (72 lines of code) (raw):
---
title: hawq restart
---
<!--
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.
-->
Shuts down and then restarts a HAWQ system after shutdown is complete.
## <a id="topic1__section2"></a>Synopsis
``` pre
hawq restart <object> [-l|--logdir <logfile_directory>] [-q|--quiet] [-v|--verbose]
[-M|--mode smart | fast | immediate] [-u|--reload] [-m|--masteronly] [-R|--restrict]
[-t|--timeout <timeout_seconds>] [-U | --special-mode maintenance]
[--ignore-bad-hosts cluster | allsegments]
```
``` pre
hawq restart -? | -h | --help
hawq restart --version
```
## <a id="topic1__section3"></a>Description
The `hawq restart` utility is used to shut down and restart the HAWQ server processes. It is essentially equivalent to performing a `hawq stop -M smart` operation followed by `hawq start`.
The \<object\> in the command specifies what entity should be started: e.g. a cluster, a segment, the master node, standby node, or all segments in the cluster.
When the `hawq restart` command runs, the utility uploads changes made to the master `pg_hba.conf` file or to the 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.
## Objects
<dt>cluster </dt>
<dd>Restart a HAWQ cluster.</dd>
<dt>master </dt>
<dd>Restart HAWQ master.</dd>
<dt>segment </dt>
<dd>Restart a local segment node.</dd>
<dt>standby </dt>
<dd>Restart a HAWQ standby.</dd>
<dt>allsegments </dt>
<dd>Restart all segments.</dd>
## <a id="topic1__section4"></a>Options
<dt>-a (do not prompt) </dt>
<dd>Do not prompt the user for confirmation.</dd>
<dt>-l, -\\\-logdir \<logfile\_directory\> </dt>
<dd>Specifies the log directory for logs of the management tools. The default is `~/hawqAdminLogs/`.</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>-v, -\\\-verbose </dt>
<dd>Displays detailed status, progress and error messages output by the utility.</dd>
<dt>-t, -\\\-timeout \<timeout\_seconds\> </dt>
<dd>Specifies a timeout in seconds to wait for a segment instance to start up. If a segment instance was shutdown abnormally (due to power failure or killing its `postgres` database listener process, for example), it may take longer to start up due to the database recovery and validation process. If not specified, the default timeout is 600 seconds.</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>-u, -\\\-reload </dt>
<dd>Utility mode. This mode runs on the master, only, and only allows incoming sessions that specify gp\_session\_role=utility. It allows bash scripts to reload the parameter values and connect but protects the system from normal clients who might be trying to connect to the system during startup.</dd>
<dt>-R, -\\\-restrict </dt>
<dd>Starts HAWQ in restricted mode (only database superusers are allowed to connect).</dd>
<dt>-U, -\\\-special-mode maintenance </dt>
<dd>(Superuser only) Start HAWQ in \[maintenance | upgrade\] mode. In maintenance mode, the `gp_maintenance_conn` parameter is set.</dd>
<dt>-\\\-ignore\-bad\-hosts cluster | allsegments </dt>
<dd>Overrides copying configuration files to a host on which SSH validation fails. If ssh to a skipped host is reestablished, make sure the configuration files are re-synched once it is reachable.</dd>
<dt>-? , -h , -\\\-help (help) </dt>
<dd>Displays the online help.</dd>
<dt>-\\\-version (show utility version) </dt>
<dd>Displays the version of this utility.</dd>
## <a id="topic1__section5"></a>Examples
Restart a HAWQ cluster:
``` shell
$ hawq restart cluster
```
Restart a HAWQ system in restricted mode (only allow superuser connections):
``` shell
$ hawq restart cluster -R
```
Start the HAWQ master instance only and connect in utility mode:
``` shell
$ hawq start master -m PGOPTIONS='-c gp_session_role=utility' psql
```
## <a id="topic1__section6"></a>See Also
[hawq stop](hawqstop.html#topic1), [hawq start](hawqstart.html#topic1)