Files
doc-exports/docs/css/umn/css_01_0049.html
zhengxiu 93d856d5c5 css umn 25.6.0 version
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com>
Co-authored-by: zhengxiu <zhengxiu@huawei.com>
Co-committed-by: zhengxiu <zhengxiu@huawei.com>
2025-11-25 11:34:43 +00:00

417 lines
46 KiB
HTML

<a name="EN-US_TOPIC_0000002386790381"></a><a name="EN-US_TOPIC_0000002386790381"></a>
<h1 class="topictitle1">Configuring Read/Write Splitting Between Two OpenSearch Clusters</h1>
<div id="body0000002386790381"><p id="EN-US_TOPIC_0000002386790381__p04211257171518">As business expands, and data volumes and access requests grow exponentially, a monolithic architecture where a single cluster handles both write and query requests faces typical challenges like resource contention and overload. To address these challenges, CSS introduces read/write splitting between OpenSearch clusters.</p>
<p id="EN-US_TOPIC_0000002386790381__p049511443316">OpenSearch read/write splitting works by having leader and follower clusters collaborate together. The feature delivers the following benefits:</p>
<ul id="EN-US_TOPIC_0000002386790381__ul169435548295"><li id="EN-US_TOPIC_0000002386790381__li1194316548299">Decoupled read and write loads: The leader cluster ensures data ingestion performance, while the follower clusters deliver scalable, high-concurrency query performance. There is no more resource contention, and peak loads are reduced.</li><li id="EN-US_TOPIC_0000002386790381__li1194385416297">Flexible scalability: The write and query clusters can be scaled horizontally and independently. Cross-region cluster deployment is supported.</li><li id="EN-US_TOPIC_0000002386790381__li159445545297">Data consistency guarantee: Data can be synchronized in real time, with low latency. Incremental synchronization is also supported.</li></ul>
<div class="section" id="EN-US_TOPIC_0000002386790381__section20798162114246"><h4 class="sectiontitle">How the Feature Works</h4><div class="fignone" id="EN-US_TOPIC_0000002386790381__fig2478545205710"><span class="figcap"><b>Figure 1 </b>Read/write splitting</span><br><span><img id="EN-US_TOPIC_0000002386790381__image54781045115715" src="figure/en-us_image_0000002496560577.png"></span></div>
<p id="EN-US_TOPIC_0000002386790381__p1687431835819">How read/write splitting between OpenSearch clusters works:</p>
<ol id="EN-US_TOPIC_0000002386790381__ol18987472598"><li id="EN-US_TOPIC_0000002386790381__li09894735912">Data writes: Users send write requests, and the leader cluster handles these requests.</li><li id="EN-US_TOPIC_0000002386790381__li1198154717597">Data synchronization.<div class="p" id="EN-US_TOPIC_0000002386790381__p10721127904"><a name="EN-US_TOPIC_0000002386790381__li1198154717597"></a><a name="li1198154717597"></a>The leader synchronizes data changes to the follower through a REST API. Two synchronization methods are supported:<ul id="EN-US_TOPIC_0000002386790381__ul0813171810012"><li id="EN-US_TOPIC_0000002386790381__li11813918601">Exact match: synchronization of a specified index</li><li id="EN-US_TOPIC_0000002386790381__li481331819011">Match by wildcard: batch synchronization of indexes matching a wildcard expression</li></ul>
</div>
</li><li id="EN-US_TOPIC_0000002386790381__li1698147105919">Query processing: Users send query requests. The follower cluster handles these requests and returns the results.</li></ol>
<p id="EN-US_TOPIC_0000002386790381__p7111833118"><a href="#EN-US_TOPIC_0000002386790381__en-us_topic_0000001268154533_fig165871420101917">Figure 2</a> illustrates how read/write splitting works.</p>
<div class="fignone" id="EN-US_TOPIC_0000002386790381__en-us_topic_0000001268154533_fig165871420101917"><a name="EN-US_TOPIC_0000002386790381__en-us_topic_0000001268154533_fig165871420101917"></a><a name="en-us_topic_0000001268154533_fig165871420101917"></a><span class="figcap"><b>Figure 2 </b>How read/write splitting works</span><br><span><img id="EN-US_TOPIC_0000002386790381__en-us_topic_0000001268154533_image16587320141910" src="figure/en-us_image_0000002425720625.jpg"></span></div>
<ul id="EN-US_TOPIC_0000002386790381__ul15487135823110"><li id="EN-US_TOPIC_0000002386790381__li154871058183114">Read and write split when both clusters are available (left): The leader handles writes, and the follower handles queries.</li><li id="EN-US_TOPIC_0000002386790381__li84316293210">Leader-to-follower switchover when the leader fails (right): If the leader becomes unavailable, the follower automatically upgrades to leader to ensure service continuity. For details, see <a href="#EN-US_TOPIC_0000002386790381__section62831838161012">Switching the Roles of the Leader and Follower Clusters</a>.</li></ul>
</div>
<div class="section" id="EN-US_TOPIC_0000002386790381__section1995816338248"><h4 class="sectiontitle">Constraints</h4><ul id="EN-US_TOPIC_0000002386790381__ul473014135594"><li id="EN-US_TOPIC_0000002386790381__li1730213105915">Only OpenSearch 2.19.0 clusters support read/write splitting.</li><li id="EN-US_TOPIC_0000002386790381__li10730101395914">The leader and follower clusters must use the same software version.</li></ul>
</div>
<div class="section" id="EN-US_TOPIC_0000002386790381__section1338820544715"><h4 class="sectiontitle">Prerequisites</h4><p id="EN-US_TOPIC_0000002386790381__p1114516586710">Two clusters of the same version have been created. One functions as the leader cluster, and the other the follower cluster. The follower cluster must be able to access the REST API (default port: 9200) of the leader cluster.</p>
</div>
<div class="section" id="EN-US_TOPIC_0000002386790381__section253155420232"><h4 class="sectiontitle">Logging In to OpenSearch Dashboards</h4><p id="EN-US_TOPIC_0000002386790381__en-us_topic_0000002338102386_p13118645151118">Log in to OpenSearch Dashboards and go to the command execution page. OpenSearch clusters support multiple access methods. This topic uses OpenSearch Dashboards as an example to describe the operation procedures.</p>
<ol id="EN-US_TOPIC_0000002386790381__en-us_topic_0000002338102386_ol511804517115"><li id="EN-US_TOPIC_0000002386790381__en-us_topic_0000002338102386_li111185453113"><span id="EN-US_TOPIC_0000002386790381__en-us_topic_0000002338102386_ph134648105316">Log in to the CSS management console.</span></li><li id="EN-US_TOPIC_0000002386790381__en-us_topic_0000002338102386_li1711804571114">In the navigation pane on the left, choose <span class="uicontrol" id="EN-US_TOPIC_0000002386790381__en-us_topic_0000002338102386_uicontrol1511834581115"><b>Clusters &gt; OpenSearch</b></span>.</li><li id="EN-US_TOPIC_0000002386790381__en-us_topic_0000002338102386_li201181045151113">In the cluster list, find the target cluster, and click <strong id="EN-US_TOPIC_0000002386790381__en-us_topic_0000002338102386_b8963520674129">Dashboards</strong> in the <strong id="EN-US_TOPIC_0000002386790381__en-us_topic_0000002338102386_b1363282744129">Operation</strong> column to log in to OpenSearch Dashboards.</li><li id="EN-US_TOPIC_0000002386790381__en-us_topic_0000002338102386_li811824512111">In the left navigation pane, choose <strong id="EN-US_TOPIC_0000002386790381__en-us_topic_0000002338102386_b45261424710">Dev Tools</strong>.<p id="EN-US_TOPIC_0000002386790381__en-us_topic_0000002338102386_p539424154519">The left part of the console is the command input box, and the triangle icon in its upper-right corner is the execution button. The right part shows the execution result.</p>
</li></ol>
</div>
<div class="section" id="EN-US_TOPIC_0000002386790381__section1023014371242"><a name="EN-US_TOPIC_0000002386790381__section1023014371242"></a><a name="section1023014371242"></a><h4 class="sectiontitle">Connecting the Leader and Follower Clusters</h4><ol id="EN-US_TOPIC_0000002386790381__en-us_topic_0000001223754356_ol927111214106"><li id="EN-US_TOPIC_0000002386790381__en-us_topic_0000001223754356_li927171291011">Run the following command to configure information about the leader cluster in the follower cluster:<pre class="screen" id="EN-US_TOPIC_0000002386790381__en-us_topic_0000001223754356_screen1915102641219">PUT /_cluster/settings
{
"persistent" : {
"cluster" : {
"remote.rest" : {
"leader1" : {
"seeds" : [
"http://10.0.0.1:9200",
"http://10.0.0.2:9200",
"http://10.0.0.3:9200"
] ,
"username": "elastic",
"password": "*****"
}
}
}
}
}</pre>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000002386790381__table25991023216" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Request body parameters</caption><thead align="left"><tr id="EN-US_TOPIC_0000002386790381__row1459510193214"><th align="left" class="cellrowborder" valign="top" width="30%" id="mcps1.3.8.2.1.2.2.3.1.1"><p id="EN-US_TOPIC_0000002386790381__p1159510133211">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="70%" id="mcps1.3.8.2.1.2.2.3.1.2"><p id="EN-US_TOPIC_0000002386790381__p1359410173217">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000002386790381__row359610133214"><td class="cellrowborder" valign="top" width="30%" headers="mcps1.3.8.2.1.2.2.3.1.1 "><p id="EN-US_TOPIC_0000002386790381__p1759121018325"><i><span class="varname" id="EN-US_TOPIC_0000002386790381__varname52375219379">leader1</span></i></p>
</td>
<td class="cellrowborder" valign="top" width="70%" headers="mcps1.3.8.2.1.2.2.3.1.2 "><p id="EN-US_TOPIC_0000002386790381__p14591410123211">Name of the leader cluster configuration task, which is user-defined and will be used for configuring read/write splitting later.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000002386790381__row259610203218"><td class="cellrowborder" valign="top" width="30%" headers="mcps1.3.8.2.1.2.2.3.1.1 "><p id="EN-US_TOPIC_0000002386790381__p85961015328">seeds</p>
</td>
<td class="cellrowborder" valign="top" width="70%" headers="mcps1.3.8.2.1.2.2.3.1.2 "><p id="EN-US_TOPIC_0000002386790381__p1859171043218">Address for accessing the leader cluster. When HTTPS is enabled for the cluster, the URL schema must use HTTPS.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000002386790381__row1359210193217"><td class="cellrowborder" valign="top" width="30%" headers="mcps1.3.8.2.1.2.2.3.1.1 "><p id="EN-US_TOPIC_0000002386790381__p11591010173218">username</p>
</td>
<td class="cellrowborder" valign="top" width="70%" headers="mcps1.3.8.2.1.2.2.3.1.2 "><p id="EN-US_TOPIC_0000002386790381__p14591810153211">Username of the leader cluster. This parameter is required only when security mode is enabled for the leader cluster.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000002386790381__row175921093217"><td class="cellrowborder" valign="top" width="30%" headers="mcps1.3.8.2.1.2.2.3.1.1 "><p id="EN-US_TOPIC_0000002386790381__p859181020321">password</p>
</td>
<td class="cellrowborder" valign="top" width="70%" headers="mcps1.3.8.2.1.2.2.3.1.2 "><p id="EN-US_TOPIC_0000002386790381__p6598104321">Password of the leader cluster. This parameter is required only when security mode is enabled for the leader cluster.</p>
</td>
</tr>
</tbody>
</table>
</div>
<p id="EN-US_TOPIC_0000002386790381__p8101102263712">Example response:</p>
<pre class="screen" id="EN-US_TOPIC_0000002386790381__screen12391193717379">{
"acknowledged" : true, //Whether the operation is successful
"persistent" : {
"cluster" : {
"remote" : {
"rest" : {
"leader1" : {
"seeds" : [
"http://10.0.0.1:9200",
"http://10.0.0.2:9200",
"http://10.0.0.3:9200"
] ,
"username": "elastic",
"password": "*****"
}
}
}
}
},
"transient" : { }
}</pre>
</li><li id="EN-US_TOPIC_0000002386790381__li176551843161010">After the configuration is complete, run the following command in the follower cluster to check the connection between the follower and leader clusters:<pre class="screen" id="EN-US_TOPIC_0000002386790381__screen1616587112219">GET _remote/rest/info</pre>
<p id="EN-US_TOPIC_0000002386790381__p15950201983913">Example response:</p>
<pre class="screen" id="EN-US_TOPIC_0000002386790381__screen1422283511391">{
"leader1" : {
"connected" : true //The two clusters are connected.
}
}</pre>
</li></ol>
</div>
<div class="section" id="EN-US_TOPIC_0000002386790381__section97051931358"><a name="EN-US_TOPIC_0000002386790381__section97051931358"></a><a name="section97051931358"></a><h4 class="sectiontitle">Index Synchronization</h4><p id="EN-US_TOPIC_0000002386790381__p95918467368">There are two ways to synchronize indexes: synchronization of a specified index and synchronization of indexes matching a wildcard expression.</p>
<p id="EN-US_TOPIC_0000002386790381__p78489284403">During synchronization, indexes in the follower cluster become read-only. The synchronization is performed periodically. The default synchronization interval is 30 seconds. For how to change it, see <a href="#EN-US_TOPIC_0000002386790381__section94973244119">Changing the Synchronization Interval</a>.</p>
<div class="caution" id="EN-US_TOPIC_0000002386790381__note32428196163"><span class="cautiontitle"><img src="public_sys-resources/caution_3.0-en-us.png"> </span><div class="cautionbody"><p id="EN-US_TOPIC_0000002386790381__p1333413601614">The following index configuration items cannot be modified: <span class="parmvalue" id="EN-US_TOPIC_0000002386790381__parmvalue2140096046323"><b>number_of_shards</b></span>, <span class="parmvalue" id="EN-US_TOPIC_0000002386790381__parmvalue2123328250323"><b>version.created</b></span>, <span class="parmvalue" id="EN-US_TOPIC_0000002386790381__parmvalue1461498764323"><b>uuid</b></span>, <span class="parmvalue" id="EN-US_TOPIC_0000002386790381__parmvalue1799626739323"><b>creation_date</b></span>, and <span class="parmvalue" id="EN-US_TOPIC_0000002386790381__parmvalue1853852291323"><b>soft_deletes.enabled</b></span>.</p>
</div></div>
<div class="dropdownexpand"><div class="dropdowntitle" onclick="ExpandorCollapseNode(this)"><p id="EN-US_TOPIC_0000002386790381__p1958161016379">Method 1: synchronizing a specified index</p></div>
<div class="dropdowncontext"><ul id="EN-US_TOPIC_0000002386790381__ul729419204220"><li id="EN-US_TOPIC_0000002386790381__li729719134217">Run the following command in the follower cluster to synchronize a single index from the leader cluster to the follower cluster without modifying index settings:<pre class="screen" id="EN-US_TOPIC_0000002386790381__en-us_topic_0000001223594396_screen16407173811400">PUT start_remote_sync
{
"remote_cluster": "<em id="EN-US_TOPIC_0000002386790381__i53471336124210">leader1</em>",
"remote_index": "<em id="EN-US_TOPIC_0000002386790381__i12116133964220">data1_leader</em>",
"local_index": "<em id="EN-US_TOPIC_0000002386790381__i101182420422">data1_follower</em>"
}</pre>
</li><li id="EN-US_TOPIC_0000002386790381__li1330181974210">Run the following command in the follower cluster to synchronize a single index from the leader cluster to the follower cluster while modifying some of the index settings—enabling synchronization of index settings:<pre class="screen" id="EN-US_TOPIC_0000002386790381__en-us_topic_0000001223594396_screen17681038181312">PUT start_remote_sync
{
"remote_cluster": "<em id="EN-US_TOPIC_0000002386790381__i2731111864420">leader1</em>",
"remote_index": "<em id="EN-US_TOPIC_0000002386790381__i71341622144412">data1_leader</em>",
"local_index": "<em id="EN-US_TOPIC_0000002386790381__i9114261449">data1_follower</em>",
"settings": {
"number_of_replicas": 4
},
"settings_sync_enable": true,
"settings_sync_patterns": ["*"],
"settings_sync_exclude_patterns": ["index.routing.allocation.*"],
"alias_sync_enable": true,
"state_sync_enable": true
}</pre>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000002386790381__table13314194164411" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Request body parameters</caption><thead align="left"><tr id="EN-US_TOPIC_0000002386790381__row1931420413443"><th align="left" class="cellrowborder" valign="top" width="30%" id="mcps1.3.9.6.2.2.2.3.1.1"><p id="EN-US_TOPIC_0000002386790381__p13314114112444">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="70%" id="mcps1.3.9.6.2.2.2.3.1.2"><p id="EN-US_TOPIC_0000002386790381__p1631434111445">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000002386790381__row23141414444"><td class="cellrowborder" valign="top" width="30%" headers="mcps1.3.9.6.2.2.2.3.1.1 "><p id="EN-US_TOPIC_0000002386790381__p173141841154414">remote_cluster</p>
</td>
<td class="cellrowborder" valign="top" width="70%" headers="mcps1.3.9.6.2.2.2.3.1.2 "><p id="EN-US_TOPIC_0000002386790381__p13314241174414">Name of the leader cluster configuration task, which was set in <a href="#EN-US_TOPIC_0000002386790381__section1023014371242">Connecting the Leader and Follower Clusters</a>. <strong id="EN-US_TOPIC_0000002386790381__b1401184181323">leader1</strong> was set in our example.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000002386790381__row1431434119441"><td class="cellrowborder" valign="top" width="30%" headers="mcps1.3.9.6.2.2.2.3.1.1 "><p id="EN-US_TOPIC_0000002386790381__p631454117441">remote_index</p>
</td>
<td class="cellrowborder" valign="top" width="70%" headers="mcps1.3.9.6.2.2.2.3.1.2 "><p id="EN-US_TOPIC_0000002386790381__p12315194117446">Name of the index to be synchronized in the leader cluster</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000002386790381__row2315154154411"><td class="cellrowborder" valign="top" width="30%" headers="mcps1.3.9.6.2.2.2.3.1.1 "><p id="EN-US_TOPIC_0000002386790381__p1231514114420">local_index</p>
</td>
<td class="cellrowborder" valign="top" width="70%" headers="mcps1.3.9.6.2.2.2.3.1.2 "><p id="EN-US_TOPIC_0000002386790381__p17315164114447">Index name in the follower cluster</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000002386790381__row7315204194417"><td class="cellrowborder" valign="top" width="30%" headers="mcps1.3.9.6.2.2.2.3.1.1 "><p id="EN-US_TOPIC_0000002386790381__p831519418448">settings</p>
</td>
<td class="cellrowborder" valign="top" width="70%" headers="mcps1.3.9.6.2.2.2.3.1.2 "><p id="EN-US_TOPIC_0000002386790381__p931594118443">Index settings to be synchronized</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000002386790381__row145994251920"><td class="cellrowborder" valign="top" width="30%" headers="mcps1.3.9.6.2.2.2.3.1.1 "><p id="EN-US_TOPIC_0000002386790381__p5600625798">settings_sync_enable</p>
</td>
<td class="cellrowborder" valign="top" width="70%" headers="mcps1.3.9.6.2.2.2.3.1.2 "><p id="EN-US_TOPIC_0000002386790381__p460042513911">Whether to enable synchronization of index settings in the leader cluster. The default value is <span class="parmvalue" id="EN-US_TOPIC_0000002386790381__parmvalue85833014112"><b>false</b></span>.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000002386790381__row9961103211010"><td class="cellrowborder" valign="top" width="30%" headers="mcps1.3.9.6.2.2.2.3.1.1 "><p id="EN-US_TOPIC_0000002386790381__p1796153261011">settings_sync_patterns</p>
</td>
<td class="cellrowborder" valign="top" width="70%" headers="mcps1.3.9.6.2.2.2.3.1.2 "><p id="EN-US_TOPIC_0000002386790381__p996193271011">Prefix of leader cluster index settings to be synchronized. The default value is <span class="parmvalue" id="EN-US_TOPIC_0000002386790381__parmvalue1713191117116"><b>*</b></span>. This parameter takes effect when <span class="parmname" id="EN-US_TOPIC_0000002386790381__parmname9714101114110"><b>settings_sync_enable</b></span> is set to <span class="parmvalue" id="EN-US_TOPIC_0000002386790381__parmvalue1871418111819"><b>true</b></span>. The index settings configured in <span class="parmname" id="EN-US_TOPIC_0000002386790381__parmname177145111711"><b>settings</b></span> will not be synchronized.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000002386790381__row5535629151011"><td class="cellrowborder" valign="top" width="30%" headers="mcps1.3.9.6.2.2.2.3.1.1 "><p id="EN-US_TOPIC_0000002386790381__p1353532921020">settings_sync_exclude_patterns</p>
</td>
<td class="cellrowborder" valign="top" width="70%" headers="mcps1.3.9.6.2.2.2.3.1.2 "><p id="EN-US_TOPIC_0000002386790381__p1253582931013">Prefix of leader cluster index settings not to be synchronized. The default value is empty. This parameter is valid only when <span class="parmname" id="EN-US_TOPIC_0000002386790381__parmname1526117101714"><b>settings_sync_enable</b></span> is set to <span class="parmvalue" id="EN-US_TOPIC_0000002386790381__parmvalue208090121111"><b>true</b></span>.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000002386790381__row944942516100"><td class="cellrowborder" valign="top" width="30%" headers="mcps1.3.9.6.2.2.2.3.1.1 "><p id="EN-US_TOPIC_0000002386790381__p2044913254107">alias_sync_enable</p>
</td>
<td class="cellrowborder" valign="top" width="70%" headers="mcps1.3.9.6.2.2.2.3.1.2 "><p id="EN-US_TOPIC_0000002386790381__p18449122511100">Whether to enable index alias synchronization in the leader cluster. The default value is <span class="parmvalue" id="EN-US_TOPIC_0000002386790381__parmvalue1680114211111"><b>false</b></span>.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000002386790381__row12799112011106"><td class="cellrowborder" valign="top" width="30%" headers="mcps1.3.9.6.2.2.2.3.1.1 "><p id="EN-US_TOPIC_0000002386790381__p107991420151017">state_sync_enable</p>
</td>
<td class="cellrowborder" valign="top" width="70%" headers="mcps1.3.9.6.2.2.2.3.1.2 "><p id="EN-US_TOPIC_0000002386790381__p9799162015105">Whether to enable index status synchronization in the leader cluster. The default value is <span class="parmvalue" id="EN-US_TOPIC_0000002386790381__parmvalue84221224718"><b>false</b></span>.</p>
</td>
</tr>
</tbody>
</table>
</div>
</li></ul>
</div></div><div class="dropdownexpand"><div class="dropdowntitle" onclick="ExpandorCollapseNode(this)"><p id="EN-US_TOPIC_0000002386790381__p103415204378">Method 2: synchronizing all indexes matching a wildcard expression</p></div>
<div class="dropdowncontext"><ul id="EN-US_TOPIC_0000002386790381__ul178922155017"><li id="EN-US_TOPIC_0000002386790381__li6789121155020">Run the following command in the follower cluster to create a pattern-matching index synchronization policy, which synchronizes matched indexes from the leader cluster to the follower cluster:<pre class="screen" id="EN-US_TOPIC_0000002386790381__screen778972185018">PUT auto_sync/pattern/${PATTERN}
{
"remote_cluster": "<em id="EN-US_TOPIC_0000002386790381__i91531934115211">leader1</em>",
"remote_index_patterns": "<em id="EN-US_TOPIC_0000002386790381__i1731013675219">log*</em>",
"local_index_pattern": "<em id="EN-US_TOPIC_0000002386790381__i1860834117528">{{remote_index}}-sync</em>",
"apply_exist_index": true
}</pre>
</li><li id="EN-US_TOPIC_0000002386790381__li11790621195020">Run the following command in the follower cluster to create a pattern-matching index synchronization policy, which synchronizes matched indexes from the leader cluster to the follower cluster, with some of the index settings modified—enabling synchronization of index settings:<pre class="screen" id="EN-US_TOPIC_0000002386790381__screen979062110508">PUT auto_sync/pattern/${PATTERN}
{
"remote_cluster": "<em id="EN-US_TOPIC_0000002386790381__i186511118536">leader1</em>",
"remote_index_patterns": "<em id="EN-US_TOPIC_0000002386790381__i176592078533">log*</em>",
"local_index_pattern": "<em id="EN-US_TOPIC_0000002386790381__i18872131025310">{{remote_index}}-sync</em>",
"apply_exist_index": true,
"settings": {
"number_of_replicas": 4
},
"settings_sync_enable": true,
"settings_sync_patterns": ["*"],
"settings_sync_exclude_patterns": ["index.routing.allocation.*"],
"alias_sync_enable": true,
"state_sync_enable": true
}</pre>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000002386790381__en-us_topic_0000001268154469_table1284421662112" frame="border" border="1" rules="all"><caption><b>Table 3 </b>Request body parameters</caption><thead align="left"><tr id="EN-US_TOPIC_0000002386790381__en-us_topic_0000001268154469_row484481616219"><th align="left" class="cellrowborder" valign="top" width="30%" id="mcps1.3.9.8.2.2.2.3.1.1"><p id="EN-US_TOPIC_0000002386790381__en-us_topic_0000001268154469_p2844116192118">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="70%" id="mcps1.3.9.8.2.2.2.3.1.2"><p id="EN-US_TOPIC_0000002386790381__en-us_topic_0000001268154469_p11844101662111">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000002386790381__row8893103835010"><td class="cellrowborder" valign="top" width="30%" headers="mcps1.3.9.8.2.2.2.3.1.1 "><p id="EN-US_TOPIC_0000002386790381__p17648154310502">PATTERN</p>
</td>
<td class="cellrowborder" valign="top" width="70%" headers="mcps1.3.9.8.2.2.2.3.1.2 "><p id="EN-US_TOPIC_0000002386790381__p36491443185015">Name of the pattern for index matching.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000002386790381__en-us_topic_0000001268154469_row12844161612114"><td class="cellrowborder" valign="top" width="30%" headers="mcps1.3.9.8.2.2.2.3.1.1 "><p id="EN-US_TOPIC_0000002386790381__en-us_topic_0000001268154469_p184421642110">remote_cluster</p>
</td>
<td class="cellrowborder" valign="top" width="70%" headers="mcps1.3.9.8.2.2.2.3.1.2 "><p id="EN-US_TOPIC_0000002386790381__en-us_topic_0000001268154469_p168446161215">Name of the leader cluster configuration task, which was set in <a href="#EN-US_TOPIC_0000002386790381__section1023014371242">Connecting the Leader and Follower Clusters</a>. In our example, <span class="parmvalue" id="EN-US_TOPIC_0000002386790381__parmvalue15344165313117"><b>leader1</b></span> is used.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000002386790381__en-us_topic_0000001268154469_row284411682114"><td class="cellrowborder" valign="top" width="30%" headers="mcps1.3.9.8.2.2.2.3.1.1 "><p id="EN-US_TOPIC_0000002386790381__en-us_topic_0000001268154469_p4844101614218">remote_index_patterns</p>
</td>
<td class="cellrowborder" valign="top" width="70%" headers="mcps1.3.9.8.2.2.2.3.1.2 "><p id="EN-US_TOPIC_0000002386790381__en-us_topic_0000001268154469_p1784431612114">Pattern for matching indexes to be synchronized in the leader cluster. The wildcard (*) is supported.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000002386790381__en-us_topic_0000001268154469_row4844016152112"><td class="cellrowborder" valign="top" width="30%" headers="mcps1.3.9.8.2.2.2.3.1.1 "><p id="EN-US_TOPIC_0000002386790381__en-us_topic_0000001268154469_p158441216192113">local_index_pattern</p>
</td>
<td class="cellrowborder" valign="top" width="70%" headers="mcps1.3.9.8.2.2.2.3.1.2 "><p id="EN-US_TOPIC_0000002386790381__en-us_topic_0000001268154469_p484431672119">Index pattern in the follower cluster. The index template can be replaced. For example, if this parameter is set to <strong id="EN-US_TOPIC_0000002386790381__b284613789323">{{remote_index}}-sync</strong>, the index <strong id="EN-US_TOPIC_0000002386790381__b892778887323">log1</strong> changes to <strong id="EN-US_TOPIC_0000002386790381__b1866221549323">log1-sync</strong> after synchronization.</p>
<p id="EN-US_TOPIC_0000002386790381__p16436195715404">If leader/follower switchover is likely to happen, set this parameter to <span class="parmvalue" id="EN-US_TOPIC_0000002386790381__parmvalue03827849"><b>{{remote_index}}</b></span> to ensure that the leader and follower clusters use identical index names.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000002386790381__en-us_topic_0000001268154469_row10518142315249"><td class="cellrowborder" valign="top" width="30%" headers="mcps1.3.9.8.2.2.2.3.1.1 "><p id="EN-US_TOPIC_0000002386790381__en-us_topic_0000001268154469_p0518162392410">apply_exist_index</p>
</td>
<td class="cellrowborder" valign="top" width="70%" headers="mcps1.3.9.8.2.2.2.3.1.2 "><p id="EN-US_TOPIC_0000002386790381__en-us_topic_0000001268154469_p14518823192414">Whether to synchronize existing indexes in the leader cluster. The default value is <span class="parmvalue" id="EN-US_TOPIC_0000002386790381__parmvalue1997116133214"><b>true</b></span>.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000002386790381__en-us_topic_0000001268154469_row13845171602117"><td class="cellrowborder" valign="top" width="30%" headers="mcps1.3.9.8.2.2.2.3.1.1 "><p id="EN-US_TOPIC_0000002386790381__en-us_topic_0000001268154469_p13845141614214">settings</p>
</td>
<td class="cellrowborder" valign="top" width="70%" headers="mcps1.3.9.8.2.2.2.3.1.2 "><p id="EN-US_TOPIC_0000002386790381__en-us_topic_0000001268154469_p10845131682115">Index settings to be synchronized</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000002386790381__row15276564184"><td class="cellrowborder" valign="top" width="30%" headers="mcps1.3.9.8.2.2.2.3.1.1 "><p id="EN-US_TOPIC_0000002386790381__p128155671815">settings_sync_enable</p>
</td>
<td class="cellrowborder" valign="top" width="70%" headers="mcps1.3.9.8.2.2.2.3.1.2 "><p id="EN-US_TOPIC_0000002386790381__p6281456191817">Whether to enable synchronization of index settings in the leader cluster. The default value is <span class="parmvalue" id="EN-US_TOPIC_0000002386790381__parmvalue1475191614211"><b>false</b></span>.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000002386790381__row12523105917184"><td class="cellrowborder" valign="top" width="30%" headers="mcps1.3.9.8.2.2.2.3.1.1 "><p id="EN-US_TOPIC_0000002386790381__p18523459171810">settings_sync_patterns</p>
</td>
<td class="cellrowborder" valign="top" width="70%" headers="mcps1.3.9.8.2.2.2.3.1.2 "><p id="EN-US_TOPIC_0000002386790381__p105238592185">Prefix of leader cluster index settings to be synchronized. The default value is <span class="parmvalue" id="EN-US_TOPIC_0000002386790381__parmvalue1947108737"><b>*</b></span>. This parameter takes effect when <span class="parmname" id="EN-US_TOPIC_0000002386790381__parmname564372023"><b>settings_sync_enable</b></span> is set to <span class="parmvalue" id="EN-US_TOPIC_0000002386790381__parmvalue183111069"><b>true</b></span>. The index settings configured in <span class="parmname" id="EN-US_TOPIC_0000002386790381__parmname1033717303"><b>settings</b></span> will not be synchronized.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000002386790381__row5831827198"><td class="cellrowborder" valign="top" width="30%" headers="mcps1.3.9.8.2.2.2.3.1.1 "><p id="EN-US_TOPIC_0000002386790381__p198311228194">settings_sync_exclude_patterns</p>
</td>
<td class="cellrowborder" valign="top" width="70%" headers="mcps1.3.9.8.2.2.2.3.1.2 "><p id="EN-US_TOPIC_0000002386790381__p178321126192">Prefix of leader cluster index settings not to be synchronized. The default value is empty. This parameter is valid only when <span class="parmname" id="EN-US_TOPIC_0000002386790381__parmname168834291623"><b>settings_sync_enable</b></span> is set to <span class="parmvalue" id="EN-US_TOPIC_0000002386790381__parmvalue72551533925"><b>true</b></span>.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000002386790381__row10121668192"><td class="cellrowborder" valign="top" width="30%" headers="mcps1.3.9.8.2.2.2.3.1.1 "><p id="EN-US_TOPIC_0000002386790381__p111216121910">alias_sync_enable</p>
</td>
<td class="cellrowborder" valign="top" width="70%" headers="mcps1.3.9.8.2.2.2.3.1.2 "><p id="EN-US_TOPIC_0000002386790381__p14124661918">Whether to enable index alias synchronization in the leader cluster. The default value is <span class="parmvalue" id="EN-US_TOPIC_0000002386790381__parmvalue135236351924"><b>false</b></span>.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000002386790381__row41545901918"><td class="cellrowborder" valign="top" width="30%" headers="mcps1.3.9.8.2.2.2.3.1.1 "><p id="EN-US_TOPIC_0000002386790381__p1915499161917">state_sync_enable</p>
</td>
<td class="cellrowborder" valign="top" width="70%" headers="mcps1.3.9.8.2.2.2.3.1.2 "><p id="EN-US_TOPIC_0000002386790381__p31544911911">Whether to enable index status synchronization in the leader cluster. The default value is <span class="parmvalue" id="EN-US_TOPIC_0000002386790381__parmvalue977723913212"><b>false</b></span>.</p>
</td>
</tr>
</tbody>
</table>
</div>
</li></ul>
</div></div></div>
<div class="section" id="EN-US_TOPIC_0000002386790381__section1012905085616"><a name="EN-US_TOPIC_0000002386790381__section1012905085616"></a><a name="section1012905085616"></a><h4 class="sectiontitle">Stopping Index Synchronization</h4><p id="EN-US_TOPIC_0000002386790381__en-us_topic_0000001268394301_p1918723104920">Run the following command in the follower cluster to stop synchronization tasks for specified indexes. Subsequent changes to the indexes in the leader cluster will not be synchronized to the follower cluster. The read-only state of the indexes in the follower cluster will be cancelled, so that new data can be written into them.</p>
<pre class="screen" id="EN-US_TOPIC_0000002386790381__en-us_topic_0000001268394301_screen328271563114">PUT <em id="EN-US_TOPIC_0000002386790381__i1575119381408">log*</em>/stop_remote_sync</pre>
<p id="EN-US_TOPIC_0000002386790381__p92841558195719">In this command, <span class="parmvalue" id="EN-US_TOPIC_0000002386790381__parmvalue1074705627323"><b>log*</b></span> indicates the index name. You can specify multiple index names (separated by commas) or use a wildcard. In this example, synchronization tasks for all indexes that start with <strong id="EN-US_TOPIC_0000002386790381__b338552738323">log</strong> are stopped.</p>
</div>
<div class="section" id="EN-US_TOPIC_0000002386790381__section1147716276219"><a name="EN-US_TOPIC_0000002386790381__section1147716276219"></a><a name="section1147716276219"></a><h4 class="sectiontitle">Querying and Deleting Created Patterns</h4><ol id="EN-US_TOPIC_0000002386790381__ol590946947"><li id="EN-US_TOPIC_0000002386790381__li090918616415">Run the following command in the follower cluster to query created patterns:<ul id="EN-US_TOPIC_0000002386790381__ul1435912192519"><li id="EN-US_TOPIC_0000002386790381__li33590191250">Query the list of patterns.<pre class="screen" id="EN-US_TOPIC_0000002386790381__screen1980094213416">GET auto_sync/pattern</pre>
</li><li id="EN-US_TOPIC_0000002386790381__li173591193510">Query a specified pattern by name.<pre class="screen" id="EN-US_TOPIC_0000002386790381__screen75041533419">GET auto_sync/pattern/{PATTERN}</pre>
</li></ul>
<p id="EN-US_TOPIC_0000002386790381__p15041431644">The following is an example of the response:</p>
<pre class="screen" id="EN-US_TOPIC_0000002386790381__screen145044315417">{
"patterns" : [
{
"name" : "pattern1",
"pattern" : {
"remote_cluster" : "leader",
"remote_index_patterns" : [
"log*"
],
"local_index_pattern" : "{{remote_index}}-sync",
"settings" : { }
}
}
]
}</pre>
</li><li id="EN-US_TOPIC_0000002386790381__li0909567411">Run the following command in the follower cluster to delete a specified pattern by name:<pre class="screen" id="EN-US_TOPIC_0000002386790381__en-us_topic_0000001223754412_screen5658180104516">DELETE auto_sync/pattern/{PATTERN}</pre>
</li></ol>
</div>
<div class="section" id="EN-US_TOPIC_0000002386790381__section06477291115"><h4 class="sectiontitle">Enabling Forcible Synchronization</h4><p id="EN-US_TOPIC_0000002386790381__p171871820015">By default, the plug-in determines whether to synchronize metadata based on whether the number of documents in the index of the leader cluster changes. If the leader cluster only updates documents and the number of documents remains unchanged, the plug-in does not synchronize the updates to the follower cluster. The configuration can be modified. After forcible synchronization is enabled, the index metadata of the leader cluster is forcibly synchronized to the follower cluster in each synchronization cycle.</p>
<p id="EN-US_TOPIC_0000002386790381__p17718151810018">The following is an example of enabling forcible synchronization:</p>
<pre class="screen" id="EN-US_TOPIC_0000002386790381__screen10160172810015">PUT _cluster/settings
{
"persistent": {
"remote_sync.force_synchronize": true
}
}</pre>
</div>
<div class="section" id="EN-US_TOPIC_0000002386790381__section94973244119"><a name="EN-US_TOPIC_0000002386790381__section94973244119"></a><a name="section94973244119"></a><h4 class="sectiontitle">Changing the Synchronization Interval</h4><p id="EN-US_TOPIC_0000002386790381__en-us_topic_0000001223754412_p214154518462">The default synchronization interval between the leader and follower clusters is 30 seconds and can be changed.</p>
<p id="EN-US_TOPIC_0000002386790381__en-us_topic_0000001223754412_p1517434513510">The example request below changes the synchronization interval to 2 seconds:</p>
<pre class="screen" id="EN-US_TOPIC_0000002386790381__en-us_topic_0000001223754412_screen1049271212486">PUT {index_name}/_settings
{
"index.remote_sync.sync_interval": "2s"
}</pre>
</div>
<div class="section" id="EN-US_TOPIC_0000002386790381__section1290762813115"><h4 class="sectiontitle">Changing the Synchronization Speed</h4><p id="EN-US_TOPIC_0000002386790381__p11162175483219">You can change the data synchronization speed between the leader and follower clusters by configuring cluster-level settings.</p>
<p id="EN-US_TOPIC_0000002386790381__p121631054163213">The following is an example request: set the block size to 2 MB, the number of blocks to 20, and the maximum synchronization traffic to 100 MB per second.</p>
<pre class="screen" id="EN-US_TOPIC_0000002386790381__screen1168865012503">PUT _cluster/settings
{
"persistent": {
"remote_sync.chunk_size": "2MB",
"remote_sync.max_concurrent_file_chunks": 20,
"remote_sync.max_bytes_per_sec": "100MB"
}
}</pre>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000002386790381__table14349111215118" frame="border" border="1" rules="all"><caption><b>Table 4 </b>Request body parameters</caption><thead align="left"><tr id="EN-US_TOPIC_0000002386790381__row73508120517"><th align="left" class="cellrowborder" valign="top" width="30%" id="mcps1.3.14.5.2.3.1.1"><p id="EN-US_TOPIC_0000002386790381__p103501612125111">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="70%" id="mcps1.3.14.5.2.3.1.2"><p id="EN-US_TOPIC_0000002386790381__p14350111216515">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000002386790381__row10350912185119"><td class="cellrowborder" valign="top" width="30%" headers="mcps1.3.14.5.2.3.1.1 "><p id="EN-US_TOPIC_0000002386790381__p171272316519">remote_sync.chunk_size</p>
</td>
<td class="cellrowborder" valign="top" width="70%" headers="mcps1.3.14.5.2.3.1.2 "><p id="EN-US_TOPIC_0000002386790381__p8777539518">Block size for index synchronization.</p>
<p id="EN-US_TOPIC_0000002386790381__p88231556175114">Default value: 1 MB</p>
<p id="EN-US_TOPIC_0000002386790381__p1922903814529">Format: a string of characters</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000002386790381__row135061295113"><td class="cellrowborder" valign="top" width="30%" headers="mcps1.3.14.5.2.3.1.1 "><p id="EN-US_TOPIC_0000002386790381__p8127531125112">remote_sync.max_concurrent_file_chunks</p>
</td>
<td class="cellrowborder" valign="top" width="70%" headers="mcps1.3.14.5.2.3.1.2 "><p id="EN-US_TOPIC_0000002386790381__p877115314514">Number of blocks for concurrent index synchronization.</p>
<p id="EN-US_TOPIC_0000002386790381__p499225617526">Default value: <strong id="EN-US_TOPIC_0000002386790381__b200534366323">10</strong></p>
<p id="EN-US_TOPIC_0000002386790381__p16992165655220">Format: a number</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000002386790381__row73506123517"><td class="cellrowborder" valign="top" width="30%" headers="mcps1.3.14.5.2.3.1.1 "><p id="EN-US_TOPIC_0000002386790381__p1612783115518">remote_sync.max_bytes_per_sec</p>
</td>
<td class="cellrowborder" valign="top" width="70%" headers="mcps1.3.14.5.2.3.1.2 "><p id="EN-US_TOPIC_0000002386790381__p077145320517">Maximum data synchronization traffic per second.</p>
<p id="EN-US_TOPIC_0000002386790381__p18247135915523">Default value: 40 MB</p>
<p id="EN-US_TOPIC_0000002386790381__p924711599521">Format: a string of characters</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="EN-US_TOPIC_0000002386790381__section521113511997"><h4 class="sectiontitle">Querying Index Synchronization Status</h4><p id="EN-US_TOPIC_0000002386790381__p182053218182">Obtain the auto synchronization status of a specified index.</p>
<p id="EN-US_TOPIC_0000002386790381__p1054313541710">An example request is as follows:</p>
<pre class="screen" id="EN-US_TOPIC_0000002386790381__en-us_topic_0000001223754412_screen15143152684719">GET {index_name}/sync_stats</pre>
<p id="EN-US_TOPIC_0000002386790381__en-us_topic_0000001223754412_p102933159471">The following is an example of the response:</p>
<pre class="screen" id="EN-US_TOPIC_0000002386790381__en-us_topic_0000001223754412_screen1102144314719">{
"indices" : {
"data1_follower" : {
"shards" : {
"0" : [
{
"primary" : false, // Whether it is a primary shard
"total_synced_times" : 27, // Total synchronization times
"total_empty_times" : 25, // Total number of times when no data is synchronized between the leader and follower clusters because they have identical shards and data
"total_synced_files" : 4, // Number of synchronized files
"total_synced_bytes" : 3580, // Total size of synchronized files
"total_paused_nanos" : 0, //Duration of synchronization pauses due to traffic throttling
"total_paused_times" : 0, //Number of synchronization pauses due to traffic throttling
"current" : {
"files_count" : 0, //Number of files that are being synchronized
"finished_files_count" : 0, //Number of files that have been synchronized
"bytes" : 0, //Size of files that are being synchronized
"finished_bytes" : 0 //Size of files that have been synchronized
}
},
{
"primary" : true, // Whether it is a primary shard
"total_synced_times" : 28, // Total synchronization times
"total_empty_times" : 26, // Total number of times when no data is synchronized between the leader and follower clusters because they have identical shards and data
"total_synced_files": 20, // Number of synchronized files
"total_synced_bytes": 17547, // Total size of synchronized files
"total_paused_nanos" : 0, //Duration of synchronization pauses due to traffic throttling
"total_paused_times" : 0, //Number of synchronization pauses due to traffic throttling
"current" : {
"files_count" : 0, //Number of files that are being synchronized
"finished_files_count" : 0, //Number of files that have been synchronized
"bytes" : 0, //Size of files that are being synchronized
"finished_bytes" : 0 //Size of files that have been synchronized
}
}
]
}
}
}
}</pre>
</div>
<div class="section" id="EN-US_TOPIC_0000002386790381__section62831838161012"><a name="EN-US_TOPIC_0000002386790381__section62831838161012"></a><a name="section62831838161012"></a><h4 class="sectiontitle">Switching the Roles of the Leader and Follower Clusters</h4><p id="EN-US_TOPIC_0000002386790381__p1018865812126">When the leader cluster becomes faulty, perform a leader/follower switchover to have the follower cluster take over services. The steps are as follows:</p>
<div class="caution" id="EN-US_TOPIC_0000002386790381__note214124217395"><span class="cautiontitle"><img src="public_sys-resources/caution_3.0-en-us.png"> </span><div class="cautionbody"><p id="EN-US_TOPIC_0000002386790381__p19141184293912">Leader/follower switchover won't work unless the leader and follower clusters use identical index names.</p>
</div></div>
<ol id="EN-US_TOPIC_0000002386790381__ol8936352131318"><li id="EN-US_TOPIC_0000002386790381__li13936552191320">Determine the index synchronization method between the leader and follower clusters. Check whether pattern-matching index synchronization policies have been configured in the follower cluster. For the command to use, see <a href="#EN-US_TOPIC_0000002386790381__section1147716276219">Querying and Deleting Created Patterns</a>.<ul id="EN-US_TOPIC_0000002386790381__ul17259114121913"><li id="EN-US_TOPIC_0000002386790381__li1925924115195">If there are no such policies, synchronization is performed for specified indexes between the leader and follower clusters. In this case, go to <a href="#EN-US_TOPIC_0000002386790381__li20906161442213">3</a>.</li><li id="EN-US_TOPIC_0000002386790381__li12719161122011">If there are such policies, index synchronization between the leader and follower clusters is based on index patterns. In this case, go to <a href="#EN-US_TOPIC_0000002386790381__li077084319314">2</a>.</li></ul>
</li><li id="EN-US_TOPIC_0000002386790381__li077084319314"><a name="EN-US_TOPIC_0000002386790381__li077084319314"></a><a name="li077084319314"></a>Delete pattern-matching index synchronization policies in the follower cluster. For the command to use, see <a href="#EN-US_TOPIC_0000002386790381__section1147716276219">Querying and Deleting Created Patterns</a>.</li><li id="EN-US_TOPIC_0000002386790381__li20906161442213"><a name="EN-US_TOPIC_0000002386790381__li20906161442213"></a><a name="li20906161442213"></a>Perform <a href="#EN-US_TOPIC_0000002386790381__section1012905085616">Stopping Index Synchronization</a> in the follower cluster. Then redirect read and write traffic to it. If the leader and follower clusters synchronize indexes based on index patterns, use a wildcard to match indexes when running the command that stops index synchronization.</li><li id="EN-US_TOPIC_0000002386790381__li1850739132913">After the leader cluster recovers, configure information about the follower cluster in the leader cluster, and connect the leader and follower clusters again. For details, see <a href="#EN-US_TOPIC_0000002386790381__section1023014371242">Connecting the Leader and Follower Clusters</a>.</li><li id="EN-US_TOPIC_0000002386790381__li1378912702410">Under the leader cluster, perform <a href="#EN-US_TOPIC_0000002386790381__section97051931358">Index Synchronization</a> to synchronize data from the follower cluster to the leader cluster, and then perform a leader/follower switchover to switch back.</li></ol>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="css_01_0095.html">Enhancing Search Capabilities for OpenSearch Clusters</a></div>
</div>
</div>