forked from docs/doc-exports
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com> Co-authored-by: Lu, Huayi <luhuayi@huawei.com> Co-committed-by: Lu, Huayi <luhuayi@huawei.com>
140 lines
27 KiB
HTML
140 lines
27 KiB
HTML
<a name="EN-US_TOPIC_0000001188429072"></a><a name="EN-US_TOPIC_0000001188429072"></a>
|
|
|
|
<h1 class="topictitle1">CREATE SERVER</h1>
|
|
<div id="body8662426"><div class="section" id="EN-US_TOPIC_0000001188429072__s13dd03a7672f48e7b6b166e1b5878d9a"><h4 class="sectiontitle">Function</h4><p id="EN-US_TOPIC_0000001188429072__afe74fe1327a9423e88057f2e98721c8b"><strong id="EN-US_TOPIC_0000001188429072__en-us_topic_0040045035_b84235270610495">CREATE SERVER</strong> creates an external server.</p>
|
|
<p id="EN-US_TOPIC_0000001188429072__a586e5bb21d3f4cb6a1ea244e1a20fa23">An external server stores information of HDFS clusters, OBS servers, DLI connections, or other homogeneous clusters.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001188429072__sddfb0f7021694502a04176b91c861329"><h4 class="sectiontitle">Precautions</h4><p id="EN-US_TOPIC_0000001188429072__af175e8b9ed484c73a4732a14880ed4d9">By default, only the system administrator can create a foreign server. Otherwise, creating a server requires USAGE permission on the foreign-data wrapper being used. The syntax is as follows:</p>
|
|
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001188429072__sa698a1e88de0493796c1bd78642eee7b"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">GRANT</span><span class="w"> </span><span class="k">USAGE</span><span class="w"> </span><span class="k">ON</span><span class="w"> </span><span class="k">FOREIGN</span><span class="w"> </span><span class="k">DATA</span><span class="w"> </span><span class="n">WRAPPER</span><span class="w"> </span><span class="n">fdw_name</span><span class="w"> </span><span class="k">TO</span><span class="w"> </span><span class="n">username</span><span class="p">;</span>
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
<p id="EN-US_TOPIC_0000001188429072__abb89eb60a1fc4c79bf73111006fa5550"><strong id="EN-US_TOPIC_0000001188429072__en-us_topic_0040045035_b8423527068587">fdw_name</strong> is the name of <strong id="EN-US_TOPIC_0000001188429072__en-us_topic_0040045035_b84235270685813">FOREIGN DATA WRAPPER</strong>, and <strong id="EN-US_TOPIC_0000001188429072__b842352706155832">username</strong> is the user name of creating <strong id="EN-US_TOPIC_0000001188429072__en-us_topic_0040045035_b84235270685824">SERVER</strong>.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001188429072__sb82338cecdab40e29f911262aded4897"><h4 class="sectiontitle">Syntax</h4><div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001188429072__s2bfcfe317dee47ecb847b18714b38d7a"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
|
|
<span class="normal">2</span>
|
|
<span class="normal">3</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">CREATE</span><span class="w"> </span><span class="n">SERVER</span><span class="w"> </span><span class="k">server_name</span><span class="w"> </span>
|
|
<span class="w"> </span><span class="k">FOREIGN</span><span class="w"> </span><span class="k">DATA</span><span class="w"> </span><span class="n">WRAPPER</span><span class="w"> </span><span class="n">fdw_name</span>
|
|
<span class="w"> </span><span class="k">OPTIONS</span><span class="w"> </span><span class="p">(</span><span class="w"> </span><span class="err">{</span><span class="w"> </span><span class="n">option_name</span><span class="w"> </span><span class="s1">' value '</span><span class="w"> </span><span class="err">}</span><span class="w"> </span><span class="p">[,</span><span class="w"> </span><span class="p">...]</span><span class="w"> </span><span class="p">)</span><span class="w"> </span><span class="p">;</span>
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001188429072__s861ab5a8fd1a4852ae40de714351356e"><h4 class="sectiontitle">Parameter Description</h4><ul id="EN-US_TOPIC_0000001188429072__u4375a87799584dd2ae6aeec2a46fe854"><li id="EN-US_TOPIC_0000001188429072__l20789cbf328f4b5c8dfc419f78f4db4e"><strong id="EN-US_TOPIC_0000001188429072__a5e83dc7de87a4015a99c3c585c8f2c90">server_name</strong><p id="EN-US_TOPIC_0000001188429072__ae907d499d4aa4f7cbc2f184525c9ab52">Name of the foreign server to be created. The server name must be unique in a database.</p>
|
|
<p id="EN-US_TOPIC_0000001188429072__a4dd0efebe7e7465db6c5029928ede811">Value range: The length must be less than or equal to 63.</p>
|
|
</li><li id="EN-US_TOPIC_0000001188429072__l6d1b6ec335bf495997d5f77a63224963"><strong id="EN-US_TOPIC_0000001188429072__a6540cb05d7174b3888605c7bcfd025df">FOREIGN DATA WRAPPER fdw_name</strong><p id="EN-US_TOPIC_0000001188429072__a136bd4449263438381b4101c169f84ed">Specifies the name of the foreign data wrapper.</p>
|
|
<p id="EN-US_TOPIC_0000001188429072__a2b47950e2c72499fa73236438f537d16">Value range: <strong id="EN-US_TOPIC_0000001188429072__b84235270685852">fdw_name</strong> indicates the data wrapper created by the system in the initial phase of the database. Currently, <strong id="EN-US_TOPIC_0000001188429072__b84235270685943">fdw_name</strong> can be <strong id="EN-US_TOPIC_0000001188429072__b84235270685948">hdfs_fdw</strong> or <strong id="EN-US_TOPIC_0000001188429072__b5560627142415">dfs_fdw</strong> for the HDFS cluster, and can be <strong id="EN-US_TOPIC_0000001188429072__b0353101792416">gc_fdw</strong> for other homogeneous clusters.</p>
|
|
</li><li id="EN-US_TOPIC_0000001188429072__l6e41ba91dbfe42398be29479a23230a0"><strong id="EN-US_TOPIC_0000001188429072__a57afb7823db042f9b68414b747173bf2">OPTIONS ( { option_name ' value ' } [, ...] )</strong><p id="EN-US_TOPIC_0000001188429072__aea1103545a724f5ebd7185cf69f0da25">Specifies the parameters for the server. The detailed parameter description is as follows:</p>
|
|
<ul id="EN-US_TOPIC_0000001188429072__u70dc747f3ff44bdb8456ae9cb9c0f0e6"><li id="EN-US_TOPIC_0000001188429072__lcdcaa5c094c544dfbfb4b784eae1537c">address<p id="EN-US_TOPIC_0000001188429072__p165701729143210"><a name="EN-US_TOPIC_0000001188429072__lcdcaa5c094c544dfbfb4b784eae1537c"></a><a name="lcdcaa5c094c544dfbfb4b784eae1537c"></a>Specifies the IP address of the OBS service endpoint or HDFS cluster.</p>
|
|
<p id="EN-US_TOPIC_0000001188429072__p299840163420">OBS: Specifies the endpoint of the OBS service.</p>
|
|
<p id="EN-US_TOPIC_0000001188429072__p68071341153214">HDFS: Specifies the IP address and port number of a NameNode (metadata node) in the HDFS cluster, or the IP address and port number of a CN in other homogeneous clusters.</p>
|
|
<p id="EN-US_TOPIC_0000001188429072__p102135203304">HDFS NameNodes are deployed in primary/secondary mode for HA. Add the addresses of the primary and secondary NameNodes to <strong id="EN-US_TOPIC_0000001188429072__b38581435123017">ADDRESS</strong>. When accessing HDFS, <span id="EN-US_TOPIC_0000001188429072__text1985858039">GaussDB(DWS)</span> dynamically checks for the primary NameNode.</p>
|
|
<p id="EN-US_TOPIC_0000001188429072__p105957341305">If the HDFS is in federation mode, you can add all router addresses to the <strong id="EN-US_TOPIC_0000001188429072__b565214024511">address</strong> value. When <span id="EN-US_TOPIC_0000001188429072__text47920019118">GaussDB(DWS)</span> accesses the HDFS service, the system dynamically and randomly searches for the active router.</p>
|
|
<div class="note" id="EN-US_TOPIC_0000001188429072__n2c3b7f5959f141bf8d43c9cfa44bb286"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="EN-US_TOPIC_0000001188429072__ul1167673717116"><li id="EN-US_TOPIC_0000001188429072__li885716161739">The <strong id="EN-US_TOPIC_0000001188429072__b3422638104610">address</strong> option must exist. In the cross-cluster interconnection scenario, only one <strong id="EN-US_TOPIC_0000001188429072__b452619506464">address</strong> option can be set.</li><li id="EN-US_TOPIC_0000001188429072__li485861617319">If the server type is DLI, the address is the OBS address stored on DLI.</li><li id="EN-US_TOPIC_0000001188429072__li196301822105211">If the HDFS is in federation mode, that is, <strong id="EN-US_TOPIC_0000001188429072__b7974928124913">fed 'rbf'</strong>, address can be set to multiple groups of IP addresses and ports, corresponding to the address of the HDFS router.</li></ul>
|
|
</div></div>
|
|
</li><li id="EN-US_TOPIC_0000001188429072__l742de39c198c4ccca30e0e541e38f89b">hdfscfgpath<p id="EN-US_TOPIC_0000001188429072__ad6bf5244575648508d5af810a16851bc"><a name="EN-US_TOPIC_0000001188429072__l742de39c198c4ccca30e0e541e38f89b"></a><a name="l742de39c198c4ccca30e0e541e38f89b"></a>This parameter is available only when <strong id="EN-US_TOPIC_0000001188429072__b84235270610957">type</strong> is <strong id="EN-US_TOPIC_0000001188429072__b84235270610100">HDFS</strong>.</p>
|
|
<p id="EN-US_TOPIC_0000001188429072__p16761819175513">You can set the <strong id="EN-US_TOPIC_0000001188429072__b175511439102120">hdfscfgpath</strong> parameter to specify the HDFS configuration file path. <span id="EN-US_TOPIC_0000001188429072__text241035006">GaussDB(DWS)</span> accesses the HDFS cluster based on the connection configuration mode and security mode specified in the HDFS configuration file stored in that path. If the HDFS cluster is connected in non-secure mode, data transmission encryption is not supported.</p>
|
|
<p id="EN-US_TOPIC_0000001188429072__p9657204492412">If the <strong id="EN-US_TOPIC_0000001188429072__b153754613521">address option</strong> is not specified, the address specified by <strong id="EN-US_TOPIC_0000001188429072__b112118342534">hdfscfgpath</strong> in the configuration file is used by default.</p>
|
|
</li><li id="EN-US_TOPIC_0000001188429072__li19851134775718">fed<p id="EN-US_TOPIC_0000001188429072__p456092519536"><a name="EN-US_TOPIC_0000001188429072__li19851134775718"></a><a name="li19851134775718"></a>Indicates that <strong id="EN-US_TOPIC_0000001188429072__b48057815500">dfs_fdw</strong> is connected to HDFS in federation mode.</p>
|
|
<p id="EN-US_TOPIC_0000001188429072__p10851164715719">The value <strong id="EN-US_TOPIC_0000001188429072__b134207198507">rbf</strong> indicates that HDFS uses the RBF mode.</p>
|
|
<div class="note" id="EN-US_TOPIC_0000001188429072__note138511821123111"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0000001188429072__p1886129163117">This feature is supported in 8.1.2 or later.</p>
|
|
</div></div>
|
|
</li><li id="EN-US_TOPIC_0000001188429072__l847f0a51fe264453bcdaceaf1d1cff04">encrypt<p id="EN-US_TOPIC_0000001188429072__a179c4fefda5a49a891b3d27b8bfe6e54"><a name="EN-US_TOPIC_0000001188429072__l847f0a51fe264453bcdaceaf1d1cff04"></a><a name="l847f0a51fe264453bcdaceaf1d1cff04"></a>Specifies whether data is encrypted. This parameter is available only when <strong id="EN-US_TOPIC_0000001188429072__b768030577101022">type</strong> is <strong id="EN-US_TOPIC_0000001188429072__b880004859101022">OBS</strong>. The default value is <strong id="EN-US_TOPIC_0000001188429072__b188431391007">off</strong>.</p>
|
|
<p id="EN-US_TOPIC_0000001188429072__ab76f86be384b48e68c58e8f2a83dbf8e">Valid value:</p>
|
|
<ul id="EN-US_TOPIC_0000001188429072__ub87aa64a2b454e4e81e84f51b6b9e2d9"><li id="EN-US_TOPIC_0000001188429072__l720a1406ebec4f3db687639223afc61f"><strong id="EN-US_TOPIC_0000001188429072__b842352706101041">on</strong> indicates that data is encrypted.</li><li id="EN-US_TOPIC_0000001188429072__l2417e942e4984447b7b834e110f96f22"><strong id="EN-US_TOPIC_0000001188429072__b1378122922101054">off</strong> indicates that data is not encrypted.</li></ul>
|
|
</li><li id="EN-US_TOPIC_0000001188429072__l2d663abccd1d4b3490e4c64c44a538d3">access_key<p id="EN-US_TOPIC_0000001188429072__a589ca08b8d6f49f09a42812a8e586edc"><a name="EN-US_TOPIC_0000001188429072__l2d663abccd1d4b3490e4c64c44a538d3"></a><a name="l2d663abccd1d4b3490e4c64c44a538d3"></a>Specifies the access key (AK) (obtained by users from the OBS console) used for the OBS access protocol. When you create a foreign table, its AK value is encrypted and saved to the metadata table of the database. This parameter is available only when <strong id="EN-US_TOPIC_0000001188429072__b591709870">type</strong> is <strong id="EN-US_TOPIC_0000001188429072__b705029999">OBS</strong>.</p>
|
|
</li><li id="EN-US_TOPIC_0000001188429072__l37cde99d5be94fb180451c320ba3c500">secret_access_key<p id="EN-US_TOPIC_0000001188429072__ad4705a44096947f9807db36975cbb0c2"><a name="EN-US_TOPIC_0000001188429072__l37cde99d5be94fb180451c320ba3c500"></a><a name="l37cde99d5be94fb180451c320ba3c500"></a>Indicates the secret access key (SK) (obtained by users from the OBS page) used for the OBS access protocol. When you create a foreign table, its SK value is encrypted and saved to the metadata table of the database. This parameter is available only when <strong id="EN-US_TOPIC_0000001188429072__b930781862">type</strong> is <strong id="EN-US_TOPIC_0000001188429072__b1745541556">OBS</strong>.</p>
|
|
</li><li id="EN-US_TOPIC_0000001188429072__l89ee852ff8304d3bb8a71562f7c456c0">type<p id="EN-US_TOPIC_0000001188429072__en-us_topic_0059778673_p34741157387"><a name="EN-US_TOPIC_0000001188429072__l89ee852ff8304d3bb8a71562f7c456c0"></a><a name="l89ee852ff8304d3bb8a71562f7c456c0"></a>Specifies the <strong id="EN-US_TOPIC_0000001188429072__b1689671341017">dfs_fdw</strong> connection type.</p>
|
|
<p id="EN-US_TOPIC_0000001188429072__a532854f8d9b94019bafd9820f1a17483">Valid value:</p>
|
|
<ul id="EN-US_TOPIC_0000001188429072__ubd4c6e5c4b204bcb887554d7f3d759b0"><li id="EN-US_TOPIC_0000001188429072__l6623699fd9c649dbba4b3aa971925534"><strong id="EN-US_TOPIC_0000001188429072__b842352706101355">OBS</strong> indicates that OBS is connected.</li><li id="EN-US_TOPIC_0000001188429072__lf8a0431c660344da9c89f7e9b64701c8"><strong id="EN-US_TOPIC_0000001188429072__b84235270610147">HDFS</strong> indicates that HDFS is connected.</li><li id="EN-US_TOPIC_0000001188429072__li1921353332620"><strong id="EN-US_TOPIC_0000001188429072__b1929356666">DLI</strong> indicates that DLI is connected.</li></ul>
|
|
</li><li id="EN-US_TOPIC_0000001188429072__li42221130192714">dli_address<p id="EN-US_TOPIC_0000001188429072__p3453181672815"><a name="EN-US_TOPIC_0000001188429072__li42221130192714"></a><a name="li42221130192714"></a>Specifies the endpoint of the DLI service. This parameter is available only when <strong id="EN-US_TOPIC_0000001188429072__b1312191919212">type</strong> is <strong id="EN-US_TOPIC_0000001188429072__b931281914217">DLI</strong>.</p>
|
|
</li><li id="EN-US_TOPIC_0000001188429072__li7283184952718">dli_access_key<p id="EN-US_TOPIC_0000001188429072__p695605054612"><a name="EN-US_TOPIC_0000001188429072__li7283184952718"></a><a name="li7283184952718"></a>Specifies the access key (AK) (obtained by users from the DLI console) used for the DLI access protocol. When you create a foreign table, its AK value is encrypted and saved to the metadata table of the database. This parameter is available only when <strong id="EN-US_TOPIC_0000001188429072__b235015296216">type</strong> is <strong id="EN-US_TOPIC_0000001188429072__b3351122962114">DLI</strong>.</p>
|
|
</li><li id="EN-US_TOPIC_0000001188429072__li203411759192713">dli_secret_access_key<p id="EN-US_TOPIC_0000001188429072__p91821055144612"><a name="EN-US_TOPIC_0000001188429072__li203411759192713"></a><a name="li203411759192713"></a>Specifies the secret access key (SK) (obtained by users from the DLI console) used for the DLI access protocol. When you create a foreign table, its SK value is encrypted and saved to the metadata table of the database. This parameter is available only when <strong id="EN-US_TOPIC_0000001188429072__b1839174018216">type</strong> is <strong id="EN-US_TOPIC_0000001188429072__b1239119403211">DLI</strong>.</p>
|
|
</li><li id="EN-US_TOPIC_0000001188429072__li3786105112391">dbname<p id="EN-US_TOPIC_0000001188429072__p1778795110392"><a name="EN-US_TOPIC_0000001188429072__li3786105112391"></a><a name="li3786105112391"></a>Specifies the database name of a remote cluster to be connected. This parameter is used for collaborative analysis and cross-cluster interconnection.</p>
|
|
</li><li id="EN-US_TOPIC_0000001188429072__li14191536114011">username<p id="EN-US_TOPIC_0000001188429072__p91920366401"><a name="EN-US_TOPIC_0000001188429072__li14191536114011"></a><a name="li14191536114011"></a>Specifies the username of a remote cluster to be connected. This parameter is used for collaborative analysis and cross-cluster interconnection.</p>
|
|
</li><li id="EN-US_TOPIC_0000001188429072__li16426637184015">password<p id="EN-US_TOPIC_0000001188429072__p164274379404"><a name="EN-US_TOPIC_0000001188429072__li16426637184015"></a><a name="li16426637184015"></a>Specifies the password of a remote cluster to be connected. This parameter is used for collaborative analysis and cross-cluster interconnection.</p>
|
|
<div class="note" id="EN-US_TOPIC_0000001188429072__note638417431194"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0000001188429072__p530161911813">When an on-premises cluster is migrated to the cloud, the password in the server configuration exported from the on-premises cluster is in ciphertext. The encryption and decryption keys of the on-premises cluster are different from those of the cloud cluster. Therefore, if <strong id="EN-US_TOPIC_0000001188429072__b1025432525520">CREATE SERVER</strong> is executed on the cloud cluster, the execution fails and a decryption failure error is reported. In this case, you need to manually change the password in <strong id="EN-US_TOPIC_0000001188429072__b195813165556">CREATE SERVER</strong> to a plaintext password.</p>
|
|
</div></div>
|
|
</li><li id="EN-US_TOPIC_0000001188429072__li1188512065510">syncsrv<p id="EN-US_TOPIC_0000001188429072__p0620193717550"><a name="EN-US_TOPIC_0000001188429072__li1188512065510"></a><a name="li1188512065510"></a>This parameter is used only for cross-cluster interconnection and indicates the GDS service used during data synchronization. The method for setting this parameter is the same as that for setting the <strong id="EN-US_TOPIC_0000001188429072__b187638231570">location</strong> attribute of the GDS foreign table.</p>
|
|
</li></ul>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001188429072__sfd3ea539f79540b2bdedddb211eb1ad5"><h4 class="sectiontitle">Examples</h4><p id="EN-US_TOPIC_0000001188429072__aace6b6ff3fb449acbd1853aeb5b6e639">Create the <strong id="EN-US_TOPIC_0000001188429072__en-us_topic_0058966073_b842352706909">hdfs_server</strong> server, in which <strong id="EN-US_TOPIC_0000001188429072__a9cdc19e8d2e94919b4a49671ae056f73">hdfs_fdw</strong> is the foreign-data wrapper:</p>
|
|
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001188429072__s46ba4a0f2be94d528ab22d3e30374d91"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
|
|
<span class="normal">2</span>
|
|
<span class="normal">3</span>
|
|
<span class="normal">4</span>
|
|
<span class="normal">5</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">CREATE</span><span class="w"> </span><span class="n">SERVER</span><span class="w"> </span><span class="n">hdfs_server</span><span class="w"> </span><span class="k">FOREIGN</span><span class="w"> </span><span class="k">DATA</span><span class="w"> </span><span class="n">WRAPPER</span><span class="w"> </span><span class="n">HDFS_FDW</span><span class="w"> </span><span class="k">OPTIONS</span><span class="w"> </span>
|
|
<span class="w"> </span><span class="p">(</span><span class="n">address</span><span class="w"> </span><span class="s1">'10.10.0.100:25000,10.10.0.101:25000'</span><span class="p">,</span>
|
|
<span class="w"> </span><span class="n">hdfscfgpath</span><span class="w"> </span><span class="s1">'/opt/hadoop_client/HDFS/hadoop/etc/hadoop'</span><span class="p">,</span><span class="w"> </span>
|
|
<span class="w"> </span><span class="k">type</span><span class="w"> </span><span class="s1">'HDFS'</span>
|
|
<span class="p">)</span><span class="w"> </span><span class="p">;</span>
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
<p id="EN-US_TOPIC_0000001188429072__acfb12297e91f4fa2bcefd4694c2b47b5">Create the <strong id="EN-US_TOPIC_0000001188429072__b374612092415">obs_server</strong> server, in which <strong id="EN-US_TOPIC_0000001188429072__b4866923142413">dfs_fdw</strong> is the foreign-data wrapper:</p>
|
|
<div class="notice" id="EN-US_TOPIC_0000001188429072__note8911201315239"><span class="noticetitle"><img src="public_sys-resources/notice_3.0-en-us.png"> </span><div class="noticebody"><p id="EN-US_TOPIC_0000001188429072__p13912121322315">Hard-coded or plaintext AK and SK are risky. For security purposes, encrypt your AK and SK and store them in the configuration file or environment variables.</p>
|
|
</div></div>
|
|
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001188429072__s59c7a176e6924e43b5a05152e1b8a251"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
|
|
<span class="normal">2</span>
|
|
<span class="normal">3</span>
|
|
<span class="normal">4</span>
|
|
<span class="normal">5</span>
|
|
<span class="normal">6</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">CREATE</span><span class="w"> </span><span class="n">SERVER</span><span class="w"> </span><span class="n">obs_server</span><span class="w"> </span><span class="k">FOREIGN</span><span class="w"> </span><span class="k">DATA</span><span class="w"> </span><span class="n">WRAPPER</span><span class="w"> </span><span class="n">DFS_FDW</span><span class="w"> </span><span class="k">OPTIONS</span><span class="w"> </span><span class="p">(</span><span class="w"> </span>
|
|
<span class="w"> </span><span class="n">address</span><span class="w"> </span><span class="s1">'obs.xxx.xxx.com'</span><span class="p">,</span><span class="w"> </span>
|
|
<span class="w"> </span><span class="n">access_key</span><span class="w"> </span><span class="s1">'xxxxxxxxx'</span><span class="p">,</span><span class="w"> </span>
|
|
<span class="w"> </span><span class="n">secret_access_key</span><span class="w"> </span><span class="s1">'yyyyyyyyyyyyy'</span><span class="p">,</span><span class="w"> </span>
|
|
<span class="w"> </span><span class="k">type</span><span class="w"> </span><span class="s1">'obs'</span>
|
|
<span class="p">);</span>
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
<p id="EN-US_TOPIC_0000001188429072__p201741055105315">Create the <strong id="EN-US_TOPIC_0000001188429072__b1358551813239">dli_server</strong> server, in which <strong id="EN-US_TOPIC_0000001188429072__b1121117269235">dfs_fdw</strong> is the foreign-data wrapper:</p>
|
|
<div class="notice" id="EN-US_TOPIC_0000001188429072__note104761845162218"><span class="noticetitle"><img src="public_sys-resources/notice_3.0-en-us.png"> </span><div class="noticebody"><p id="EN-US_TOPIC_0000001188429072__p7476144532220">Hard-coded or plaintext AK and SK are risky. For security purposes, encrypt your AK and SK and store them in the configuration file or environment variables.</p>
|
|
</div></div>
|
|
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001188429072__screen217485555315"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
|
|
<span class="normal">2</span>
|
|
<span class="normal">3</span>
|
|
<span class="normal">4</span>
|
|
<span class="normal">5</span>
|
|
<span class="normal">6</span>
|
|
<span class="normal">7</span>
|
|
<span class="normal">8</span>
|
|
<span class="normal">9</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">CREATE</span><span class="w"> </span><span class="n">SERVER</span><span class="w"> </span><span class="n">dli_server</span><span class="w"> </span><span class="k">FOREIGN</span><span class="w"> </span><span class="k">DATA</span><span class="w"> </span><span class="n">WRAPPER</span><span class="w"> </span><span class="n">DFS_FDW</span><span class="w"> </span><span class="k">OPTIONS</span><span class="w"> </span><span class="p">(</span><span class="w"> </span>
|
|
<span class="w"> </span><span class="n">address</span><span class="w"> </span><span class="s1">'obs.xxx.xxx.com'</span><span class="p">,</span><span class="w"> </span>
|
|
<span class="w"> </span><span class="n">access_key</span><span class="w"> </span><span class="s1">'xxxxxxxxx'</span><span class="p">,</span><span class="w"> </span>
|
|
<span class="w"> </span><span class="n">secret_access_key</span><span class="w"> </span><span class="s1">'yyyyyyyyyyyyy'</span><span class="p">,</span><span class="w"> </span>
|
|
<span class="w"> </span><span class="k">type</span><span class="w"> </span><span class="s1">'dli'</span><span class="p">,</span>
|
|
<span class="w"> </span><span class="n">dli_address</span><span class="w"> </span><span class="s1">'dli.xxx.xxx.com'</span><span class="p">,</span>
|
|
<span class="w"> </span><span class="n">dli_access_key</span><span class="w"> </span><span class="s1">'xxxxxxxxx'</span><span class="p">,</span>
|
|
<span class="w"> </span><span class="n">dli_secret_access_key</span><span class="w"> </span><span class="s1">'yyyyyyyyyyyyy'</span>
|
|
<span class="p">);</span>
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
<p id="EN-US_TOPIC_0000001188429072__p15567195164413">You are advised to create another server in the homogeneous cluster, where <strong id="EN-US_TOPIC_0000001188429072__b58210918263">gc_fdw</strong> is the foreign data wrapper in the database:</p>
|
|
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001188429072__screen11567205134412"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
|
|
<span class="normal">2</span>
|
|
<span class="normal">3</span>
|
|
<span class="normal">4</span>
|
|
<span class="normal">5</span>
|
|
<span class="normal">6</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">CREATE</span><span class="w"> </span><span class="n">SERVER</span><span class="w"> </span><span class="n">server_remote</span><span class="w"> </span><span class="k">FOREIGN</span><span class="w"> </span><span class="k">DATA</span><span class="w"> </span><span class="n">WRAPPER</span><span class="w"> </span><span class="n">GC_FDW</span><span class="w"> </span><span class="k">OPTIONS</span><span class="w"> </span>
|
|
<span class="w"> </span><span class="p">(</span><span class="n">address</span><span class="w"> </span><span class="s1">'10.10.0.100:25000,10.10.0.101:25000'</span><span class="p">,</span>
|
|
<span class="w"> </span><span class="n">dbname</span><span class="w"> </span><span class="s1">'test'</span><span class="p">,</span><span class="w"> </span>
|
|
<span class="w"> </span><span class="n">username</span><span class="w"> </span><span class="s1">'test'</span><span class="p">,</span><span class="w"> </span>
|
|
<span class="w"> </span><span class="n">password</span><span class="w"> </span><span class="s1">'{Password}'</span>
|
|
<span class="p">);</span>
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001188429072__section12361165818307"><h4 class="sectiontitle">Helpful Links</h4><p id="EN-US_TOPIC_0000001188429072__p16361195813014"><a href="dws_06_0138.html">ALTER SERVER</a> <a href="dws_06_0206.html">DROP SERVER</a></p>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="dws_06_0118.html">DDL Syntax</a></div>
|
|
</div>
|
|
</div>
|
|
|