Yang, Tong 6182f91ba8 MRS component operation guide_normal 2.0.38.SP20 version
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
Co-authored-by: Yang, Tong <yangtong2@huawei.com>
Co-committed-by: Yang, Tong <yangtong2@huawei.com>
2022-12-09 14:55:21 +00:00

36 lines
7.9 KiB
HTML

<a name="mrs_01_0381"></a><a name="mrs_01_0381"></a>
<h1 class="topictitle1">Submitting Storm Topologies on the Client</h1>
<div id="body1589421630469"><div class="section" id="mrs_01_0381__se6b7b91686f741e68713b7d1b2d44f55"><h4 class="sectiontitle">Scenario</h4><p id="mrs_01_0381__acf4865e00888468eb202cfaa6d9ed14a">You can submit Storm topologies on the cluster client to continuously process stream data. For clusters with Kerberos authentication enabled, users who submit topologies must be members of the <span class="parmname" id="mrs_01_0381__parmname166046785216467"><b>stormadmin</b></span> or <span class="parmname" id="mrs_01_0381__parmname191514620016467"><b>storm</b></span> group.</p>
</div>
<div class="section" id="mrs_01_0381__s26390c77824e48628302cd27728a109b"><h4 class="sectiontitle">Prerequisites</h4><p id="mrs_01_0381__ac757846b821d4a94b74047b2c5b87bc4">The client has been updated.</p>
</div>
<div class="section" id="mrs_01_0381__s8bca61259f7943bfa5d387cbb7e90a5b"><h4 class="sectiontitle">Procedure</h4><ol id="mrs_01_0381__o1a1694aafb174694a4a0e67712a47f76"><li id="mrs_01_0381__l6bafa992ef354ebc8c1e16387160ae24"><span>Prepare the client based on service requirements. Log in to the node where the client is installed.</span></li><li id="mrs_01_0381__ld956f9c3c6e64b16a9b2eed2c0e4525c"><span>Run the following command to set the permissions on the topology JAR file:</span><p><p id="mrs_01_0381__ac2d4d429da9a4bbfbfc6307d74ae19d7">For example, run the following command to change the permissions on <strong id="mrs_01_0381__b36680960591442">/opt/storm/topology.jar</strong>:</p>
<p id="mrs_01_0381__a423165c53736460383fdeb0bb6c2a715"><strong id="mrs_01_0381__b437668164411">chmod 600 /opt/<span id="mrs_01_0381__ph364712219551">storm</span>/topology.jar</strong></p>
</p></li><li id="mrs_01_0381__ldc59b65d35af40029b69d717590c5ee1"><span>Run the following command to switch to the client directory, for example, <span class="filepath" id="mrs_01_0381__filepath1697754713612"><b>/opt/client</b></span>.</span><p><p id="mrs_01_0381__a5c7abf7d609e49daa21d689801c7665d"><strong id="mrs_01_0381__en-us_topic_0057061151_b539462609946">cd /opt/client</strong></p>
</p></li><li id="mrs_01_0381__lb12ce87c6e7946bb9a848a19a34c9e35"><span>Run the following command to configure environment variables:</span><p><p id="mrs_01_0381__af0f6bc7c36064c379eed07a5509d2ba2"><strong id="mrs_01_0381__a867f14eb42d44d819707ead5ac2ca425">source bigdata_env</strong></p>
</p></li><li id="mrs_01_0381__li1557613391425"><span>If multiple Storm instances are installed, run the following command to load the environment variables of a specific instance when running the Storm command to submit the topology. Otherwise, skip this step. The following command uses the instance Storm-2 as an example.</span><p><p id="mrs_01_0381__p1497814112069"><strong id="mrs_01_0381__b81002491560">source Storm-2/</strong><strong id="mrs_01_0381__b399113614613">component_env</strong></p>
</p></li><li id="mrs_01_0381__lb19afed2bbbf4a3d81e9242146b0ec02"><span>For clusters with Kerberos authentication enabled, run the following command to authenticate the user. For clusters with Kerberos authentication disabled, skip this step.</span><p><p id="mrs_01_0381__ae2143305619c412a820dbefd67e607b3"><strong id="mrs_01_0381__b347683414487">kinit</strong> <em id="mrs_01_0381__i12481133413483">Storm user</em></p>
</p></li><li id="mrs_01_0381__li173182463219"><span>For versions earlier than MRS 3.x, run the following command to submit the Storm topology:</span><p><p id="mrs_01_0381__p19733132411320"><strong id="mrs_01_0381__b7651112894219">storm jar</strong> <em id="mrs_01_0381__i156561628174215">Path of the topology package Class name of the topology Main method Topology name</em></p>
<p id="mrs_01_0381__p167476249328">If the following information is displayed, the topology is submitted successfully.</p>
<pre class="screen" id="mrs_01_0381__screen174816248323">Finished submitting topology: topo1</pre>
<div class="note" id="mrs_01_0381__note874819249324"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="mrs_01_0381__ul1175016244324"><li id="mrs_01_0381__li167501240325">To support sampling messages, add the <span class="parmname" id="mrs_01_0381__en-us_topic_0057061151_parmname1055155681165431"><b>topology.debug</b></span> and <span class="parmname" id="mrs_01_0381__en-us_topic_0057061151_parmname1209976651165431"><b>topology.eventlogger.executors</b></span> parameters.</li><li id="mrs_01_0381__li1975442443211">Data processing methods vary with topologies. The topology in the example generates characters randomly and separates character strings. To query the processing status, enable the sampling function and perform operations according to <a href="mrs_01_0384.html">Querying Storm Topology Logs</a>.</li></ul>
</div></div>
</p></li><li id="mrs_01_0381__li1677818251323"><span>Run the following command to submit a topology task for MRS 3.x or later:</span><p><p id="mrs_01_0381__a299b2ad7ad7d4cbfbed64a1f1b4efadb"><strong id="mrs_01_0381__b141746414091442">storm jar </strong><em id="mrs_01_0381__i29106660191442">topology-jar-path </em><em id="mrs_01_0381__i57598850491442">class input parameter list</em></p>
<ul id="mrs_01_0381__ue49a16bc23674269a6d35d4882bc026b"><li id="mrs_01_0381__l378ca7aae3844bc5b4f68d10150f133a"><em id="mrs_01_0381__i89732181491442">topology-jar-path</em> indicates the path of the JAR file of the topology.</li><li id="mrs_01_0381__l17e25145dfa44a99851ba6d76d4ef793"><em id="mrs_01_0381__i171754240491442">class</em> indicates the class name of the main method used by the topology.</li><li id="mrs_01_0381__lf184e4c9c73f4838a88ee05841b2dd0b"><em id="mrs_01_0381__i130147014391442">Input parameter list</em> includes input parameters of the main method used by the topology.</li></ul>
<p id="mrs_01_0381__a2daa85cc29454518bad5e543517b1b47">If the following information is displayed, the topology is submitted successfully:</p>
<pre class="screen" id="mrs_01_0381__s549696e2bd4b4b098d5b1d86cbc3465d">Finished submitting topology: topology1</pre>
<div class="note" id="mrs_01_0381__note437134413315"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="mrs_01_0381__ul158014331498"><li id="mrs_01_0381__li358016332091">The login authentication user must correspond to the loaded environment variable (<strong id="mrs_01_0381__b107841592991442">component_env</strong>). Otherwise, an error occurs when you run the <strong id="mrs_01_0381__b159553261422">storm </strong>command to submit the topology task.</li><li id="mrs_01_0381__li1858019339916">After the client environment variable is loaded and the corresponding user login succeeds, the user can run the Storm command on any Storm client to submit the topology task. After the command is executed, the successfully submitted topology is still in the Storm cluster of the user.</li><li id="mrs_01_0381__li2058013331090">If cluster domain name is modified, you need to reset the domain name before submitting the topology. Run the cql statement<strong id="mrs_01_0381__b11457425164512"></strong><strong id="mrs_01_0381__b11460122514457"></strong><strong id="mrs_01_0381__b1587102419920"></strong>.</li></ul>
</div></div>
</p></li><li id="mrs_01_0381__lbe3cdaf67f5b4cf18419fbbdeb422302"><span>Run the following command to query Storm topologies. For clusters with Kerberos authentication enabled, only users in the <span class="parmname" id="mrs_01_0381__parmname13206405199"><b>stormadmin</b></span> or <span class="parmname" id="mrs_01_0381__parmname1032544061914"><b>storm</b></span> group can query all topologies.</span><p><p id="mrs_01_0381__adbde1f1e20f7494abb88a485fead6155"><strong id="mrs_01_0381__a7bd189f7b6ae4336b6718bc54889aecb">storm list</strong></p>
</p></li></ol>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="mrs_01_0380.html">Using Storm</a></div>
</div>
</div>