forked from docs/doc-exports
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>
88 lines
25 KiB
HTML
88 lines
25 KiB
HTML
<a name="EN-US_TOPIC_0000001707293985"></a><a name="EN-US_TOPIC_0000001707293985"></a>
|
|
|
|
<h1 class="topictitle1">Tutorial: Converting a Physical Cluster That Contains Data into a Logical Cluster</h1>
|
|
<div id="body8662426"><div class="section" id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_section913311128432"><h4 class="sectiontitle">Scenario</h4><p id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_p0442151245213">A large database cluster usually contains a large amount of data put in different tables. With the resource management feature, you can create resource pools to isolate the resources of different services. Different service users can be allocated to different resource pools to reduce resource (CPU, memory, I/O, and storage) competition between services.</p>
|
|
<p id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_p667543394616">As the service scale grows, the number of services in the cluster system also increases. Creating multiple resource pools becomes less effective in controlling resource competition. GaussDB(DWS) uses the distributed architecture. and its data is distributed on multiple nodes. Each table is distributed across all DNs in the cluster, an operation on a data table may involve all DNs, which increases network loads and system resource consumption. To solve this problem, scale-out is not effective. You are advised to divide a GaussDB(DWS) cluster into multiple logical clusters.</p>
|
|
<p id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_p19593172011461">You can create a separate logical cluster and assign new services to it. This way, new services have little impact on existing services. Also, if the service scale in existing logical clusters grows, you can scale out the existing logical clusters.</p>
|
|
<p id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_p8127191515592"><a href="#EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_fig102761610113915">Figure 1</a> shows an example. The original service data tables of a company are stored in the original physical cluster <strong id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_b18556195445213">dws-demo</strong> (in green). After services are switched over to the logical cluster <strong id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_b8844148135319">lc1</strong> (in blue), a new logical cluster <strong id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_b196351213175313">lc2</strong> is added to the physical cluster through scale-out. The original service data tables are switched to logical cluster <strong id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_b1676442655313">lc1</strong>, and new service data tables are written to logical cluster <strong id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_b1188413515318">lc2</strong>. In this way, the data of old and new services is isolated. User <strong id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_b124927109541">u2</strong> associated with logical cluster <strong id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_b02112150546">lc2</strong> can access the tables of logical cluster <strong id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_b057252215417">lc1</strong> across logical clusters after authorization.</p>
|
|
<ul id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_ul4517192213476"><li id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_li18517152224718"><strong id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_b1682516134557">Cluster scale</strong>: Scale out the original physical cluster from three nodes to six nodes and split it into two logical clusters.</li><li id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_li14517182220475"><strong id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_b1256613605518">Service isolation</strong>: New and old service data is isolated in different logical clusters.</li></ul>
|
|
</div>
|
|
<div class="fignone" id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_fig102761610113915"><a name="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_fig102761610113915"></a><a name="en-us_topic_0000001566787932_fig102761610113915"></a><span class="figcap"><b>Figure 1 </b>Accessing data across logical clusters</span><br><span><img class="imgResize" id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_image1963611123214" src="figure/en-us_image_0000001711661644.png" title="Click to enlarge"></span></div>
|
|
<div class="section" id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_section752613914812"><h4 class="sectiontitle">Creating a Cluster and Preparing Table Data</h4><ol id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_ol2261155145218"><li id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_li8261355115212"><span>Create a cluster. For details, see <a href="dws_01_0019.html">Creating a Cluster</a>.</span></li><li id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_li114621356145212"><span>After connecting to the database, create table <strong id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_b92551018185317">t1</strong> as the system administrator <strong id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_b1287142016531">dbadmin</strong> and insert two data records into the table.</span><p><div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_screen19531145815392"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
|
|
<span class="normal">2</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">CREATE</span><span class="w"> </span><span class="k">TABLE</span><span class="w"> </span><span class="n">t1</span><span class="w"> </span><span class="p">(</span><span class="n">id</span><span class="w"> </span><span class="nb">int</span><span class="p">,</span><span class="w"> </span><span class="n">name</span><span class="w"> </span><span class="nb">varchar</span><span class="p">(</span><span class="mi">20</span><span class="p">));</span>
|
|
<span class="k">INSERT</span><span class="w"> </span><span class="k">INTO</span><span class="w"> </span><span class="n">t1</span><span class="w"> </span><span class="k">VALUES</span><span class="w"> </span><span class="p">(</span><span class="mi">1</span><span class="p">,</span><span class="s1">'joy'</span><span class="p">),(</span><span class="mi">2</span><span class="p">,</span><span class="s1">'lily'</span><span class="p">);</span>
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
</p></li></ol>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_section1567910177428"><h4 class="sectiontitle">Converting to Logical Cluster lc1</h4><div class="notice" id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_note11551121216588"><span class="noticetitle"><img src="public_sys-resources/notice_3.0-en-us.png"> </span><div class="noticebody"><p id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_p7699181316580">During the conversion, you can run simple DML statements, such as adding, deleting, modifying, and querying data. Complex DDL statements, such as operations on database objects, will block services. You are advised to perform the conversion during off-peak hours.</p>
|
|
</div></div>
|
|
<ol id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_ol8570162144312"><li id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_li7570192184316"><span>Log in to the GaussDB(DWS) console. In the navigation pane, choose <strong id="EN-US_TOPIC_0000001707293985__b20622162213582">Clusters > Dedicated Cluster</strong>. Click the name of a cluster to go to the <strong id="EN-US_TOPIC_0000001707293985__b19622152218588">Cluster Information</strong> page.</span></li><li id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_li202154516437"><span>Toggle on the <strong id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_b17859838165915">Logical Cluster</strong> switch.</span><p><div class="fignone" id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_fig97242174418"><span class="figcap"><b>Figure 2 </b>Enabling the logical cluster function</span><br><span><img id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_image15898181134415" src="figure/en-us_image_0000001711821148.png" title="Click to enlarge" class="imgResize"></span></div>
|
|
</p></li><li id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_li16587145917433"><span>In the navigation pane, choose <strong id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_b172989384016">Logical Clusters</strong>. Click <strong id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_b206533121819">Add Logical Cluster</strong> in the upper right corner, enter the logical cluster name <strong id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_b12821827517">lc1</strong>, and click <strong id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_b17462229116">OK</strong>.</span><p><p id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_p1569194315016">During the switchover, the current cluster is unavailable. Wait for about 2 minutes (the conversion time varies depending on the service data volume). If <strong id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_b2375174611111">lc1</strong> is displayed on the logical cluster page, the conversion is successful.</p>
|
|
<div class="fignone" id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_fig1422143105015"><span class="figcap"><b>Figure 3 </b>Adding a logical cluster</span><br><span><img id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_image522184325018" src="figure/en-us_image_0000001759420733.png" title="Click to enlarge" class="imgResize"></span></div>
|
|
<div class="fignone" id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_fig18580151562017"><span class="figcap"><b>Figure 4 </b>Logical cluster conversion succeeded</span><br><span><img id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_image2049522102014" src="figure/en-us_image_0000001711661648.png" title="Click to enlarge" class="imgResize"></span></div>
|
|
</p></li></ol>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_section11147445182611"><h4 class="sectiontitle">Adding Nodes to the elastic_group Cluster</h4><ol id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_ol114716453260"><li id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_li1514717459263"><span>Return to the <strong id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_b10354824236">Cluster Management</strong> page. In the <strong id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_b338384811316">Operation</strong> column of the cluster, choose <strong id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_b97035144">More</strong> > <strong id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_b8236681416">Scale Node</strong> > <strong id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_b1739321217415">Scale Out</strong>.</span><p><div class="fignone" id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_fig1714724562620"><span class="figcap"><b>Figure 5 </b>Scaling out a cluster</span><br><span><img id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_image5147144592619" src="figure/en-us_image_0000001759580585.png" title="Click to enlarge" class="imgResize"></span></div>
|
|
</p></li><li id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_li12147164519261"><span>Set <strong id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_b93218121758">New Nodes</strong> to <strong id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_b194674185518">3</strong>. Enable <strong id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_b1655718554415">Online Scale-out</strong>. Set <strong id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_b465018361651">elastic_group</strong> as the target logical cluster. Confirm the settings, select the confirmation check box, and click <strong id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_b38537914297">Next: Confirm</strong>.</span><p><div class="fignone" id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_fig11464144443211"><span class="figcap"><b>Figure 6 </b>Scale-out process</span><br><span><img id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_image6289315141710" src="figure/en-us_image_0000001759420737.png" title="Click to enlarge" class="imgResize"></span></div>
|
|
</p></li><li id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_li16147045102615"><span>Click <strong id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_b1328212116334">Next: Confirm</strong>, and then click <strong id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_b159002717338">OK</strong>.</span><p><p id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_p52113514385">Wait for about 10 minutes until the scale-out is successful.</p>
|
|
</p></li></ol>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_section13622123319392"><h4 class="sectiontitle">Adding Logical Cluster lc2</h4><ol id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_ol8948540193920"><li id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_li5948640203910"><span>On the <strong id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_b192901646132218">Cluster Management</strong> page, click the name of a cluster to go to the cluster details page. In the navigation pane, choose <strong id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_b07881955182214">Logical Clusters</strong>.</span></li><li id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_li18395185614450"><span>Click <strong id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_b674611373261">Add Logical Cluster</strong> in the upper right corner, select three nodes from the right pane to add to the left pane, enter the logical cluster name <strong id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_b364214910265">lc2</strong>, and click <strong id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_b9829145082614">OK</strong>.</span><p><p id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_p496772815112">After about 2 minutes, the logical cluster is successfully added.</p>
|
|
<div class="fignone" id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_fig1375215271517"><span class="figcap"><b>Figure 7 </b>Adding a logical cluster</span><br><span><img id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_image5752827713" src="figure/en-us_image_0000001711661652.png" title="Click to enlarge" class="imgResize"></span></div>
|
|
<div class="fignone" id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_fig20753162715113"><span class="figcap"><b>Figure 8 </b>Selecting a host ring</span><br><span><img id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_image475218271713" src="figure/en-us_image_0000001759580589.png" title="Click to enlarge" class="imgResize"></span></div>
|
|
<div class="fignone" id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_fig12581161015810"><span class="figcap"><b>Figure 9 </b>Logical cluster added</span><br><span><img id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_image39482038155516" src="figure/en-us_image_0000001711821156.png" title="Click to enlarge" class="imgResize"></span></div>
|
|
<p id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_p20849123786"></p>
|
|
</p></li></ol>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_section1539819470216"><h4 class="sectiontitle">Creating Logical Clusters, Associating Them with Users, and Querying Data Across Logical Clusters</h4><ol id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_ol13114157638"><li id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_li81141771638"><span>Connect to the database as the system administrator and run the following SQL statement to query the original service table <strong id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_b1996910297354">t1</strong>:</span><p><p id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_p8791154173517">Verify that service data can be queried after the conversion.</p>
|
|
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_screen9948725143614"><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">SELECT</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="k">FROM</span><span class="w"> </span><span class="n">t1</span><span class="p">;</span>
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
</p></li><li id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_li16495642181016"><span>Run the following statements to associate <strong id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_b553818205192">u1</strong> with logical cluster <strong id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_b792616222193">lc1</strong> and <strong id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_b18400202461913">u2</strong> with logical cluster <strong id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_b9775142561917">lc2</strong>, and grant all permissions of the original service table <strong id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_b798916284199">t1</strong> to user <strong id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_b18901329111916">u1</strong>:</span><p><div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_screen3815411133714"><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="k">USER</span><span class="w"> </span><span class="n">u1</span><span class="w"> </span><span class="n">NODE</span><span class="w"> </span><span class="k">GROUP</span><span class="w"> </span><span class="s1">'lc1'</span><span class="w"> </span><span class="n">password</span><span class="w"> </span><span class="s1">'{password}'</span><span class="p">;</span>
|
|
<span class="k">CREATE</span><span class="w"> </span><span class="k">USER</span><span class="w"> </span><span class="n">u2</span><span class="w"> </span><span class="n">NODE</span><span class="w"> </span><span class="k">GROUP</span><span class="w"> </span><span class="s1">'lc2'</span><span class="w"> </span><span class="n">password</span><span class="w"> </span><span class="s1">'{password}'</span><span class="p">;</span>
|
|
<span class="k">GRANT</span><span class="w"> </span><span class="k">ALL</span><span class="w"> </span><span class="k">ON</span><span class="w"> </span><span class="k">TABLE</span><span class="w"> </span><span class="n">t1</span><span class="w"> </span><span class="k">TO</span><span class="w"> </span><span class="n">u1</span><span class="p">;</span>
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
</p></li><li id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_li62801152373"><span>Switch to user <strong id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_b814913359193">u2</strong> and query data in the original service table <strong id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_b16484104717193">t1</strong>. A message is displayed, indicating that you do not have the permission to access logical cluster <strong id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_b189285591199">lc1</strong>. This indicates data is isolated between logical clusters.</span><p><div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_screen1059618122270"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
|
|
<span class="normal">2</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">SET</span><span class="w"> </span><span class="k">ROLE</span><span class="w"> </span><span class="n">u2</span><span class="w"> </span><span class="n">PASSWORD</span><span class="w"> </span><span class="s1">'{password}'</span><span class="p">;</span>
|
|
<span class="k">SELECT</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="k">FROM</span><span class="w"> </span><span class="n">t1</span><span class="p">;</span>
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
<p id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_p1431216124298"><span><img id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_image4986630202710" src="figure/en-us_image_0000001711661656.png" title="Click to enlarge" class="imgResize"></span></p>
|
|
</p></li><li id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_li154880399266"><span>Switch back to system administrator <strong id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_b358014259207">dbadmin</strong> and grant the access permission of logical cluster <strong id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_b1136523162016">lc1</strong> to user <strong id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_b6133113082018">u2</strong>.</span><p><div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_screen195241817123010"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
|
|
<span class="normal">2</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">SET</span><span class="w"> </span><span class="k">ROLE</span><span class="w"> </span><span class="n">dbadmin</span><span class="w"> </span><span class="n">PASSWORD</span><span class="w"> </span><span class="s1">'{password}'</span><span class="p">;</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="n">NODE</span><span class="w"> </span><span class="k">GROUP</span><span class="w"> </span><span class="n">lc1</span><span class="w"> </span><span class="k">TO</span><span class="w"> </span><span class="n">u2</span><span class="p">;</span>
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
</p></li><li id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_li14452050142920"><span>Switch to user <strong id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_b014843617202">u2</strong> and query the <strong id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_b19983123712202">t1</strong> table. This proves that the user bound to logical cluster <strong id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_b1133417612213">lc2</strong> can query the original service table <strong id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_b99821989213">t1</strong> across logical clusters. In this way, data is shared between logical clusters.</span><p><div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_screen164691833193211"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
|
|
<span class="normal">2</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">SET</span><span class="w"> </span><span class="k">ROLE</span><span class="w"> </span><span class="n">u2</span><span class="w"> </span><span class="n">PASSWORD</span><span class="w"> </span><span class="s1">'{password}'</span><span class="p">;</span>
|
|
<span class="k">SELECT</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="k">FROM</span><span class="w"> </span><span class="n">t1</span><span class="p">;</span>
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
<p id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_p9361926183215"><span><img id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_image14582827163212" src="figure/en-us_image_0000001759580593.png" title="Click to enlarge" class="imgResize"></span></p>
|
|
</p></li></ol>
|
|
<p id="EN-US_TOPIC_0000001707293985__en-us_topic_0000001566787932_p99585214387"></p>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="dws_01_0724.html">Managing Logical Clusters</a></div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<script language="JavaScript">
|
|
<!--
|
|
image_size('.imgResize');
|
|
var msg_imageMax = "view original image";
|
|
var msg_imageClose = "close";
|
|
//--></script> |