doc-exports/docs/dws/umn/dws_03_2132.html
Lu, Huayi 95132e24fc DWS UMN 830.201_new version
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com>
Reviewed-by: Rechenburg, Matthias <matthias.rechenburg@t-systems.com>
Co-authored-by: Lu, Huayi <luhuayi@huawei.com>
Co-committed-by: Lu, Huayi <luhuayi@huawei.com>
2024-05-27 11:54:34 +00:00

92 lines
15 KiB
HTML

<a name="EN-US_TOPIC_0000001384777037"></a><a name="EN-US_TOPIC_0000001384777037"></a>
<h1 class="topictitle1">How Applications Communicate with GaussDB(DWS)?</h1>
<div id="body0000001384777037"><p id="EN-US_TOPIC_0000001384777037__p8060118">For applications to communicate with GaussDB(DWS), make sure the networks between them are connected. The following table lists common connection scenarios.</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001384777037__table1551512347380" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Communication between applications and GaussDB(DWS)</caption><thead align="left"><tr id="EN-US_TOPIC_0000001384777037__row20516734113810"><th align="left" class="cellrowborder" colspan="2" valign="top" id="mcps1.3.2.2.5.1.1"><p id="EN-US_TOPIC_0000001384777037__p10376193520457">Scenario</p>
</th>
<th align="left" class="cellrowborder" valign="top" id="mcps1.3.2.2.5.1.2"><p id="EN-US_TOPIC_0000001384777037__p1351633453818">Description</p>
</th>
<th align="left" class="cellrowborder" valign="top" id="mcps1.3.2.2.5.1.3"><p id="EN-US_TOPIC_0000001384777037__p6307141754419">Supported Connection Type</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000001384777037__row12516183419389"><td class="cellrowborder" rowspan="3" valign="top" width="6.771790654928897%" headers="mcps1.3.2.2.5.1.1 "><p id="EN-US_TOPIC_0000001384777037__p2738447104519">Cloud</p>
</td>
<td class="cellrowborder" valign="top" width="35.01015768598239%" headers="mcps1.3.2.2.5.1.1 "><p id="EN-US_TOPIC_0000001384777037__p451633443816"><a href="#EN-US_TOPIC_0000001384777037__section33446188552">Service Application and GaussDB(DWS) Are in the Same VPC in the Same Region</a></p>
</td>
<td class="cellrowborder" valign="top" width="35.86146851117345%" headers="mcps1.3.2.2.5.1.2 "><p id="EN-US_TOPIC_0000001384777037__p951643423817">Two private IP addresses in the same VPC can directly communicate with each other.</p>
</td>
<td class="cellrowborder" rowspan="4" valign="top" width="22.356583147915256%" headers="mcps1.3.2.2.5.1.3 "><ul id="EN-US_TOPIC_0000001384777037__ul9474103615466"><li id="EN-US_TOPIC_0000001384777037__li347473610461">gsql</li><li id="EN-US_TOPIC_0000001384777037__li1447412361462">Data Studio</li><li id="EN-US_TOPIC_0000001384777037__li1447533614619">JDBC/ODBC</li></ul>
<p id="EN-US_TOPIC_0000001384777037__p125075815449">For more connection modes, see .</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001384777037__row95164346383"><td class="cellrowborder" valign="top" headers="mcps1.3.2.2.5.1.1 "><p id="EN-US_TOPIC_0000001384777037__p1151610343383"><a href="#EN-US_TOPIC_0000001384777037__section16436174022710">Service Applications and GaussDB(DWS) Are in Different VPCs in the Same Region</a></p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.3.2.2.5.1.1 "><p id="EN-US_TOPIC_0000001384777037__p13516034123817">After a <strong id="EN-US_TOPIC_0000001384777037__b122007390203">VPC peering</strong> connection is created between two VPCs, the two private IP addresses can directly communicate with each other.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001384777037__row151683493811"><td class="cellrowborder" valign="top" headers="mcps1.3.2.2.5.1.1 "><p id="EN-US_TOPIC_0000001384777037__p4516834143815"><a href="#EN-US_TOPIC_0000001384777037__section746241873814">Service Applications and GaussDB(DWS) Are in Different Regions</a></p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.3.2.2.5.1.1 "><p id="EN-US_TOPIC_0000001384777037__p35168343384">After a <strong id="EN-US_TOPIC_0000001384777037__b1587054318202">cloud connection</strong> (CC) is established between two regions, the two regions communicate with each other through private IP addresses.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001384777037__row12516173453813"><td class="cellrowborder" valign="top" headers="mcps1.3.2.2.5.1.1 "><p id="EN-US_TOPIC_0000001384777037__p937633510459">On-premises and on-cloud</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.3.2.2.5.1.1 "><p id="EN-US_TOPIC_0000001384777037__p451663418386"><a href="#EN-US_TOPIC_0000001384777037__section523413148620">Service applications are deployed in on-premise data centers and need to communicate with GaussDB(DWS).</a></p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.3.2.2.5.1.2 "><ul id="EN-US_TOPIC_0000001384777037__ul14641162214139"><li id="EN-US_TOPIC_0000001384777037__li1164114223139">Use the <strong id="EN-US_TOPIC_0000001384777037__b18872748102217">public IP address</strong> of GaussDB(DWS) for communication.</li><li id="EN-US_TOPIC_0000001384777037__li46416228138">Use <strong id="EN-US_TOPIC_0000001384777037__b046713715225">Direct Connect</strong> (DC) is for communication.</li></ul>
</td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="EN-US_TOPIC_0000001384777037__section33446188552"><a name="EN-US_TOPIC_0000001384777037__section33446188552"></a><a name="section33446188552"></a><h4 class="sectiontitle">Service Application and GaussDB(DWS) Are in the Same VPC in the Same Region</h4><p id="EN-US_TOPIC_0000001384777037__p13842112202518">To ensure low service latency, you are advised to deploy service applications and GaussDB(DWS) in the same region. For example, if a service application is deployed on an ECS, you are advised to deploy the data warehouse cluster in the same VPC as the ECS. In this way, the application can directly communicate with GaussDB(DWS) through an intranet IP address. In this case, deploy the data warehouse cluster in the same region and VPC where the ECS resides.</p>
<p id="EN-US_TOPIC_0000001384777037__p111631512183910">For example, if the ECS is deployed in , select for the GaussDB(DWS) cluster and ensure that the GaussDB(DWS) cluster and the ECS are both in <strong id="EN-US_TOPIC_0000001384777037__b187613027332333">VPC1</strong>. The private IP address of the ECS is <strong id="EN-US_TOPIC_0000001384777037__b143419989132333">192.168.120.1</strong>, the private IP address of GaussDB(DWS) is <strong id="EN-US_TOPIC_0000001384777037__b18236855332333">192.168.120.2</strong>. Therefore, they can communicate with each other through private IP addresses.</p>
<p id="EN-US_TOPIC_0000001384777037__p1223512419262">The key points in communication check are the ECS outbound rule and GaussDB(DWS) inbound rule. The check procedure is as follows:</p>
<ol id="EN-US_TOPIC_0000001384777037__ol523716712816"><li id="EN-US_TOPIC_0000001384777037__li65881338112811"><span><strong id="EN-US_TOPIC_0000001384777037__b166018351182">Check the ECS outbound rules:</strong></span><p><p id="EN-US_TOPIC_0000001384777037__p14735321378">Ensure that the outbound rule of the ECS security group allows access. If access is not allowed, see the .</p>
<p id="EN-US_TOPIC_0000001384777037__p127051032194020"><span><img id="EN-US_TOPIC_0000001384777037__image156529561405" src="figure/en-us_image_0000001389594973.png" title="Click to enlarge" class="imgResize"></span></p>
<p id="EN-US_TOPIC_0000001384777037__p351165534011"></p>
</p></li><li id="EN-US_TOPIC_0000001384777037__li1030822117372"><span><strong id="EN-US_TOPIC_0000001384777037__b169032453312">Check the GaussDB(DWS) inbound rules:</strong></span><p><p id="EN-US_TOPIC_0000001384777037__p915242218377">If no security group is configured when GaussDB(DWS) is created, the default inbound rule allows TCP access from all IPv4 addresses and port 8000. To ensure security, you can also allow only one IP address. For details, see </p>
<p id="EN-US_TOPIC_0000001384777037__p8753163743118"><span><img id="EN-US_TOPIC_0000001384777037__image11716133819319" src="figure/en-us_image_0000001389237417.png" title="Click to enlarge" class="imgResize"></span></p>
<p id="EN-US_TOPIC_0000001384777037__p7341948123619"></p>
</p></li><li id="EN-US_TOPIC_0000001384777037__li329763063716"><span>Log in to the ECS. If the internal IP address of GaussDB(DWS) can be pinged, the network connection is normal. If the IP address cannot be pinged, check the preceding configuration. If the ECS has a firewall, check the firewall configuration.</span></li></ol>
<p id="EN-US_TOPIC_0000001384777037__p9799164162017"><strong id="EN-US_TOPIC_0000001384777037__b19765105384317">Example of using gsql for connection:</strong></p>
<p id="EN-US_TOPIC_0000001384777037__p1887018162208"><strong id="EN-US_TOPIC_0000001384777037__b274181763417">gsql -d gaussdb -h </strong><em id="EN-US_TOPIC_0000001384777037__i42968181348">192.168.120.2</em><strong id="EN-US_TOPIC_0000001384777037__b8741171719340"> -p 8000 -U dbadmin -W </strong><em id="EN-US_TOPIC_0000001384777037__i1295751012218">password</em><strong id="EN-US_TOPIC_0000001384777037__b55751109216"> -r</strong></p>
</div>
<div class="section" id="EN-US_TOPIC_0000001384777037__section16436174022710"><a name="EN-US_TOPIC_0000001384777037__section16436174022710"></a><a name="section16436174022710"></a><h4 class="sectiontitle">Service Applications and GaussDB(DWS) Are in Different VPCs in the Same Region</h4><p id="EN-US_TOPIC_0000001384777037__p154361740122713">To ensure low service latency, you are advised to deploy service applications and GaussDB(DWS) in the same region. For example, if service applications are deployed on an ECS, you are advised to deploy the data warehouse cluster in the same VPC as the ECS. If a different VPC is selected for the data warehouse cluster, the ECS cannot directly connect to GaussDB(DWS).</p>
<p id="EN-US_TOPIC_0000001384777037__p104361040122711">For example, both ECS and GaussDB(DWS) are deployed in , but ECS is in VPC1 and GaussDB(DWS) is in VPC2. In this case, you need to create a between VPC1 and VPC2 so that ECS can access GaussDB(DWS) using the private IP address of GaussDB(DWS).</p>
<p id="EN-US_TOPIC_0000001384777037__p993432874511">The key points for checking the communication are the ECS outbound rules, GaussDB(DWS) inbound rules, and VPC peering connection. The check procedure is as follows:</p>
<ol id="EN-US_TOPIC_0000001384777037__ol3934152818450"><li id="EN-US_TOPIC_0000001384777037__li9935528124515"><span><strong id="EN-US_TOPIC_0000001384777037__b38322444410">Check the ECS outbound rules:</strong></span><p><p id="EN-US_TOPIC_0000001384777037__p1593562854514">Ensure that the outbound rule of the ECS security group allows access. If access is not allowed, see the .</p>
<p id="EN-US_TOPIC_0000001384777037__p159354280455"><span><img id="EN-US_TOPIC_0000001384777037__image39351128164515" src="figure/en-us_image_0000001389597281.png" title="Click to enlarge" class="imgResize"></span></p>
<p id="EN-US_TOPIC_0000001384777037__p7935132874517"></p>
</p></li><li id="EN-US_TOPIC_0000001384777037__li2093413286456"><span><strong id="EN-US_TOPIC_0000001384777037__b1791191564517">Check the GaussDB(DWS) inbound rules:</strong></span><p><p id="EN-US_TOPIC_0000001384777037__p4934228194514">If no security group is configured when GaussDB(DWS) is created, the default inbound rule allows TCP access from all IPv4 addresses and port 8000. To ensure security, you can also allow only one IP address. For details, see </p>
<p id="EN-US_TOPIC_0000001384777037__p1193514286455"><span><img id="EN-US_TOPIC_0000001384777037__image79351028184517" src="figure/en-us_image_0000001339077346.png" title="Click to enlarge" class="imgResize"></span></p>
<p id="EN-US_TOPIC_0000001384777037__p15935162834516"></p>
</p></li><li id="EN-US_TOPIC_0000001384777037__li18443252469"><span>Create a between VPC1 where the ECS is and VPC2 where GaussDB(DWS) is.</span></li><li id="EN-US_TOPIC_0000001384777037__li9935152817451"><span>Log in to the ECS. If the internal IP address of GaussDB(DWS) can be pinged, the network connection is normal. If the IP address cannot be pinged, check the preceding configuration. If the ECS has a firewall, check the firewall configuration.</span></li></ol>
<p id="EN-US_TOPIC_0000001384777037__p19436540102714"><strong id="EN-US_TOPIC_0000001384777037__b024535124514">Example of using gsql for connection:</strong></p>
<p id="EN-US_TOPIC_0000001384777037__p1343616406271"><strong id="EN-US_TOPIC_0000001384777037__b156272012143411">gsql -d gaussdb -h</strong> <em id="EN-US_TOPIC_0000001384777037__i361141316342">192.168.120.2</em> <strong id="EN-US_TOPIC_0000001384777037__b19627151217347">-p 8000 -U dbadmin -W</strong> <em id="EN-US_TOPIC_0000001384777037__i7436174062720">password</em> <strong id="EN-US_TOPIC_0000001384777037__b13436114018274">-r</strong></p>
</div>
<div class="section" id="EN-US_TOPIC_0000001384777037__section746241873814"><a name="EN-US_TOPIC_0000001384777037__section746241873814"></a><a name="section746241873814"></a><h4 class="sectiontitle">Service Applications and GaussDB(DWS) Are in Different Regions</h4><p id="EN-US_TOPIC_0000001384777037__p1621431911387">If the service application and GaussDB(DWS) are in different regions, for example, ECS is in and GaussDB(DWS) is in , you need to establish a between the two regions for communication.</p>
</div>
<div class="section" id="EN-US_TOPIC_0000001384777037__section523413148620"><a name="EN-US_TOPIC_0000001384777037__section523413148620"></a><a name="section523413148620"></a><h4 class="sectiontitle">Service applications are deployed in on-premise data centers and need to communicate with GaussDB(DWS).</h4><p id="EN-US_TOPIC_0000001384777037__p10531715161">If service applications are not on the cloud but in the local data center, they need to communicate with GaussDB(DWS) on the cloud.</p>
<ul id="EN-US_TOPIC_0000001384777037__ul08492017162713"><li id="EN-US_TOPIC_0000001384777037__li1384971722712"><strong id="EN-US_TOPIC_0000001384777037__b1189210591246">Scenario 1</strong>: On-premises service applications communicate with GaussDB(DWS) through GaussDB(DWS) public IP addresses.<p id="EN-US_TOPIC_0000001384777037__p758117377218">Example of using gsql for connection:</p>
<p id="EN-US_TOPIC_0000001384777037__p1658118371216"><strong id="EN-US_TOPIC_0000001384777037__b16332146172119">gsql -d gaussdb -h</strong> <em id="EN-US_TOPIC_0000001384777037__i16858981288">public_IP_address</em> <strong id="EN-US_TOPIC_0000001384777037__b1858213772119">-p 8000 -U dbadmin -W</strong> <em id="EN-US_TOPIC_0000001384777037__i35821537182114">password</em> <strong id="EN-US_TOPIC_0000001384777037__b6582113718214">-r</strong></p>
</li></ul>
<ul id="EN-US_TOPIC_0000001384777037__ul1356922532710"><li id="EN-US_TOPIC_0000001384777037__li456912562720"><strong id="EN-US_TOPIC_0000001384777037__b1860817531196">Scenario 2</strong>: On-premises services cannot access the external network. In this case, is required for communication.<p id="EN-US_TOPIC_0000001384777037__p104761911718"></p>
</li></ul>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="dws_03_0024.html">Database Connections</a></div>
</div>
</div>
<script language="JavaScript">
<!--
image_size('.imgResize');
var msg_imageMax = "view original image";
var msg_imageClose = "close";
//--></script>