提交 fb0517f0 编写于 作者: C Chuck Litzell 提交者: David Yozie

gpexpand (#7192)

* gpexpand
- remove `-D` flag and specify expansion schema is created in postgres database
- Add gpstate -x flag

* From review: consistent formatting for gpexpand and postgres

* Edit from review
上级 907e9cf7
......@@ -7,7 +7,7 @@
instances and create the expansion schema. </shortdesc>
<body>
<p>The first time you run <codeph><xref href="../../utility_guide/admin_utilities/gpexpand.xml"
>gpexand</xref></codeph> with a valid input file it creates and initializes segment
>gpexpand</xref></codeph> with a valid input file it creates and initializes segment
instances and creates the expansion schema. After these steps are completed, running
<codeph>gpexpand</codeph> detects if the expansion schema has been created and, if so,
performs table redistribution. </p>
......@@ -79,7 +79,7 @@
segments on new hosts.</li>
<li id="no168559">If you are adding new primary segments, enter the new primary data
directory root for the new segments. Do not specify the actual data directory name,
which is created automatically by <codeph>gpexpand </codeph>based on the existing data
which is created automatically by <codeph>gpexpand</codeph> based on the existing data
directory names. <p>For example, if your existing data directories are as
follows:</p><codeblock>/gpdata/primary/gp0
/gpdata/primary/gp1</codeblock><p>then
......@@ -198,20 +198,18 @@ sdw5:sdw5-1:60012:/gpdata/mirror/gp10:14:10:m</codeblock>
<li id="no160392">Log in on the master host as the user who will run your Greenplum
Database system; for example, <codeph>gpadmin</codeph>.</li>
<li id="no161427">Run the <codeph>gpexpand</codeph> utility, specifying the input file
with <codeph>-i</codeph>. Optionally, use <codeph>-D</codeph> to specify the database in
which to create the expansion schema. For
example:<codeblock>$ gpexpand -i input_file -D database1</codeblock><p>The utility
detects if an expansion schema exists for the Greenplum Database system. If a schema
exists, remove it with <codeph>gpexpand -c</codeph> before you start a new expansion
operation. See <xref href="expand-rm-schema.xml" type="topic" format="dita"
/>.</p><p>When the new segments are initialized and the expansion schema is created,
the utility prints a success message and exits. </p></li>
with <codeph>-i</codeph>. For
example:<codeblock>$ gpexpand -i input_file</codeblock><p>The utility detects if an
expansion schema exists for the Greenplum Database system. If a
<i>gpexpand</i> schema exists, remove it with <codeph>gpexpand -c</codeph>
before you start a new expansion operation. See <xref href="expand-rm-schema.xml"
type="topic" format="dita"/>.</p><p>When the new segments are initialized and the
expansion schema is created, the utility prints a success message and exits. </p></li>
</ol>
<p>When the initialization process completes, you can connect to Greenplum Database and view
the expansion schema. The schema resides in the database you specified with
<codeph>-D</codeph> or in the database specified by the <codeph>PGDATABASE</codeph>
environment variable. For more information, see <xref href="expand-planning.xml#topic9"
type="topic" format="dita"/>.</p>
the expansion schema. The <i>gpexpand</i> schema resides in the
postgres database. For more information, see <xref
href="expand-planning.xml#topic9" type="topic" format="dita"/>.</p>
</section>
</body>
</topic>
......@@ -219,13 +217,28 @@ sdw5:sdw5-1:60012:/gpdata/mirror/gp10:14:10:m</codeblock>
<title>Rolling Back a Failed Expansion Setup</title>
<body>
<p>You can roll back an expansion setup operation (adding segment instances and segment hosts)
only if the operation fails. </p>
only if the operation fails.</p>
<p>If the expansion fails during the initialization step, while the database is down, you must
first restart the database in master-only mode by running the <codeph>gpstart -m</codeph>
command. </p>
<p>Roll back the failed expansion with the following command, specifying the database that
contains the expansion
schema:<codeblock>gpexpand --rollback -D <i>database_name</i></codeblock></p>
<p>Roll back the failed expansion with the following
command:<codeblock>gpexpand --rollback</codeblock></p>
</body>
</topic>
<topic id="topic_wkv_kkd_chb">
<title>Monitoring the Cluster Expansion State</title>
<body>
<p>At any time, you can check the state of cluster expansion by running the
<codeph>gpstate</codeph> utility with the <codeph>-x</codeph> flag: </p>
<codeblock>$ gpstate -x</codeblock>
<p>If the expansion schema exists in the postgres database, <codeph>gpstate
-x</codeph> reports on the progress of the expansion. During the first expansion phase,
<codeph>gpstate</codeph> reports on the progress of new segment intialization. During the
second phase, <codeph>gpstate</codeph> reports on the progress of table redistribution, and
whether redistribution is paused or active. </p>
<p>You can also query the expansion schema to see expansion status. See <xref
href="expand-redistribute.xml#topic31"/> for more information.</p>
</body>
</topic>
</topic>
......@@ -3,8 +3,8 @@
PUBLIC "-//OASIS//DTD DITA Composite//EN" "ditabase.dtd">
<topic id="topic1" xml:lang="en">
<title>Expanding a Greenplum System</title>
<shortdesc>To scale up performance and storage capacity, expand your Greenplum system by adding
hosts to the system.</shortdesc>
<shortdesc>To scale up performance and storage capacity, expand your Greenplum Database system by
adding hosts to the system.</shortdesc>
<body>
<p>Data warehouses typically grow over time as additional data is gathered and the retention
periods increase for existing data. At times, it is necessary to increase database capacity to
......
......@@ -57,8 +57,8 @@
<li>Greenplum Database software is installed. </li>
<li>Databases and database objects are created in the new segment instances on the new
segment hosts. </li>
<li>The <i>gpexpand</i> schema is created in the master database. You can use the tables
in the schema to monitor and control the expansion process.</li>
<li>The <i>gpexpand</i> schema is created in the postgres database. You can use the
tables and view in the schema to monitor and control the expansion process.</li>
</ul><p>After the system has been updated, the new segment instances on the new segment
hosts are available.</p><ul id="ul_dy3_xxn_kgb">
<li>New segments are immediately available and participate in new queries and data
......@@ -90,7 +90,7 @@
file</xref>:<codeblock>gpexpand -f <i>hosts_file</i></codeblock></li>
<li id="no166063">To <xref href="expand-initialize.xml#expand-initialize">initialize segments
and create the expansion
schema</xref>:<codeblock>gpexpand -i <i>input_file</i> -D <i>database_name</i></codeblock><p><codeph>gpexpand</codeph>
schema</xref>:<codeblock>gpexpand -i <i>input_file</i></codeblock><p><codeph>gpexpand</codeph>
creates a data directory, copies user tables from all existing databases on the new
segments, and captures metadata for each table in an expansion schema for status tracking.
After this process completes, the expansion operation is committed and
......
......@@ -222,8 +222,8 @@
<title>Planning New Segment Initialization</title>
<body>
<p>Expanding Greenplum Database can be performed when the system is up and available. Run
<codeph>gpexpand</codeph> to initialize new segments instances into the array and create
an expansion schema.</p>
<codeph>gpexpand</codeph> to initialize new segment instances into the array and create an
expansion schema.</p>
<p>The time required depends on the number of schema objects in the Greenplum system and other
factors related to hardware performance. In most environments, the initialization of new
segments requires less than thirty minutes offline.</p>
......@@ -232,7 +232,7 @@
<li><codeph>gppkg</codeph></li>
<li><codeph>gpconfig</codeph></li>
<li><codeph>gpcheck</codeph></li>
<li><codeph>gpcheckat</codeph></li>
<li><codeph>gpcheckcat</codeph></li>
</ul></p>
<note type="warning">Do not run <codeph>gpbackup</codeph> or <codeph>gprestore</codeph> during
system expansion. Locks obtained for backups can interfere with the expansion process and
......@@ -278,7 +278,7 @@
have. You can increase the segments per host or add new segments to existing hosts.</p>
<p>For example, if existing hosts currently have two segments per host, you can use
<codeph>gpexpand</codeph> to initialize two additional segments on existing hosts for a
total of four segments and four new segments on new hosts. </p>
total of four segments and initialize four new segments on new hosts. </p>
<p>The interactive process for creating an expansion input file prompts for this option; you
can also specify new segment directories manually in the input configuration file. For
more information, see <xref href="expand-initialize.xml#topic23" type="topic"
......@@ -288,9 +288,8 @@
<topic id="topic9" xml:lang="en">
<title id="no165172">About the Expansion Schema</title>
<body>
<p>At initialization, <codeph>gpexpand</codeph> creates an expansion schema. If you do not
specify a database at initialization (<codeph>gpexpand -D</codeph>), the schema is created
in the database indicated by the <codeph>PGDATABASE</codeph> environment variable.</p>
<p>At initialization, the <codeph>gpexpand</codeph> utility creates an expansion schema
named <i>gpexpand</i> in the postgres database. </p>
<p>The expansion schema stores metadata for each table in the system so its status can be
tracked throughout the expansion process. The expansion schema consists of two tables and
a view for tracking expansion operation progress:</p>
......@@ -343,7 +342,7 @@
Manipulating the redistribution order can help adjust for limited disk space and restore
optimal query performance for high-priority queries sooner. </p>
<section>
<title>Table Redstribution Methods</title>
<title>Table Redistribution Methods</title>
<p>There are two methods of redistributing data when performing a Greenplum Database
expansion. <ul id="ul_hkz_jdv_kgb">
<li><codeph>rebuild</codeph> - Create a new table, copy all the data from the old to
......@@ -399,14 +398,14 @@
following:<ul id="ul_ocf_3fr_g4">
<li id="no163863">Uncompressed append-optimized tables expand 10% faster than heap
tables.</li>
<li id="no170207">Append-optimized tables are defined to use data compression expand at
a significantly slower rate than uncompressed append-optimized tables, potentially up
to 80% slower.</li>
<li id="no170207">Append-optimized tables that are defined to use data compression
expand at a significantly slower rate than uncompressed append-optimized tables,
potentially up to 80% slower.</li>
<li id="no170253">Systems with data compression such as ZFS/LZJB take longer to
redistribute.</li>
</ul></p>
<note type="important">If your system hosts use data compression, use identical compression
setting on the new hosts to avoid disk space shortage. </note>
settings on the new hosts to avoid disk space shortage. </note>
</body>
</topic>
<topic id="topic16" xml:lang="en">
......
......@@ -7,11 +7,11 @@
<body>
<p>After creating an expansion schema, you can redistribute tables across the entire system with
<codeph><xref href="../../utility_guide/admin_utilities/gpexpand.xml"
>gpexand</xref></codeph>. Aim to run this during low-use hours when the utility's CPU usage
and table locks have minimal impact on operations. Rank tables to redistribute the largest or
most critical tables first.</p>
>gpexpand</xref></codeph>. Plan to run this during low-use hours when the utility's CPU
usage and table locks have minimal impact on operations. Rank tables to redistribute the
largest or most critical tables first.</p>
<note>When redistributing data, Greenplum Database must be running in production mode. Greenplum
Database cannot be restricted mode or in master mode. The <codeph><xref
Database cannot be in restricted mode or in master mode. The <codeph><xref
href="../../utility_guide/admin_utilities/gpstart.xml">gpstart</xref></codeph> options
<codeph>-R</codeph> or <codeph>-m</codeph> cannot be specified to start Greenplum
Database.</note>
......@@ -53,7 +53,7 @@
<codeph>orders</codeph>. When table redistribution begins, <codeph>lineitem</codeph> is
redistributed first, followed by <codeph>orders</codeph> and all other tables in
<i>gpexpand.status_detail</i>. To exclude a table from redistribution, remove the table
from <i>gpexpand.status_detail</i>. </p>
from the <i>gpexpand.status_detail</i> table. </p>
</body>
</topic>
<topic id="topic30" xml:lang="en">
......@@ -85,6 +85,8 @@
the estimated rate of table redistribution and estimated time to completion. You can query
the table <i><xref href="../../ref_guide/system_catalogs/gp_expansion_tables.xml"
>gpexpand.status_detail</xref></i> for per-table status information.</p>
<p>See also <xref href="expand-initialize.xml#topic_wkv_kkd_chb"/> for information about
monitoring the overall expansion progress with the <codeph>gpstate</codeph> utility.</p>
</body>
<topic id="topic32" xml:lang="en">
<title>Viewing Expansion Status</title>
......@@ -92,7 +94,7 @@
<p>After the first table completes redistribution, <i>gpexpand.expansion_progress</i>
calculates its estimates and refreshes them based on all tables' redistribution rates.
Calculations restart each time you start a table redistribution session with
<codeph>gpexpand</codeph>. To monitor progress, connect to Greenplum Data\base using
<codeph>gpexpand</codeph>. To monitor progress, connect to Greenplum Database using
<codeph>psql</codeph> or another supported client; query
<i>gpexpand.expansion_progress</i> with a command like the following:</p>
<p>
......
......@@ -15,8 +15,7 @@
<li id="no163298">Log in on the master host as the user who will be running your Greenplum
Database system (for example, <codeph>gpadmin</codeph>).</li>
<li id="no163294">Run the <codeph>gpexpand</codeph> utility with the <codeph>-c</codeph>
option. For example:<codeblock>$ gpexpand -c
$ </codeblock><note type="note">Some systems
option. For example:<codeblock>$ gpexpand -c</codeblock><note type="note">Some systems
require you to press Enter twice.</note></li>
</ol>
</section>
......
......@@ -14,7 +14,7 @@
         [<b>-n </b> <varname>parallel_processes</varname>]
       | {<b>-r</b>|<b>--rollback</b>}
       | {<b>-c</b>|<b>--clean</b>}
[<b>-D</b> <varname>database_name</varname>] [<b>-v</b>|<b>--verbose</b>] [<b>-s</b>|<b>--silent</b>]
[<b>-v</b>|<b>--verbose</b>] [<b>-s</b>|<b>--silent</b>]
[{<b>-t</b>|<b>--tardir</b>} <varname>directory </varname>]
[<b>-S</b>|<b>--simple-progress </b>]
......@@ -64,8 +64,8 @@
<p>In addition to initializing the segment instances, the initialization phase performs these
actions:</p>
<ul>
<li id="kt138259">Creates an expansion schema to store the status of the expansion
operation, including detailed status for tables.</li>
<li id="kt138259">Creates an expansion schema named <i>gpexpand</i> in the postgres database
to store the status of the expansion operation, including detailed status for tables.</li>
</ul>
<p>In the table data redistribution phase, <codeph>gpexpand</codeph> redistributes table data
to rebalance the data across the old and new segment instances.</p>
......@@ -117,13 +117,6 @@
<pt>-d | --duration <varname>hh:mm:ss</varname></pt>
<pd>Duration of the expansion session from beginning to end.</pd>
</plentry>
<plentry>
<pt>-D <varname>database_name</varname></pt>
<pd>Specifies the database in which to create the expansion schema and tables. If this
option is not given, the setting for the environment variable
<codeph>PGDATABASE</codeph> is used. The database templates
<varname>template1</varname> and <varname>template0</varname> cannot be used.</pd>
</plentry>
<plentry>
<pt>-e | --end '<varname>YYYY-MM-DD hh:mm:ss</varname>'</pt>
<pd>Ending date and time for the expansion session.</pd>
......@@ -162,9 +155,7 @@
</plentry>
<plentry>
<pt>-r | --rollback</pt>
<pd>Roll back a failed expansion setup operation. If the rollback command fails, attempt
again using the <codeph>-D</codeph> option to specify the database that contains the
expansion schema for the operation that you want to roll back.</pd>
<pd>Roll back a failed expansion setup operation. </pd>
</plentry>
<plentry>
<pt>-s | --silent</pt>
......@@ -177,7 +168,7 @@
utility does not record the relation size information and status information in the
table <i>gpexpand.status_detail</i>. </pd>
<pd>Specifying this option can improve performance by reducing the amount of progress
information written to the <codeph>gpexpand</codeph> tables.</pd>
information written to the <i>gpexpand</i> tables.</pd>
</plentry>
<plentry>
<pt>[-t | --tardir] <varname>directory</varname></pt>
......@@ -204,7 +195,7 @@
<section id="section6">
<title>Examples</title>
<p>Run <codeph>gpexpand</codeph> with an input file to initialize new segments and create the
expansion schema in the default database:</p>
expansion schema in the postgres database:</p>
<codeblock>$ gpexpand -i input_file</codeblock>
<p>Run <codeph>gpexpand</codeph> for sixty hours maximum duration to redistribute tables to
new segments:</p>
......
......@@ -8,7 +8,7 @@
<section id="section2">
<title>Synopsis</title>
<codeblock><b>gpstate</b> [<b>-d</b> <varname>master_data_directory</varname>] [<b>-B</b> <varname>parallel_processes</varname>]
[<b>-s</b> | <b>-b</b> | <b>-Q</b><ph> | <b>-e</b>] [<b>-m</b> | <b>-c</b></ph>] [<b>-p</b>] [<b>-i</b>] [<b>-f</b>] [<b>-v</b> | <b>-q</b>]
[<b>-s</b> | <b>-b</b> | <b>-Q</b><ph> | <b>-e</b>] [<b>-m</b> | <b>-c</b></ph>] [<b>-p</b>] [<b>-i</b>] [<b>-f</b>] [<b>-v</b> | <b>-q</b>] | <b>-x</b>
[<b>-l</b> <varname>log_directory</varname>]
<b>gpstate</b> <b>-?</b> | <b>-h</b> | <b>--help</b></codeblock>
......@@ -103,6 +103,11 @@
<pd>Optional. Displays error messages and outputs detailed status and progress
information.</pd>
</plentry>
<plentry>
<pt>-x (expand)</pt>
<pd>Optional. Displays detailed information about the progress and state of a Greenplum
system expansion.</pd>
</plentry>
<plentry>
<pt>-? | -h | --help (help)</pt>
<pd>Displays the online help.</pd>
......@@ -372,7 +377,8 @@
<section id="section7">
<title>See Also</title>
<p><codeph><xref href="gpstart.xml#topic1" type="topic" format="dita"/></codeph>,
<codeph><xref href="gplogfilter.xml#topic1" type="topic" format="dita"/></codeph></p>
<codeph><xref href="gpexpand.xml#topic1"/></codeph><codeph><xref
href="gplogfilter.xml#topic1" type="topic" format="dita"/></codeph></p>
</section>
</body>
</topic>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册