提交 9284cf79 编写于 作者: D David Yozie

Docs - update interconnect proxy discussion to cover hostname support (#11027)

* Docs - update interconnect proxy discussion to cover hostname support

* Change gp_interconnect_type -> gp_interconnect_proxy_addresses in note
上级 b6cdd143
...@@ -57,10 +57,10 @@ ...@@ -57,10 +57,10 @@
<p>Set the <codeph>gp_interconnect_proxy_addresses</codeph> parameter to specify the proxy <p>Set the <codeph>gp_interconnect_proxy_addresses</codeph> parameter to specify the proxy
ports for the master and segment instances. The syntax for the value has the following ports for the master and segment instances. The syntax for the value has the following
format and you must specify the parameter value as a single-quoted string.</p> format and you must specify the parameter value as a single-quoted string.</p>
<codeblock>&lt;db_id>:&lt;cont_id>:&lt;seg_ip>:&lt;port>[,&lt;dbid>:&lt;segid>:&lt;ip>:&lt;port> ... ]</codeblock> <codeblock>&lt;db_id>:&lt;cont_id>:&lt;seg_address>:&lt;port>[, ... ]</codeblock>
<p>For the master, standby master, and segment instance, the first three fields, <p>For the master, standby master, and segment instance, the first three fields,
<varname>db_id</varname>, <varname>cont_id</varname>, and <varname>seg_ip</varname> can <varname>db_id</varname>, <varname>cont_id</varname>, and <varname>seg_address</varname>
be found in the <codeph><xref can be found in the <codeph><xref
href="../../ref_guide/system_catalogs/gp_segment_configuration.xml" href="../../ref_guide/system_catalogs/gp_segment_configuration.xml"
>gp_segment_configuration</xref></codeph> catalog table. The fourth field, >gp_segment_configuration</xref></codeph> catalog table. The fourth field,
<varname>port</varname>, is the proxy port for the Greenplum master or a segment <varname>port</varname>, is the proxy port for the Greenplum master or a segment
...@@ -69,12 +69,14 @@ ...@@ -69,12 +69,14 @@
table.</li> table.</li>
<li><varname>cont_id</varname> is the <codeph>content</codeph> column in the catalog <li><varname>cont_id</varname> is the <codeph>content</codeph> column in the catalog
table.</li> table.</li>
<li><varname>seg_ip</varname> is the IP address corresponding to the <li><varname>seg_address</varname> is the IP address or hostname corresponding to the
<codeph>address</codeph> column in the catalog table. If the <codeph>address</codeph> column in the catalog table.</li>
<codeph>address</codeph> is a hostname, use the IP address of the hostname.</li>
<li><varname>port</varname> is the TCP/IP port for the segment instance proxy that you <li><varname>port</varname> is the TCP/IP port for the segment instance proxy that you
specify.</li> specify.</li>
</ul></p> </ul></p>
<note type="important">If a segment instance hostname is bound to a different IP address at
runtime, you must execute <codeph>gpstop -U</codeph> to re-load the
<codeph>gp_interconnect_proxy_addresses</codeph> value.</note>
<p>This is an example PL/Python function that displays or sets the segment instance proxy <p>This is an example PL/Python function that displays or sets the segment instance proxy
port values for the <codeph>gp_interconnect_proxy_addresses</codeph> parameter. To create port values for the <codeph>gp_interconnect_proxy_addresses</codeph> parameter. To create
and run the function, you must enable PL/Python in the database with the <codeph>CREATE and run the function, you must enable PL/Python in the database with the <codeph>CREATE
...@@ -97,7 +99,7 @@ ...@@ -97,7 +99,7 @@
-- A Greenplum system restart will also work. -- A Greenplum system restart will also work.
-- --
create or replace function my_setup_ic_proxy(delta int, action text) create or replace function my_setup_ic_proxy(delta int, action text)
returns table(dbid smallint, content smallint, ip text, port int) as $$ returns table(dbid smallint, content smallint, address text, port int) as $$
import os import os
import socket import socket
...@@ -113,19 +115,16 @@ returns table(dbid smallint, content smallint, ip text, port int) as $$ ...@@ -113,19 +115,16 @@ returns table(dbid smallint, content smallint, ip text, port int) as $$
port = seg['port'] port = seg['port']
address = seg['address'] address = seg['address']
# lookup ip of the address
ip = socket.gethostbyname(address)
# decide the proxy port # decide the proxy port
port = port + delta port = port + delta
# append to the result list # append to the result list
results.append((dbid, content, ip, port)) results.append((dbid, content, address, port))
# build the value for the GUC # build the value for the GUC
if value: if value:
value += ',' value += ','
value += '{}:{}:{}:{}'.format(dbid, content, ip, port) value += '{}:{}:{}:{}'.format(dbid, content, address, port)
if action.lower() == 'update proxy': if action.lower() == 'update proxy':
os.system('''gpconfig --skipvalidation -c gp_interconnect_proxy_addresses -v "'{}'"'''.format(value)) os.system('''gpconfig --skipvalidation -c gp_interconnect_proxy_addresses -v "'{}'"'''.format(value))
......
...@@ -3863,10 +3863,10 @@ ...@@ -3863,10 +3863,10 @@
<p>When the <codeph>gp_interconnect_type</codeph> parameter is set to <codeph>proxy</codeph>, <p>When the <codeph>gp_interconnect_type</codeph> parameter is set to <codeph>proxy</codeph>,
You must specify a proxy port for the master, standby master, and all primary and mirror You must specify a proxy port for the master, standby master, and all primary and mirror
segment instances in this format:</p> segment instances in this format:</p>
<codeblock>&lt;db_id>:&lt;cont_id>:&lt;seg_ip>:&lt;port>[,&lt;dbid>:&lt;segid>:&lt;ip>:&lt;port> ... ]</codeblock> <codeblock>&lt;db_id>:&lt;cont_id>:&lt;seg_address>:&lt;port>[, ... ]</codeblock>
<p>For the master, standby master, and segment instance, the first three fields, <p>For the master, standby master, and segment instance, the first three fields,
<varname>db_id</varname>, <varname>cont_id</varname>, and <varname>seg_ip</varname> can be <varname>db_id</varname>, <varname>cont_id</varname>, and <varname>seg_address</varname>
found in the <codeph><xref href="../system_catalogs/gp_segment_configuration.xml" can be found in the <codeph><xref href="../system_catalogs/gp_segment_configuration.xml"
>gp_segment_configuration</xref></codeph> catalog table. The fourth field, >gp_segment_configuration</xref></codeph> catalog table. The fourth field,
<varname>port</varname>, is the proxy port for the Greenplum master or a segment <varname>port</varname>, is the proxy port for the Greenplum master or a segment
instance.<ul id="ul_zly_vpm_4mb"> instance.<ul id="ul_zly_vpm_4mb">
...@@ -3874,15 +3874,14 @@ ...@@ -3874,15 +3874,14 @@
table.</li> table.</li>
<li><varname>cont_id</varname> is the <codeph>content</codeph> column in the catalog <li><varname>cont_id</varname> is the <codeph>content</codeph> column in the catalog
table.</li> table.</li>
<li><varname>seg_ip</varname> is the IP address corresponding to <codeph>address</codeph> <li><varname>seg_address</varname> is the IP address or hostname corresponding to tge
column in the catalog table. If the <codeph>address</codeph> is a hostname, use the IP <codeph>address</codeph> column in the catalog table.</li>
address of the hostname.</li>
<li><varname>port</varname> is the TCP/IP port for the segment instance proxy that you <li><varname>port</varname> is the TCP/IP port for the segment instance proxy that you
specify.</li> specify.</li>
</ul></p> </ul></p>
<note type="important">The <varname>seg_ip</varname> must be an IP address, not a hostname. <note type="important">If a segment instance hostname is bound to a different IP address at
Also, If the mapping of a segment instance hostname to the IP address changes, you must runtime, you must execute <codeph>gpstop -U</codeph> to re-load the
update the IP address in the parameter value.</note> <codeph>gp_interconnect_proxy_addresses</codeph> value.</note>
<p>You must specify the value as a single-quoted string. This <codeph>gpconfig</codeph> <p>You must specify the value as a single-quoted string. This <codeph>gpconfig</codeph>
command sets the value for <codeph>gp_interconnect_proxy_addresses</codeph> as a command sets the value for <codeph>gp_interconnect_proxy_addresses</codeph> as a
single-quoted string. The Greenplum system consists of a master and a single segment single-quoted string. The Greenplum system consists of a master and a single segment
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册