Skip to content
Permalink
Browse files
ensure all hawq stop -u references include <object>
  • Loading branch information
lisakowen committed Nov 4, 2016
1 parent ab91612 commit bef3b00c463cfde5318933cb42c852443ea94b2f
Showing 6 changed files with 43 additions and 35 deletions.
@@ -6,9 +6,9 @@ In a HAWQ DBMS, the database server instances \(the master and all segments\) ar

Because a HAWQ system is distributed across many machines, the process for starting and stopping a HAWQ system is different than the process for starting and stopping a regular PostgreSQL DBMS.

Use the `hawq start `*`object`* and `hawq stop `*`object`* commands to start and stop HAWQ, respectively. These management tools are located in the $GPHOME/bin directory on your HAWQ master host.
Use the `hawq start `*`object`* and `hawq stop `*`object`* commands to start and stop HAWQ, respectively. These management tools are located in the `$GPHOME/bin` directory on your HAWQ master host.

Initializing a HAWQ system also starts it.
Initializing a HAWQ system also starts the system.

**Important:**

@@ -32,7 +32,7 @@ Use the `hawq start cluster` command to start a HAWQ system that has already bee

Stop the HAWQ system and then restart it.

The `hawq restart` command with the appropriate cluster or node command can stop and then restart HAWQ after the shutdown completes. If the master or segments are already stopped, restart will have no effect.
The `hawq restart` command with the appropriate `cluster` or node-type option will stop and then restart HAWQ after the shutdown completes. If the master or segments are already stopped, restart will have no effect.

- To restart a HAWQ cluster, enter the following command on the master host:

@@ -45,22 +45,28 @@ The `hawq restart` command with the appropriate cluster or node command can stop

Reload changes to the HAWQ configuration files without interrupting the system.

The `hawq stop` command can reload changes to the pg\_hba.conf configuration file and to *runtime* parameters in the hawq-site.xml file and pg\_hba.conf file without service interruption. Active sessions pick up changes when they reconnect to the database. Many server configuration parameters require a full system restart \(`hawq restart cluster`\) to activate. For information about server configuration parameters, see the [Server Configuration Parameter Reference](../reference/guc/guc_config.html).
The `hawq stop` command can reload changes to the `pg_hba.conf `configuration file and to *runtime* parameters in the `hawq-site.xml` and `pg_hba.conf` files without service interruption. Active sessions pick up changes when they reconnect to the database. Many server configuration parameters require a full system restart \(`hawq restart cluster`\) to activate. For information about server configuration parameters, see the [Server Configuration Parameter Reference](../reference/guc/guc_config.html).

- Reload configuration file changes without shutting down the system using the `hawq stop` command:

```shell
$ hawq stop --reload
$ hawq stop cluster --reload
```

Or:

```shell
$ hawq stop cluster -u
```


## <a id="task_maint_mode"></a>Starting the Master in Maintenance Mode

Start only the master to perform maintenance or administrative tasks without affecting data on the segments.

Maintenance mode is a superuser-only mode that should only be used when required for a particular maintenance task. For example, you can connect to a database only on the master instance in maintenance mode and edit system catalog settings.

1. Run `hawq start` using the master -m option:
1. Run `hawq start` on the `master` using the `-m` option:

```shell
$ hawq start master -m
@@ -79,7 +85,7 @@ Maintenance mode is a superuser-only mode that should only be used when required

**Warning:**

Incorrect use of maintenance mode connections can result in an inconsistent system state. Only expert users should perform this operation.
Incorrect use of maintenance mode connections can result in an inconsistent HAWQ system state. Only expert users should perform this operation.


## <a id="task_gpdb_stop"></a>Stopping HAWQ
@@ -118,23 +124,23 @@ For best results in using `hawq start` and `hawq stop` to manage your HAWQ syste
$ hawq stop cluster -M immediate
```

- Use `hawq stop master` to stop the master only. If you cannot stop the master due to running transactions, try using fast shutdown. If fast shutdown does not work, use immediate shutdown. Use immediate shutdown with caution, as it will result in a crash-recovery run when the system is restarted.
- Use `hawq stop master` to stop the master only. If you cannot stop the master due to running transactions, try using `fast` shutdown. If `fast` shutdown does not work, use `immediate` shutdown. Use `immediate` shutdown with caution, as it will result in a crash-recovery run when the system is restarted.

```shell
$ hawq stop master -M fast
$ hawq stop master -M immediate
```
- If you want to reload server parameter settings on a HAWQ database where there are active connections, use the command:
- If you have changed or want to reload server parameter settings on a HAWQ database where there are active connections, use the command:


```shell
$ hawq stop master -u -M fast
```

- When stopping a segment or all segments, you can use the default mode of smart mode. Using fast or immediate mode on segments will have no effect since segments are stateless.
- When stopping a segment or all segments, use `smart` mode, which is the default. Using `fast` or `immediate` mode on segments will have no effect since segments are stateless.

```shell
$ hawq stop segment
$ hawq stop allsegments
```
- Typically you should always use `hawq start cluster` or `hawq restart cluster` to start the cluster. If you do end up using `hawq start standby|master|segment` to start nodes individually, make sure you always start the standby before the active master. Otherwise, the standby can become unsynchronized with the active master.
- You should typically always use `hawq start cluster` or `hawq restart cluster` to start the cluster. If you do end up starting nodes individually with `hawq start standby|master|segment`, make sure to always start the standby *before* the active master. Otherwise, the standby can become unsynchronized with the active master.
@@ -13,13 +13,13 @@ See [The pg\_hba.conf File](http://www.postgresql.org/docs/9.0/interactive/auth-
The general format of the `pg_hba.conf` file is a set of records, one per line. HAWQ ignores blank lines and any text after the `#` comment character. A record consists of a number of fields that are separated by spaces and/or tabs. Fields can contain white space if the field value is quoted. Records cannot be continued across lines. Each remote client access record has the following format:

```
*host*   *database*   *role*   *CIDR-address*   *authentication-method*
host|hostssl|hostnossl   <database>   <role>   <CIDR-address>|<IP-address>,<IP-mask>   <authentication-method>
```

Each UNIX-domain socket access record has the following format:

```
*local*   *database*   *role*   *authentication-method*
local   <database>   <role>   <authentication-method>
```

The following table describes meaning of each field.
@@ -30,11 +30,11 @@ The following table describes meaning of each field.
|host|Matches connection attempts made using TCP/IP. Remote TCP/IP connections will not be possible unless the server is started with an appropriate value for the listen\_addresses server configuration parameter.|
|hostssl|Matches connection attempts made using TCP/IP, but only when the connection is made with SSL encryption. SSL must be enabled at server start time by setting the ssl configuration parameter|
|hostnossl|Matches connection attempts made over TCP/IP that do not use SSL.|
|database|Specifies which database names this record matches. The value `all` specifies that it matches all databases. Multiple database names can be supplied by separating them with commas. A separate file containing database names can be specified by preceding the file name with @.|
|role|Specifies which database role names this record matches. The value `all` specifies that it matches all roles. If the specified role is a group and you want all members of that group to be included, precede the role name with a +. Multiple role names can be supplied by separating them with commas. A separate file containing role names can be specified by preceding the file name with @.|
|CIDR-address|Specifies the client machine IP address range that this record matches. It contains an IP address in standard dotted decimal notation and a CIDR mask length. IP addresses can only be specified numerically, not as domain or host names. The mask length indicates the number of high-order bits of the client IP address that must match. Bits to the right of this must be zero in the given IP address. There must not be any white space between the IP address, the /, and the CIDR mask length. Typical examples of a CIDR-address are 192.0.2.0/32 for a single host, or 192.0.2.2/24 for a small network, or 192.0.2.3/16 for a larger one. To specify a single host, use a CIDR mask of 32 for IPv4 or 128 for IPv6. In a network address, do not omit trailing zeroes.|
|IP-address, IP-mask|These fields can be used as an alternative to the CIDR-address notation. Instead of specifying the mask length, the actual mask is specified in a separate column. For example, 255.255.255.255 represents a CIDR mask length of 32. These fields only apply to host, hostssl, and hostnossl records.|
|authentication-method|Specifies the authentication method to use when connecting. HAWQ supports the [authentication methods](http://www.postgresql.org/docs/9.0/static/auth-methods.html) supported by PostgreSQL 9.0.|
|\<database\>|Specifies which database names this record matches. The value `all` specifies that it matches all databases. Multiple database names can be supplied by separating them with commas. A separate file containing database names can be specified by preceding the file name with @.|
|\<role\>|Specifies which database role names this record matches. The value `all` specifies that it matches all roles. If the specified role is a group and you want all members of that group to be included, precede the role name with a +. Multiple role names can be supplied by separating them with commas. A separate file containing role names can be specified by preceding the file name with @.|
|\<CIDR-address\>|Specifies the client machine IP address range that this record matches. It contains an IP address in standard dotted decimal notation and a CIDR mask length. IP addresses can only be specified numerically, not as domain or host names. The mask length indicates the number of high-order bits of the client IP address that must match. Bits to the right of this must be zero in the given IP address. There must not be any white space between the IP address, the /, and the CIDR mask length. Typical examples of a CIDR-address are 192.0.2.0/32 for a single host, or 192.0.2.2/24 for a small network, or 192.0.2.3/16 for a larger one. To specify a single host, use a CIDR mask of 32 for IPv4 or 128 for IPv6. In a network address, do not omit trailing zeroes.|
|\<IP-address\>, \<IP-mask\>|These fields can be used as an alternative to the CIDR-address notation. Instead of specifying the mask length, the actual mask is specified in a separate column. For example, 255.255.255.255 represents a CIDR mask length of 32. These fields only apply to host, hostssl, and hostnossl records.|
|\<authentication-method\>|Specifies the authentication method to use when connecting. HAWQ supports the [authentication methods](http://www.postgresql.org/docs/9.0/static/auth-methods.html) supported by PostgreSQL 9.0.|

### <a id="topic3"></a>Editing the pg\_hba.conf File

@@ -44,7 +44,7 @@ This example shows how to edit the `pg_hba.conf` file of the master to allow rem

#### <a id="ip144328"></a>Editing pg\_hba.conf

1. Obtain the master data directory from the `hawq_master_directory` property value in `hawq-site.xml` and use a text editor to open the `pg_hba.conf` file in this directory.
1. Obtain the master data directory location from the `hawq_master_directory` property value in `hawq-site.xml` and use a text editor to open the `pg_hba.conf` file in this directory.
2. Add a line to the file for each type of connection you want to allow. Records are read sequentially, so the order of the records is significant. Typically, earlier records will have tight connection match parameters and weaker authentication methods, while later records will have looser match parameters and stronger authentication methods. For example:

```
@@ -68,11 +68,12 @@ This example shows how to edit the `pg_hba.conf` file of the master to allow rem
```

3. Save and close the file.
4. Reload the `pg_hba.conf `configuration file for your changes to take effect:
4. Reload the `pg_hba.conf `configuration file for your changes to take effect. Include the `-M fast` option if you have active/open database connections:

``` bash
$ hawq stop -u
$ hawq stop cluster -u [-M fast]
```



## <a id="topic4"></a>Limiting Concurrent Connections
@@ -111,17 +112,17 @@ The following steps set the parameter values with the HAWQ utility `hawq config`
$ hawq config -c max_connections -v 100
```

This configuration command sets the value on the master.
This configuration command sets the value for the master.

3. Set the value of the `seg_max_connections` parameter. This `hawq config` command sets the value to 6400 on all HAWQ instances.

``` bash
$ hawq config -c seg_max_connections -v 6400
```

This configuration command sets the value on all segment instances.
This configuration command sets the value for all segment instances.

4. Set the value of the `max_prepared_transactions` parameter. This `hawq config` command sets the value to 200 on the master and all segments.
4. Set the value of the `max_prepared_transactions` parameter. This `hawq config` command sets the value to 200 for the master and all segments.

``` bash
$ hawq config -c max_prepared_transactions -v 200
@@ -143,15 +144,15 @@ The following steps set the parameter values with the HAWQ utility `hawq config`
```


**Note:** Raising the values of these parameters may cause HAWQ to request more shared memory. To mitigate this effect, consider decreasing other memory-related parameters such as `gp_cached_segworkers_threshold`.
**Note:** Raising the values of these parameters may cause HAWQ to request more shared memory. To mitigate this effect, consider decreasing other memory-related server configuration parameters such as [gp\_cached\_segworkers\_threshold](../reference/guc/parameter_definitions.html#gp_cached_segworkers_threshold).

## <a id="topic5"></a>Encrypting Client/Server Connections

Enable SSL for client connections to HAWQ to encrypt the data passed over the network between the client and the database.

HAWQ has native support for SSL connections between the client and the master server. SSL connections prevent third parties from snooping on the packets, and also prevent man-in-the-middle attacks. SSL should be used whenever the client connection goes through an insecure link, and must be used whenever client certificate authentication is used.

To enable SSL requires that OpenSSL be installed on both the client and the master server systems. HAWQ can be started with SSL enabled by setting the server configuration parameter `ssl` to `on` in the master `hawq-site.xml`. When starting in SSL mode, the server will look for the files server.key \(server private key\) and server.crt \(server certificate\) in the master data directory. These files must be set up correctly before an SSL-enabled HAWQ system can start.
Enabling SSL requires that OpenSSL be installed on both the client and the master server systems. HAWQ can be started with SSL enabled by setting the server configuration parameter `ssl` to `on` in the master `hawq-site.xml`. When starting in SSL mode, the server will look for the files `server.key` \(server private key\) and `server.crt` \(server certificate\) in the master data directory. These files must be set up correctly before an SSL-enabled HAWQ system can start.

**Important:** Do not protect the private key with a passphrase. The server does not prompt for a passphrase for the private key, and the database startup fails with an error if one is required.

@@ -94,10 +94,11 @@ The HAWQ master database must be configured to accept remote client connections.

Make sure the authentication method you choose is supported by the client tool you are using.

2. If you edited the `pg_hba.conf` file, reload the server configuration:
2. If you edited the `pg_hba.conf` file, reload the server configuration. If you have any active database connections, you must include the `-M fast` option in the `hawq stop` command:

``` shell
$ hawq stop -u
$ hawq stop cluster -u [-M fast]
```


3. Verify and/or configure the databases and roles you are using to connect, and that the roles have the correct privileges to the database objects.
@@ -27,10 +27,10 @@ When the configuration parameter `optimizer_analyze_root_partition` is set to `o
$ hawq config -c optimizer_analyze_root_partition -v on
```

3. Reload the modified configuration in HAWQ. This HAWQ `hawq stop` utility command reloads the `hawq-site.xml` file of the master without shutting down HAWQ.
3. Reload the modified configuration in HAWQ. This HAWQ `hawq stop` utility command reloads the `hawq-site.xml` file without shutting down HAWQ:

``` shell
$ hawq stop master -u
$ hawq stop cluster -u
```

## <a id="topic_byp_lqk_br"></a>Enabling GPORCA for a System
@@ -44,10 +44,10 @@ Set the server configuration parameter `optimizer` for the HAWQ system.
$ hawq config -c optimizer -v on
```

3. Reload the modified configuration in HAWQ. This HAWQ `hawq stop` utility command reloads the `hawq-site.xml` file of the master without shutting down HAWQ.
3. Reload the modified configuration in HAWQ:

``` shell
$ hawq stop master -u
$ hawq stop cluster -u
```

## <a id="topic_pzr_3db_3r"></a>Enabling GPORCA for a Database

0 comments on commit bef3b00

Please sign in to comment.