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

34 lines
6.8 KiB
HTML

<a name="mrs_01_1058"></a><a name="mrs_01_1058"></a>
<h1 class="topictitle1">Using Environment Variables in the <strong id="b122423008195737">properties.properties</strong> File</h1>
<div id="body1590374507202"><div class="section" id="mrs_01_1058__section12555152919569"><h4 class="sectiontitle">Scenario</h4><p id="mrs_01_1058__p117046135614">This section describes how to use environment variables in the <span class="filepath" id="mrs_01_1058__filepath19122132125713"><b>properties.properties</b></span> configuration file.</p>
<p id="mrs_01_1058__p368722575015">This section applies to MRS 3.<em id="mrs_01_1058__i19149121217557">x</em> or later clusters.</p>
</div>
<div class="section" id="mrs_01_1058__section10507114814810"><h4 class="sectiontitle">Prerequisites</h4><p id="mrs_01_1058__p116666273506">The Flume service is running properly and the Flume client has been installed.</p>
</div>
<div class="section" id="mrs_01_1058__section10848424135713"><h4 class="sectiontitle">Procedure</h4><ol id="mrs_01_1058__ol16230164595713"><li id="mrs_01_1058__l104f86ac05e2439f8f5d92f2e259f4bf"><span>Log in to the node where the Flume client is installed as user <strong id="mrs_01_1058__b215831415436">root</strong>.</span></li><li id="mrs_01_1058__la850c196adc8463b938a2f7b74086cf6"><span>Switch to the following directory:</span><p><p id="mrs_01_1058__a0e7218b971b446ffb06097a4968b704d"><strong id="mrs_01_1058__b98788912157">cd </strong><em id="mrs_01_1058__i795758162312">Flume client installation directory</em>/<strong id="mrs_01_1058__b1036815642412">fusioninsight-flume</strong>-<span id="mrs_01_1058__text89595810236"><em id="mrs_01_1058__i13951588233">Flume component version</em></span>/<strong id="mrs_01_1058__b18051852415">conf</strong></p>
</p></li><li id="mrs_01_1058__li87011950135713"><span>Add environment variables to the <strong id="mrs_01_1058__b1117374419440">flume-env.sh</strong> file in the directory.</span><p><ul id="mrs_01_1058__ul2471622818"><li id="mrs_01_1058__li94131618288">Format:<pre class="screen" id="mrs_01_1058__screen16294154810288">export <em id="mrs_01_1058__i1029614819283">Variable name</em><strong id="mrs_01_1058__b3296174882819">=</strong><em id="mrs_01_1058__i1029612484288">Variable value</em></pre>
</li><li id="mrs_01_1058__li55316172812">Example:<pre class="screen" id="mrs_01_1058__screen8505156122612">JAVA_OPTS="-Xms2G -Xmx4G -XX:CMSFullGCsBeforeCompaction=1 -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled -XX:+UseCMSCompactAtFullCollection -DpropertiesImplementation=org.apache.flume.node.EnvVarResolverProperties"
export<strong id="mrs_01_1058__b562715533330"> </strong><em id="mrs_01_1058__i16538519308">TAILDIR_PATH</em><strong id="mrs_01_1058__b14289121310317">=</strong><em id="mrs_01_1058__i7290313173113">/tmp/flumetest/201907/20190703/1/.*log.*</em></pre>
</li></ul>
</p></li><li id="mrs_01_1058__li2883541153111"><span>Restart the Flume instance process.</span><p><ol type="a" id="mrs_01_1058__ol1249714174714"><li id="mrs_01_1058__li430015491542">Log in to FusionInsight Manager.</li><li id="mrs_01_1058__li1153122214455">Choose <strong id="mrs_01_1058__b24061123171420">Cluster</strong> &gt; <strong id="mrs_01_1058__b184141123191414">Services</strong> &gt; <strong id="mrs_01_1058__b5414152321412">Flume</strong>. On the page that is displayed, click the <strong id="mrs_01_1058__b44145237148">Instance</strong> tab, select all Flume instances, and choose <strong id="mrs_01_1058__b2415323171413">More</strong> &gt; <strong id="mrs_01_1058__b20415112311420">Restart Instance</strong>. In the displayed <strong id="mrs_01_1058__b1230041715518">Verify Identity</strong> dialog box, enter the password, and click <strong id="mrs_01_1058__b13415152310141">OK</strong>.</li></ol>
<div class="notice" id="mrs_01_1058__note13624923751"><span class="noticetitle"><img src="public_sys-resources/notice_3.0-en-us.png"> </span><div class="noticebody"><p id="mrs_01_1058__p1952018145720">Do not restart the Flume service on FusionInsight Manager after <strong id="mrs_01_1058__b18381737192614">flume-env.sh</strong> takes effect on the server. Otherwise, the user-defined environment variables will lost. You only need to restart the corresponding instances on FusionInsight Manager.</p>
</div></div>
</p></li><li id="mrs_01_1058__li17459142018584"><a name="mrs_01_1058__li17459142018584"></a><a name="li17459142018584"></a><span>In the <em id="mrs_01_1058__i114983571777">Flume client installation directory</em><strong id="mrs_01_1058__b1449617571976">/fusioninsight-flume-</strong><span id="mrs_01_1058__text1735323818713"><em id="mrs_01_1058__i1235313381975">Flume component version number</em></span><strong id="mrs_01_1058__b153507386715">/conf/properties.properties</strong> configuration file, reference variables in the <strong id="mrs_01_1058__b55591385323">${</strong><em id="mrs_01_1058__i193213173217">Variable name</em><strong id="mrs_01_1058__b44630123327">}</strong> format. The following is an example:</span><p><pre class="screen" id="mrs_01_1058__screen155861125175814">client.sources.s1.type = TAILDIR
client.sources.s1.filegroups = f1
client.sources.s1.filegroups.f1 = ${TAILDIR_PATH}
client.sources.s1.positionFile = /tmp/flumetest/201907/20190703/1/taildir_position.json
client.sources.s1.channels = c1</pre>
<div class="notice" id="mrs_01_1058__note106579226566"><span class="noticetitle"><img src="public_sys-resources/notice_3.0-en-us.png"> </span><div class="noticebody"><ul id="mrs_01_1058__ul352034215244"><li id="mrs_01_1058__li20520542112415">Ensure that <strong id="mrs_01_1058__b1634904810335">flume-env.sh</strong> takes effect before you go to <a href="#mrs_01_1058__li17459142018584">5</a> to configure the <strong id="mrs_01_1058__b22521723153413">properties.properties</strong> file.</li><li id="mrs_01_1058__li135201542132412">If you configure file on the local host, upload the file on FusionInsight Manager by performing the following steps. The user-defined environment variables may be lost if the operations are not performed in the correct sequence.<ol type="a" id="mrs_01_1058__ol1558471312518"><li id="mrs_01_1058__li11584111311256">Log in to FusionInsight Manager.</li><li id="mrs_01_1058__li2058441332514">Choose <strong id="mrs_01_1058__b11187133413419">Cluster</strong> &gt; <strong id="mrs_01_1058__b14553439174110">Services</strong> &gt; <strong id="mrs_01_1058__b12548164404113">Flume</strong>. On the page that is displayed, click the <strong id="mrs_01_1058__b3557559174118">Configurations</strong> tab, select the Flume instance, and click <strong id="mrs_01_1058__b4148138145313">Upload File</strong> next to <strong id="mrs_01_1058__b25652014135313">flume.config.file</strong> to upload the <strong id="mrs_01_1058__b4722192017538">properties.properties</strong> file.</li></ol>
</li></ul>
</div></div>
</p></li></ol>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="mrs_01_0390.html">Using Flume</a></div>
</div>
</div>