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

39 lines
11 KiB
HTML

<a name="mrs_01_1038"></a><a name="mrs_01_1038"></a>
<h1 class="topictitle1">Changing the Broker Storage Directory</h1>
<div id="body1590134593891"><div class="section" id="mrs_01_1038__s18e9e81c2dc846d487535fc584743b86"><h4 class="sectiontitle">Scenario</h4><p id="mrs_01_1038__p1944684185813">This section applies to MRS 3.x or later.</p>
<p id="mrs_01_1038__a15fe07a3aa8f4f0c9f1d9e2521eab897">When a broker storage directory is added, the system administrator needs to change the broker storage directory on FusionInsight Manager, to ensure that the Kafka can work properly. The new topic partition will be generated in the directory that has fewest partitions. Changing the ZooKeeper storage directory includes the following scenarios:</p>
<div class="note" id="mrs_01_1038__note12910074144257"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="mrs_01_1038__p49081802144257">Because Kafka does not detect disk capacity, ensure that the disk quantity and capacity configured for each Broker instance are the same. </p>
</div></div>
<ul id="mrs_01_1038__u0919e9bb4f144689aca10dc39e7d6bce"><li id="mrs_01_1038__l98bf8971f7744fd6af18fd55622c4a96">Change the storage directory of the Broker role. In this way, the storage directories of all Broker instances are changed.</li><li id="mrs_01_1038__l33ac3cbcfc0d48459322810ae6f825cb">Change the storage directory of a single Broker instance. In this way, only the storage directory of this Broker instance is changed, and the storage directories of other Broker instances remain the same.</li></ul>
</div>
<div class="section" id="mrs_01_1038__se5ef27c5cfb544d39b9d5ed763a59138"><h4 class="sectiontitle">Impact on the System</h4><ul id="mrs_01_1038__udcb362b5273c460ebe3d5002ceb7440e"><li id="mrs_01_1038__l9f1e4cc26ef34042b5830e949eb02e71">Changing the Broker role storage directory requires the restart of services. The services cannot be accessed during the restart.</li><li id="mrs_01_1038__lbc5274bfdc0142598aca8636ea3ed7fe">The storage directory of a single Broker instance can be changed only after the instance is restarted. The instance cannot provide services during the restart.</li><li id="mrs_01_1038__l716ac729113d431d8633c1e141638059">The directory for storing service parameter configurations must also be updated.</li></ul>
</div>
<div class="section" id="mrs_01_1038__sfe28b1cf174249788a675b39f62aaf80"><h4 class="sectiontitle">Prerequisites</h4><ul id="mrs_01_1038__u4c90655ae7df4fe2844383d839f16186"><li id="mrs_01_1038__l25d7e74ed3134e08abd511d5bca4975b">New disks have been prepared and installed on each data node, and the disks are formatted.</li><li id="mrs_01_1038__l4b452eb64d6a46508b0d38c4dd7b85ff">The Kafka client has been installed.</li><li id="mrs_01_1038__ld0f3eb727952471c9cc317eb92202352">When you change the storage directory of a single Broker instance, the number of active Broker instances must be greater than the number of backups specified during topic creation.</li></ul>
</div>
<div class="section" id="mrs_01_1038__sb9f543ade4344d7a974580b18ccee1dd"><h4 class="sectiontitle">Procedure</h4><p class="tableheading" id="mrs_01_1038__a2701fa0af514456e80bd20b0c8a132ed"><strong id="mrs_01_1038__a4449e03af6fe4ac789f20d0477d50d04">Changing the storage directory of the Kafka role</strong></p>
<ol id="mrs_01_1038__o717c3949e5314f4aa8b5cbc09038a541"><li id="mrs_01_1038__la5a8411778854d7cb7d4722cedbdfac3"><span>Log in as user <strong id="mrs_01_1038__b18309202419373">root</strong> to each node on which the Kafka service is installed, and perform the following operations:</span><p><ol class="subitemlist" type="a" id="mrs_01_1038__ob74f84a72d3f497abec1754012eeaeac"><li id="mrs_01_1038__lb919b41a99564fd986ef705e82e6efb6">Create a target directory.<p class="litext" id="mrs_01_1038__a7e09e5b63f24426888b13fdc9cdf9ae5"><a name="mrs_01_1038__lb919b41a99564fd986ef705e82e6efb6"></a><a name="lb919b41a99564fd986ef705e82e6efb6"></a>For example, to create the target directory <strong id="mrs_01_1038__b190482017843412">${BIGDATA_DATA_HOME}/kafka/data2</strong>, run the following command:</p>
<p class="litext" id="mrs_01_1038__ac57c9e4f65a94ddc9e2af51efa8a8ea6"><strong id="mrs_01_1038__a32cf5208d52440e6ae616e6363af1ed6">mkdir ${BIGDATA_DATA_HOME}/kafka/data2</strong></p>
</li><li id="mrs_01_1038__la981761a97cd46378cf67e916004379d">Mount the directory to the new disk. For example, mount <strong id="mrs_01_1038__b14961435543412">${BIGDATA_DATA_HOME}/kafka/data2</strong> to the new disk.</li><li id="mrs_01_1038__l37744f931fb94de4ba4b1f73af3cc3bd">Modify permissions on the new directory.<p id="mrs_01_1038__a82eb7b19288545e6a51cf0a6958556cd"><a name="mrs_01_1038__l37744f931fb94de4ba4b1f73af3cc3bd"></a><a name="l37744f931fb94de4ba4b1f73af3cc3bd"></a>For example, to modify permissions on the <strong id="mrs_01_1038__b105235981343412">${BIGDATA_DATA_HOME}/kafka/data2</strong> directory, run the following commands:</p>
<p id="mrs_01_1038__ac457d4c697064d2c891a185f708ccf49"><strong id="mrs_01_1038__b63305097043412">chmod 700 ${BIGDATA_DATA_HOME}/kafka/data2 -R</strong> and <strong id="mrs_01_1038__b102045627643412">chown omm:wheel ${BIGDATA_DATA_HOME}/kafka/data2 -R</strong></p>
</li></ol>
</p></li><li id="mrs_01_1038__li365613301414"><span>Log in to FusionInsight Manager for clusters of MRS 3.<em id="mrs_01_1038__i14499166191410">x</em> or later and choose <strong id="mrs_01_1038__b1082311135406">Cluster</strong> &gt; <strong id="mrs_01_1038__b722019169402">Services</strong> &gt; <strong id="mrs_01_1038__b2056141894014">Kafka</strong> &gt; <strong id="mrs_01_1038__b18105122514401">Configurations</strong>.</span></li><li id="mrs_01_1038__lb3a8cf0df4d145769574f13c68254751"><span>Add a new directory to the end of the default value of <strong id="mrs_01_1038__b13937142195218">log.dirs</strong>.</span><p><p class="litext" id="mrs_01_1038__p1667317407156">Enter <strong id="mrs_01_1038__b15586311135218">log.dirs</strong> in the search box and add the new directory to the end of the default value of the<strong id="mrs_01_1038__b18972141825218"> log.dirs</strong> configuration item. Use commas (,) to separate multiple directories. For example:</p>
<p id="mrs_01_1038__p6669194019151"><strong id="mrs_01_1038__b5442191961414">${BIGDATA_DATA_HOME}/kafka/data1/kafka-logs,${BIGDATA_DATA_HOME}/kafka/data2/kafka-logs</strong></p>
</p></li><li id="mrs_01_1038__li3570376109"><span>Click <strong id="mrs_01_1038__b113303651743412">Save</strong>, and then click <strong id="mrs_01_1038__b63415906243412">OK</strong>. When <strong id="mrs_01_1038__b66045529143412">Operation succeeded</strong> is displayed, click <strong id="mrs_01_1038__b69999774943412">Finish</strong>.</span></li><li id="mrs_01_1038__l26afb2845f844834ae38295cedab2b58"><span>Choose <strong id="mrs_01_1038__b159731811114316">Cluster</strong> &gt; <strong id="mrs_01_1038__b18601914144316">Services</strong> &gt; <strong id="mrs_01_1038__b990571615432">Kafka</strong>. In the upper right corner, choose <strong id="mrs_01_1038__b2115173784317">More</strong> &gt; <strong id="mrs_01_1038__b0882840124320">Restart Service</strong> to restart the Kafka service.</span></li></ol>
<p id="mrs_01_1038__a1a19072b6c774e708555838ccdec602b"><strong id="mrs_01_1038__a0fd9d7aae13c4bbe9fff193719fd0e83">Changing the storage directory of a single Kafka instance</strong></p>
<ol start="6" id="mrs_01_1038__o645c95b933d541c49b041953e4576e91"><li id="mrs_01_1038__lcb54ae5030a34c39babf086c3a339cf0"><span>Log in to the Broker node as user <strong id="mrs_01_1038__b220819264420">root</strong> and perform the following operations:</span><p><ol class="subitemlist" type="a" id="mrs_01_1038__o2ae246e09f804efeb4be9cfa1170d5bf"><li id="mrs_01_1038__l4245f1a101b04c95929252f9329d31b7">Create a target directory.<p class="litext" id="mrs_01_1038__a0e0cc46f1cb94d3ead3d825f3a7bfe02"><a name="mrs_01_1038__l4245f1a101b04c95929252f9329d31b7"></a><a name="l4245f1a101b04c95929252f9329d31b7"></a>For example, to create the target directory <strong id="mrs_01_1038__b74755525443412">${BIGDATA_DATA_HOME}/kafka/data2</strong>, run the following command:</p>
<p class="litext" id="mrs_01_1038__aed9ebf17b662417aa6e9148edbba22dd"><strong id="mrs_01_1038__a8d501e69c0d746d69bc52c8eb6aec664">mkdir ${BIGDATA_DATA_HOME}/kafka/data2</strong></p>
</li><li id="mrs_01_1038__l0f19cc52e385485fb549ecd4feca0eb7">Mount the directory to the new disk. For example, mount <strong id="mrs_01_1038__b84004703143412">${BIGDATA_DATA_HOME}/kafka/data2</strong> to the new disk.</li><li id="mrs_01_1038__lf37ed8b168b248e3a6d89b31ad0a7545">Modify permissions on the new directory.<p id="mrs_01_1038__a59481ba5b8074907951af99463521b0b"><a name="mrs_01_1038__lf37ed8b168b248e3a6d89b31ad0a7545"></a><a name="lf37ed8b168b248e3a6d89b31ad0a7545"></a>For example, to modify permissions on the <strong id="mrs_01_1038__b107107231943412">${BIGDATA_DATA_HOME}/kafka/data2</strong> directory, run the following commands:</p>
<p id="mrs_01_1038__a4c2cd4d66eee480c89a7626539eaccb1"><strong id="mrs_01_1038__b106788054143412">chmod 700 ${BIGDATA_DATA_HOME}/kafka/data2 -R</strong> and <strong id="mrs_01_1038__b160152568143412">chown omm:wheel ${BIGDATA_DATA_HOME}/kafka/data2 -R</strong></p>
</li></ol>
</p></li><li id="mrs_01_1038__li17446035181111"><span>Log in to FusionInsight Manager for MRS 3.<em id="mrs_01_1038__i1011315124483">x</em> or later, and choose <strong id="mrs_01_1038__b265591524820">Cluster</strong> &gt; <strong id="mrs_01_1038__b227917181488">Services</strong> &gt; <strong id="mrs_01_1038__b1859572016481">Kafka</strong> &gt; <strong id="mrs_01_1038__b1021102510482">Instance</strong>.</span></li><li id="mrs_01_1038__l84912cef59884bd39e9756de1e5bfce0"><span>Click the specified broker instance and switch to <strong id="mrs_01_1038__b169303324820">Instance Configurations</strong>.</span><p><p class="litext" id="mrs_01_1038__a3a45f1df536b4704aee08869835629c3">Enter <strong id="mrs_01_1038__b159802711521">log.dirs</strong> in the search box and add the new directory to the end of the default value of the<strong id="mrs_01_1038__b10981927205219"> log.dirs</strong> configuration item. Use commas (,) to separate multiple directories, for example, <strong id="mrs_01_1038__b157798215156">${BIGDATA_DATA_HOME}/kafka/data1/kafka-logs,${BIGDATA_DATA_HOME}/kafka/data2/kafka-logs</strong>.</p>
</p></li><li id="mrs_01_1038__li17225111801217"><span>Click <strong id="mrs_01_1038__b1995255620488">Save</strong>, and then click <strong id="mrs_01_1038__b614010598481">OK</strong>. A message is displayed, indicating that the operation is successful. Click <strong id="mrs_01_1038__b770317674910">Finish</strong>.</span></li><li id="mrs_01_1038__l6770d59827344a869267353ec58ad6e0"><span>On the Broker instance page, choose <strong id="mrs_01_1038__b109014126501">More</strong> &gt; <strong id="mrs_01_1038__b148773142505">Restart Instance</strong> to restart the Broker instance.</span></li></ol>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="mrs_01_0375.html">Using Kafka</a></div>
</div>
</div>