hawq init cluster command initializes a HAWQ system and starts it.
hawq init master and
hawq init segment commands to individually initialize the master or segment nodes, respectively. Specify any format options at this time. The
hawq init standby command initializes a standby master host for a HAWQ system.
hawq init <object> --standby-host option to define the host for a standby at initialization.
hawq init <object> [--options] hawq init standby | cluster [--standby-host <address_of_standby_host>] [<options>] hawq init -? | --help
<object> = cluster | master | segment | standby <options> = [-a] [-l <logfile_directory>] [-q] [-v] [-t] [-n] [--locale=<locale>] [--lc-collate=<locale>] [--lc-ctype=<locale>] [--lc-messages=<locale>] [--lc-monetary=<locale>] [--lc-numeric=<locale>] [--lc-time=<locale>] [--bucket_number <number>] [--max_connections <number>] [--shared_buffers <number>]
hawq init <object> utility creates a HAWQ instance using configuration parameters defined in
$GPHOME/etc/hawq-site.xml. Before running this utility, verify that you have installed the HAWQ software on all the hosts in the array.
In a HAWQ DBMS, each database instance (the master and all segments) must be initialized across all of the hosts in the system in a way that allows them to work together as a unified DBMS. The
hawq init cluster utility initializes the HAWQ master and each segment instance, and configures the system as a whole. When
hawq init cluster is run, the cluster comes online automatically without needing to explicitly start it. You can start a single node cluster without any user-defined changes to the default
hawq-site.xml file. For larger clusters, use the template-hawq-site.xml file to specify the configuration.
To use the template for initializing a new cluster configuration, replace the items contained within the % markers. For example, replace
%master.host% with the master host name. After modification, rename the file to the name of the default configuration file:
- Before initializing HAWQ, set the
$GPHOMEenvironment variable to point to the location of your HAWQ installation on the master host and exchange SSH keys between all host addresses in the array, using
To initialize and start a HAWQ cluster, enter the following command on the master host:
$ hawq init cluster
This utility performs the following tasks:
- Verifies that the parameters in the configuration file are correct.
- Ensures that a connection can be established to each host address. If a host address cannot be reached, the utility will exit.
- Verifies the locale settings.
- Initializes the master instance.
- Initializes the standby master instance (if specified).
- Initializes the segment instances.
- Configures the HAWQ system and checks for errors.
- Starts the HAWQ system.
hawq init standby utility can be run on either the currently active primary master host or on the standby node.
hawq init standby performs the following steps:
- Updates the HAWQ system catalog to add the new standby master host information
- Edits the
pg_hba.conffile of the HAWQ master to allow access from the newly added standby master.
- Sets up the standby master instance on the alternate master host
- Starts the synchronization process
A backup, standby master host serves as a ‘warm standby’ in the event of the primary master host becoming non-operational. The standby master is kept up to date by transaction log replication processes (the
walreceiver), which run on the primary master and standby master hosts and keep the data between the primary and standby master hosts synchronized. To add a standby master to the system, use the command
hawq init standby, for example:
init standby host09. To configure the standby hostname at initialization without needing to run hawq config by defining it, use the –standby-host option. To create the standby above, you would specify
hawq init standby --standby-host=host09 or
hawq init cluster --standby-host=host09.
If the primary master fails, the log replication process is shut down. Run the
hawq activate standby utility to activate the standby master in its place; upon activation of the standby master, the replicated logs are used to reconstruct the state of the master host at the time of the last successfully committed transaction.
LANGenvironment variable of the master host determines the locale. If these are not set, the default locale is
POSIX). A locale identifier consists of a language identifier and a region identifier, and optionally a character set encoding. For example,
sv_SEis Swedish as spoken in Sweden,
en_USis U.S. English, and
fr_CAis French Canadian. If more than one character set can be useful for a locale, then the specifications look like this:
en_US.UTF-8(locale specification and character set encoding). On most systems, the command
localewill show the locale environment settings and
locale -awill show a list of all available locales.
--locale, but sets the locale used for collation (sorting data). The sort order cannot be changed after HAWQ is initialized, so it is important to choose a collation locale that is compatible with the character set encodings that you plan to use for your data. There is a special collation name of
POSIX(byte-order sorting as opposed to dictionary-order sorting). The
Ccollation can be used with any character encoding.
--locale, but sets the locale used for character classification (what character sequences are valid and how they are interpreted). This cannot be changed after HAWQ is initialized, so it is important to choose a character classification locale that is compatible with the data you plan to store in HAWQ.
--locale, but sets the locale used for messages output by HAWQ. The current version of HAWQ does not support multiple locales for output messages (all messages are in English), so changing this setting will not have any effect.
--locale, but sets the locale used for formatting currency amounts.
--locale, but sets the locale used for formatting numbers.
--locale, but sets the locale used for formatting dates and times.
default_hash_table_bucket_number, which sets the default number of hash buckets for creating virtual segments. This parameter overrides the default value of
hawq-site.xmlby an Ambari install. If not specified,
hawq initwill use the value in
Initialize a HAWQ array with an optional standby master host:
$ hawq init standby