Yang, Tong 48706b7552 MRS COMP-LTS 320-lts.1 version
Reviewed-by: Kacur, Michal <michal.kacur@t-systems.com>
Co-authored-by: Yang, Tong <yangtong2@huawei.com>
Co-committed-by: Yang, Tong <yangtong2@huawei.com>
2024-04-12 12:51:10 +00:00

38 lines
8.4 KiB
HTML

<a name="mrs_01_24158"></a><a name="mrs_01_24158"></a>
<h1 class="topictitle1">Using the IoTDB Client</h1>
<div id="body0000001582950981"><div class="section" id="mrs_01_24158__section19711308216"><h4 class="sectiontitle">Scenario</h4><p id="mrs_01_24158__p5736123485415">This section describes how to use the IoTDB client in the O&amp;M or service scenario.</p>
</div>
<div class="section" id="mrs_01_24158__section19973591632"><h4 class="sectiontitle">Prerequisites</h4><ul id="mrs_01_24158__ul11736334115416"><li id="mrs_01_24158__li1473613445415">The client has been installed. For example, the installation directory is <strong id="mrs_01_24158__b1593415181718"><span id="mrs_01_24158__ph79301513173">/opt/client</span></strong>. The client directory in the following operations is only an example. Change it based on the actual installation directory onsite.</li><li id="mrs_01_24158__li9736183418540">Service component users have been created by the MRS cluster administrator. In security mode, machine-machine users need to download the keytab file. A human-machine user must change the password upon the first login.</li></ul>
</div>
<div class="section" id="mrs_01_24158__section107711554775"><h4 class="sectiontitle">Procedure</h4><ol id="mrs_01_24158__ol126311106119"><li id="mrs_01_24158__li1726381018114"><span>Log in to the node where the client is installed as the client installation user.</span></li><li id="mrs_01_24158__li1026820104388"><span>Run the following command to go to the client installation directory:</span><p><p id="mrs_01_24158__p1226851011382"><strong id="mrs_01_24158__b102684104382">cd <span id="mrs_01_24158__ph1268151010386">/opt/client</span></strong></p>
</p></li><li id="mrs_01_24158__li865819259387"><span>Run the following command to configure environment variables:</span><p><p id="mrs_01_24158__p165852573815"><strong id="mrs_01_24158__b2658122553816">source bigdata_env</strong></p>
</p></li><li id="mrs_01_24158__li87385520014"><span>Run the following command to generate a client SSL certificate:</span><p><p id="mrs_01_24158__p14851174579"><strong id="mrs_01_24158__b14724155821211">keytool -noprompt -import -alias myservercert -file ca.crt -keystore truststore.jks</strong></p>
<p id="mrs_01_24158__p1562374584411">After running this command, you are required to set a password.</p>
</p></li><li id="mrs_01_24158__li147211320125010"><span>Copy the generated <strong id="mrs_01_24158__b12173039152618">truststore.jks</strong> file to the <strong id="mrs_01_24158__b5608357172611"><em id="mrs_01_24158__i681343385017">Client installation directory</em></strong><strong id="mrs_01_24158__b1760855710263">/IoTDB/iotdb/conf</strong> directory.</span><p><p id="mrs_01_24158__p16352192917219"><strong id="mrs_01_24158__b173184232024">cp truststore.jks</strong> <em id="mrs_01_24158__i152869181926">Client installation directory</em><strong id="mrs_01_24158__b130219271122">/IoTDB/iotdb/conf</strong></p>
</p></li><li id="mrs_01_24158__li15263191081118"><a name="mrs_01_24158__li15263191081118"></a><a name="li15263191081118"></a><span>Log in to the IoTDB client based on the cluster authentication mode.</span><p><ul id="mrs_01_24158__ul15263141018113"><li id="mrs_01_24158__li12263111017112">In security mode, run the following command to authenticate the user and log in to the IoTDB client:<p id="mrs_01_24158__p1326313109110"><a name="mrs_01_24158__li12263111017112"></a><a name="li12263111017112"></a><strong id="mrs_01_24158__b2087578600101425">kinit</strong> <em id="mrs_01_24158__i677377111101425">Component service user</em></p>
</li><li id="mrs_01_24158__li1226351061110">Skip this step in normal mode.</li></ul>
</p></li><li id="mrs_01_24158__li426351017115"><span>Run the following command to switch to the directory where the IoTDB client running script is stored:</span><p><p id="mrs_01_24158__p11263181041120"><strong id="mrs_01_24158__b726351031117">cd <span id="mrs_01_24158__ph14656144310455">/opt/client</span>/IoTDB/iotdb/sbin</strong></p>
</p></li><li id="mrs_01_24158__li02635109113"><span>Run the following command to log in to the client:</span><p><p id="mrs_01_24158__p9263310161112"><strong id="mrs_01_24158__b19383195212366">./start-cli.sh</strong> <strong id="mrs_01_24158__b1784016572361">-h</strong> <em id="mrs_01_24158__i1096817611372">IP address of the IoTDBServer instance node</em> <strong id="mrs_01_24158__b675222033717">-p</strong> <em id="mrs_01_24158__i104241231173710">IoTDBServer RPC port</em></p>
<p id="mrs_01_24158__p13656269549">After you run this command, specify the service username as required.</p>
<ul id="mrs_01_24158__ul9773644154020"><li id="mrs_01_24158__li1677324418404">To specify the service username, enter <strong id="mrs_01_24158__b5991938201818">yes</strong> and enter the service username and password as prompted.<p id="mrs_01_24158__p1532273675314"><span><img id="mrs_01_24158__image49705115425" src="en-us_image_0000001532791960.png"></span></p>
</li></ul>
<ul id="mrs_01_24158__ul144912529459"><li id="mrs_01_24158__li34918526456">If you will not specify the service username, enter <strong id="mrs_01_24158__b290915592275">no</strong>. In this case, you will perform subsequent operations as the user in <a href="#mrs_01_24158__li15263191081118">6</a>.<p id="mrs_01_24158__p11459114615314"><span><img id="mrs_01_24158__image165962644411" src="en-us_image_0000001583151877.png"></span></p>
</li><li id="mrs_01_24158__li71731136114619">If you enter other information, you will log out.<p id="mrs_01_24158__p641619111397"><a name="mrs_01_24158__li71731136114619"></a><a name="li71731136114619"></a><span><img id="mrs_01_24158__image1824155773715" src="en-us_image_0000001583391873.png"></span></p>
</li></ul>
<div class="note" id="mrs_01_24158__note8852934132618"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="mrs_01_24158__ul62226174217"><li id="mrs_01_24158__li11222617112118">When you log in to the client, you can configure the <strong id="mrs_01_24158__b7471249298">-maxRPC</strong> parameter to control the number of lines of execution results to be printed at a time. The default value is <strong id="mrs_01_24158__b64773414293">1000</strong>. If the value of <strong id="mrs_01_24158__b13478124132919">-maxRPC</strong> is less than or equal to 0, all results are printed at a time. This parameter is typically used to redirect SQL execution results.</li><li id="mrs_01_24158__li686512932117">Meanwhile, you can optionally use the <strong id="mrs_01_24158__b18751112371316">-disableISO8601</strong> parameter to control the display format of the time column in the query result. If this parameter is not specified, the time is displayed in YYYYMMDDHHMMSS format. If this parameter is specified, the timestamp is displayed.</li><li id="mrs_01_24158__li15849203515211">If the SSL configuration is disabled on the server, you need to disable it on the client as follows:<p id="mrs_01_24158__p14494242205216"><a name="mrs_01_24158__li15849203515211"></a><a name="li15849203515211"></a><strong id="mrs_01_24158__b91368035320">cd</strong> <em id="mrs_01_24158__i2951135118523">Client installation directory</em><strong id="mrs_01_24158__b11411104165319">/IoTDB/iotdb/conf</strong></p>
<p id="mrs_01_24158__p20833183615319"><strong id="mrs_01_24158__b16883154918539">vi iotdb-client.env</strong></p>
<p id="mrs_01_24158__p17723185125315">Change the value of <strong id="mrs_01_24158__b10637172560">iotdb_ssl_enable</strong> to <strong id="mrs_01_24158__b16434191845617">false</strong>, save the configuration, and exit.</p>
<p id="mrs_01_24158__p2278937105212">To check the SSL configuration of the server, log in to FusionInsight Manager, choose <strong id="mrs_01_24158__b2036216195718">Cluster</strong> &gt; <strong id="mrs_01_24158__b69291317577">Services</strong> &gt; <strong id="mrs_01_24158__b12496132218594">IoTDB</strong> &gt; <strong id="mrs_01_24158__b737519262590">Configurations</strong>, and search for <strong id="mrs_01_24158__b1923413417595">SSL_ENABLE</strong>. Value <strong id="mrs_01_24158__b11701205711012">true</strong> indicates that SSL is enabled, and value <strong id="mrs_01_24158__b112071778118">false</strong> indicates that it is disabled.</p>
</li></ul>
</div></div>
</p></li><li id="mrs_01_24158__li426401011110"><span>After logging in to the client, you can run SQL statements.</span></li></ol>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="mrs_01_24144.html">Using IoTDB</a></div>
</div>
</div>