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: Yang, Tong <yangtong2@huawei.com> Co-committed-by: Yang, Tong <yangtong2@huawei.com>
64 lines
16 KiB
HTML
64 lines
16 KiB
HTML
<a name="admin_guide_000349"></a><a name="admin_guide_000349"></a>
|
|
|
|
<h1 class="topictitle1">Backing Up ClickHouse Service Data</h1>
|
|
<div id="body0000001196982039"><div class="section" id="admin_guide_000349__s0997aaff3a6e47fa85bf936afbe3834b"><h4 class="sectiontitle">Scenario</h4><p id="admin_guide_000349__en-us_topic_0046736768_p59259929">To ensure ClickHouse service data security routinely or before a major operation on ClickHouse (such as upgrade or migration), you need to back up ClickHouse service data. The backup data can be used to recover the system if an exception occurs or the operation has not achieved the expected result, minimizing the adverse impacts on services.</p>
|
|
<p id="admin_guide_000349__en-us_topic_0046736768_p63577317">You can create a backup task on <span id="admin_guide_000349__text67509419010">MRS</span> Manager to back up ClickHouse service data. Both automatic and manual backup tasks are supported.</p>
|
|
<div class="notice" id="admin_guide_000349__note14379183294412"><span class="noticetitle"><img src="public_sys-resources/notice_3.0-en-us.png"> </span><div class="noticebody"><p id="admin_guide_000349__p13281173718276">This function is supported only by MRS 3.1.0 or later.</p>
|
|
</div></div>
|
|
</div>
|
|
<div class="section" id="admin_guide_000349__se54f43d20aa142b9b0aa4fb19969e57f"><h4 class="sectiontitle">Prerequisites</h4><ul id="admin_guide_000349__ul193411218101717"><li id="admin_guide_000349__lf3c3f51380734b469b9ab66e4015777c">If data needs to be backed up to the remote HDFS, you have prepared a standby cluster for data backup. The authentication mode of the standby cluster is the same as that of the active cluster. For other backup modes, you do not need to prepare the standby cluster.</li><li id="admin_guide_000349__l6b2ccbf0a54a4d7994c8b888340d4fc3">If the active cluster is deployed in security mode and the active and standby clusters are not managed by the same <span id="admin_guide_000349__text169019445149">MRS</span> Manager, mutual trust has been configured. For details, see <a href="admin_guide_000177.html">Configuring Cross-Manager Mutual Trust Between Clusters</a>. If the active cluster is deployed in normal mode, no mutual trust is required.</li><li id="admin_guide_000349__lb80a243195ff415bb79d73f765e4982c">Time is consistent between the active and standby clusters and the NTP services on the active and standby clusters use the same time source.</li></ul>
|
|
<ul id="admin_guide_000349__en-us_topic_0046736768_ul24781121"><li id="admin_guide_000349__en-us_topic_0046736768_li63284394">You have planned the backup type, period, object, and directory based on service requirements.</li><li id="admin_guide_000349__en-us_topic_0046736768_li32688641">The HDFS in the standby cluster has sufficient space. You are advised to save backup files in a custom directory.</li></ul>
|
|
</div>
|
|
<div class="section" id="admin_guide_000349__section14766539203110"><h4 class="sectiontitle">Procedure</h4><ol id="admin_guide_000349__ol43435306155358"><li id="admin_guide_000349__li514247915256"><span>On <span id="admin_guide_000349__text1199514510141">MRS</span> Manager, choose <strong id="admin_guide_000349__b651845103410">O&M</strong> > <strong id="admin_guide_000349__b11131545103411">Backup and Restoration</strong> > <strong id="admin_guide_000349__b215144573416">Backup Management</strong>.</span></li><li id="admin_guide_000349__li1388766715256"><span>Click <strong id="admin_guide_000349__b198994220442620">Create</strong>.</span></li><li id="admin_guide_000349__li5788013915256"><span>Set <strong id="admin_guide_000349__b14235165012343">Name</strong> to the name of the backup task.</span></li><li id="admin_guide_000349__li2832102653918"><span>Select the cluster to be operated from <strong id="admin_guide_000349__b69491952193413">Backup Object</strong>.</span></li><li id="admin_guide_000349__li1759563715256"><span>Set <strong id="admin_guide_000349__b171935578342">Mode</strong> to the type of the backup task.</span><p><p id="admin_guide_000349__en-us_topic_0165590410_p226614614816"><strong id="admin_guide_000349__b527525911349">Periodic</strong> indicates that the backup task is executed by the system periodically. <strong id="admin_guide_000349__b227611594344">Manual</strong> indicates that the backup task is executed manually.</p>
|
|
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="admin_guide_000349__en-us_topic_0165590410_table193081738154917" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Periodic backup parameters</caption><thead align="left"><tr id="admin_guide_000349__en-us_topic_0165590410_row430813818490"><th align="left" class="cellrowborder" valign="top" width="21.84%" id="mcps1.3.3.2.5.2.2.2.3.1.1"><p id="admin_guide_000349__en-us_topic_0165590410_p113081938184918">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="78.16%" id="mcps1.3.3.2.5.2.2.2.3.1.2"><p id="admin_guide_000349__en-us_topic_0165590410_p173081538114915">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="admin_guide_000349__en-us_topic_0165590410_row18308838144917"><td class="cellrowborder" valign="top" width="21.84%" headers="mcps1.3.3.2.5.2.2.2.3.1.1 "><p id="admin_guide_000349__en-us_topic_0165590410_p030893804920">Started</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="78.16%" headers="mcps1.3.3.2.5.2.2.2.3.1.2 "><p id="admin_guide_000349__en-us_topic_0165590410_p103081838144917">Indicates the time when the task is started for the first time.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="admin_guide_000349__en-us_topic_0165590410_row1530813813494"><td class="cellrowborder" valign="top" width="21.84%" headers="mcps1.3.3.2.5.2.2.2.3.1.1 "><p id="admin_guide_000349__en-us_topic_0165590410_p1930833815494">Period</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="78.16%" headers="mcps1.3.3.2.5.2.2.2.3.1.2 "><p id="admin_guide_000349__en-us_topic_0165590410_p7308183834918">Indicates the task execution interval. The options include <strong id="admin_guide_000349__b7255201118355">Hours</strong> and <strong id="admin_guide_000349__b1826319112352">Days</strong>.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="admin_guide_000349__en-us_topic_0165590410_row7308103810493"><td class="cellrowborder" valign="top" width="21.84%" headers="mcps1.3.3.2.5.2.2.2.3.1.1 "><p id="admin_guide_000349__en-us_topic_0165590410_p16308153834910">Backup Policy</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="78.16%" headers="mcps1.3.3.2.5.2.2.2.3.1.2 "><ul id="admin_guide_000349__en-us_topic_0165590410_ul17277134745017"><li id="admin_guide_000349__en-us_topic_0165590410_li7277247105018"><strong id="admin_guide_000349__b6129449162717">Full backup at the first time and incremental backup subsequently</strong></li><li id="admin_guide_000349__en-us_topic_0165590410_li0512161105112"><strong id="admin_guide_000349__b36631252142710">Full backup every time</strong></li><li id="admin_guide_000349__en-us_topic_0165590410_li10673122011516"><strong id="admin_guide_000349__b146416568273">Full backup once every n times</strong></li></ul>
|
|
<div class="note" id="admin_guide_000349__en-us_topic_0165590410_note181551254522"><span class="notetitle"> NOTE: </span><div class="notebody"><ul id="admin_guide_000349__en-us_topic_0165590410_ul61731492817"><li id="admin_guide_000349__en-us_topic_0165590410_li161733452817">Incremental backup is not supported when Manager data and component metadata are backed up. Only <strong id="admin_guide_000349__b1558112015354">Full backup every time</strong> is supported.</li></ul>
|
|
</div></div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</p></li><li id="admin_guide_000349__li43938424155358"><span>In <strong id="admin_guide_000349__b15279851336319">Configuration</strong>, select <strong id="admin_guide_000349__b17710796986319">ClickHouse</strong> under <strong id="admin_guide_000349__b11190176156319">Service Data</strong>.</span></li><li id="admin_guide_000349__li4457996415256"><a name="admin_guide_000349__li4457996415256"></a><a name="li4457996415256"></a><span>Set <strong id="admin_guide_000349__b5318803476319">Path Type</strong> of <strong id="admin_guide_000349__b4591913306319">ClickHouse</strong> to a backup directory type.</span><p><p class="litext" id="admin_guide_000349__p1596050715256">Currently, only the <strong id="admin_guide_000349__b06376428356">RemoteHDFS</strong> type is available.</p>
|
|
<p class="subitemlist" id="admin_guide_000349__p7177135172910"><strong id="admin_guide_000349__b1426340185314">RemoteHDFS</strong>: indicates that backup files are stored in HDFS of the standby cluster.</p>
|
|
<p id="admin_guide_000349__p14469132153012">This value option is available only after you configure the environment by referring to <a href="admin_guide_000357.html">How Do I Configure the Environment When I Create a ClickHouse Backup Task on MRS Manager and Set the Path Type to RemoteHDFS?</a>.</p>
|
|
<div class="subitemlist" id="admin_guide_000349__p5645164933714">You also need to configure the following parameters:<ul id="admin_guide_000349__ul12338544133717"><li id="admin_guide_000349__li733844418378"><strong id="admin_guide_000349__b1524927356">Destination NameService Name</strong>: indicates the NameService name of the standby cluster, for example, <strong id="admin_guide_000349__b1177868655">hacluster</strong>. You can obtain it from the <strong id="admin_guide_000349__b1501202794">NameService Management</strong> page of HDFS of the standby cluster.</li></ul>
|
|
<ul id="admin_guide_000349__ul53381844183715"><li id="admin_guide_000349__li19338444183718"><strong id="admin_guide_000349__b145143090">IP Mode</strong>: indicates the mode of the target IP address. The system automatically selects the IP address mode based on the cluster network type, for example, <strong id="admin_guide_000349__b553596866">IPv4</strong> or <strong id="admin_guide_000349__b1196269880">IPv6</strong>.</li><li id="admin_guide_000349__li123381444173720"><strong id="admin_guide_000349__b14578145718011">Target NameNode IP Address</strong>: indicates the IP address of the NameNode service plane in the standby cluster. It can be of an active or standby node.</li><li id="admin_guide_000349__li9339154417372"><strong id="admin_guide_000349__b207301108">Target Path</strong>: indicates the HDFS directory for storing standby cluster backup data. The storage path cannot be an HDFS hidden directory, such as a snapshot or recycle bin directory, or a default system directory, such as <strong id="admin_guide_000349__b1471116474">/hbase</strong> or <strong id="admin_guide_000349__b71067589">/user/hbase/backup</strong>.</li><li id="admin_guide_000349__li1884182519399"><strong id="admin_guide_000349__b1341818211224">Maximum Number of Backup Copies</strong>: indicates the number of backup file sets that can be retained in the backup directory.</li><li id="admin_guide_000349__li288714405399"><strong id="admin_guide_000349__b1087719181239">Maximum Number of Maps</strong>: indicates the maximum number of maps in a MapReduce task. The default value is <strong id="admin_guide_000349__b1387913181738">20</strong>.</li><li id="admin_guide_000349__li119119483399"><strong id="admin_guide_000349__b47067458313">Maximum Bandwidth of a Map (MB/s)</strong>: indicates the maximum bandwidth of a map. The default value is <strong id="admin_guide_000349__b17071245133">100</strong>.</li></ul>
|
|
</div>
|
|
</p></li><li id="admin_guide_000349__li10625226155358"><span>Set <strong id="admin_guide_000349__b140112015514">Maximum Number of Recovery Points</strong> to the number of snapshots that can be retained in the cluster.</span></li><li id="admin_guide_000349__li7186938155358"><span>Set <strong id="admin_guide_000349__b18709151619362">Backup Content</strong> to one or multiple ClickHouse tables to be backed up.</span><p><p id="admin_guide_000349__p28518178155358">You can select backup data using either of the following methods:</p>
|
|
<ul id="admin_guide_000349__ul8255089155358"><li id="admin_guide_000349__li28271067155358">Adding a backup data file<p id="admin_guide_000349__p1322548161715"><a name="admin_guide_000349__li28271067155358"></a><a name="li28271067155358"></a>Click the name of a database in the navigation tree to show all the tables in the database, and select specified tables.</p>
|
|
</li><li id="admin_guide_000349__li53113015155358">Selecting using regular expressions<ol type="a" id="admin_guide_000349__ol30303899155416"><li id="admin_guide_000349__li2792962155416">Click <strong id="admin_guide_000349__b191585636614911">Query Regular Expression</strong>.</li><li id="admin_guide_000349__li25136663155416">Enter the database where the ClickHouse tables are located in the first text box as prompted. The database must be the same as the existing database, for example, <strong id="admin_guide_000349__b174837541253">default</strong>.</li><li id="admin_guide_000349__li3907923155416">Enter a regular expression in the second text box. Standard regular expressions are supported. For example, to get all tables in the database, enter <strong id="admin_guide_000349__b16446375066319">([\s\S]*?)</strong>. To get tables named in the format of letters and digits, for example, <strong id="admin_guide_000349__b7898754576319">tb1</strong>, enter <strong id="admin_guide_000349__b13817776016319">tb\d*</strong>.</li><li id="admin_guide_000349__li35171310155416">Click <strong id="admin_guide_000349__b8687032506319">Refresh</strong> to view the displayed tables in <strong id="admin_guide_000349__b16306898246319">Directory Name</strong>.</li><li id="admin_guide_000349__li48106342155416">Click <strong id="admin_guide_000349__b129541623314911">Synchronize</strong> to save the result.</li></ol>
|
|
<div class="note" id="admin_guide_000349__en-us_topic_0046736768_note12395076"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="admin_guide_000349__en-us_topic_0046736768_ul44446822"><li id="admin_guide_000349__en-us_topic_0046736768_li64477079">When entering regular expressions, click <span><img id="admin_guide_000349__image2025292243311" src="en-us_image_0000001442653737.png"></span> or <span><img id="admin_guide_000349__image134691822163514" src="en-us_image_0000001392574070.png"></span> to add or delete an expression.</li><li id="admin_guide_000349__en-us_topic_0046736768_li27585894">If the selected table or directory is incorrect, click <strong id="admin_guide_000349__b27516625614911">Clear Selected Node</strong> to deselect it.</li></ul>
|
|
</div></div>
|
|
</li></ul>
|
|
</p></li><li id="admin_guide_000349__en-us_topic_0046736768_li19864978"><span>Click <strong id="admin_guide_000349__b79345721214911">Verify</strong> to check whether the backup task is configured correctly.</span><p><p class="litext" id="admin_guide_000349__en-us_topic_0046736768_p44567074">The possible causes of the verification failure are as follows:</p>
|
|
<ul class="subitemlist" id="admin_guide_000349__en-us_topic_0046736768_ul65559353"><li id="admin_guide_000349__en-us_topic_0046736768_li53163271">The target NameNode IP address is incorrect.</li><li id="admin_guide_000349__en-us_topic_0046736768_li34210590">The directory or table to be backed up does not exist.</li><li id="admin_guide_000349__li51019248410">The name of the NameService is incorrect.</li></ul>
|
|
</p></li><li id="admin_guide_000349__en-us_topic_0046736768_li39459859"><span>Click <strong id="admin_guide_000349__b123813679914911">OK</strong>.</span></li><li id="admin_guide_000349__en-us_topic_0046736768_li42131977"><span>In the <strong id="admin_guide_000349__b42873443911">Operation</strong> column of the created task in the backup task list, click <strong id="admin_guide_000349__b235934203914">More</strong> and select <strong id="admin_guide_000349__b3361534183920">Back Up Now</strong> to execute the backup task.</span><p><p id="admin_guide_000349__en-us_topic_0046736768_p57246976">After the backup task is executed, the system automatically creates a subdirectory for each backup task in the backup directory. The format of the subdirectory name is <em id="admin_guide_000349__i9401808216319">Data source_Task creation time</em>, and the subdirectory is used to save latest data source backup files.</p>
|
|
</p></li></ol>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="admin_guide_000201.html">Backing Up Data</a></div>
|
|
</div>
|
|
</div>
|
|
|