forked from docs/doc-exports
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com> Co-authored-by: zhengxiu <zhengxiu@huawei.com> Co-committed-by: zhengxiu <zhengxiu@huawei.com>
22 lines
3.9 KiB
HTML
22 lines
3.9 KiB
HTML
<a name="EN-US_TOPIC_0000001960517841"></a><a name="EN-US_TOPIC_0000001960517841"></a>
|
|
|
|
<h1 class="topictitle1">How Do I Change the Number of Replicas for Elasticsearch Indexes in CSS?</h1>
|
|
<div id="body1594694216151"><p id="EN-US_TOPIC_0000001960517841__p147534195221">When creating an index for an Elasticsearch cluster, you can specify the number of shards, that is, the number of primary shards. Once an index is created, the number of primary shards cannot be changed, but the number of replicas can be changed. <strong id="EN-US_TOPIC_0000001960517841__b4153154310416">Number of replica shards = Number of primary shards x Number of replicas.</strong></p>
|
|
<ol id="EN-US_TOPIC_0000001960517841__ol07902140177"><li id="EN-US_TOPIC_0000001960517841__li8723742122813">Log in to Kibana and go to the command execution page. Elasticsearch clusters support multiple access methods. This topic uses Kibana as an example to describe the operation procedures.<ol type="a" id="EN-US_TOPIC_0000001960517841__ol382519113291"><li id="EN-US_TOPIC_0000001960517841__en-us_topic_0000002338102386_en-us_topic_0000002271391393_en-us_topic_0000001268594549_li5509181942419"><span id="EN-US_TOPIC_0000001960517841__en-us_topic_0000002338102386_ph152259618315">Log in to the CSS management console.</span></li><li id="EN-US_TOPIC_0000001960517841__en-us_topic_0000002338102386_en-us_topic_0000002271391393_li4250043448">In the navigation pane on the left, choose <span class="uicontrol" id="EN-US_TOPIC_0000001960517841__en-us_topic_0000002338102386_uicontrol192689888185117"><b>Clusters > Elasticsearch</b></span>.</li><li id="EN-US_TOPIC_0000001960517841__en-us_topic_0000002338102386_en-us_topic_0000002271391393_en-us_topic_0000001268154521_li6012554340">In the cluster list, find the target cluster, and click <strong id="EN-US_TOPIC_0000001960517841__en-us_topic_0000002338102386_b18928803044129">Kibana</strong> in the <strong id="EN-US_TOPIC_0000001960517841__en-us_topic_0000002338102386_b5255083364129">Operation</strong> column to log in to the Kibana console.</li><li id="EN-US_TOPIC_0000001960517841__en-us_topic_0000002338102386_en-us_topic_0000002271391393_li270075935613">In the left navigation pane, choose <strong id="EN-US_TOPIC_0000001960517841__en-us_topic_0000002338102386_b3927845824129">Dev Tools</strong>.<p id="EN-US_TOPIC_0000001960517841__en-us_topic_0000002338102386_p1810995434510">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>
|
|
</li><li id="EN-US_TOPIC_0000001960517841__li14862181111420">On the Kibana console, run the following command to check the number of replicas for each Elasticsearch index:<pre class="screen" id="EN-US_TOPIC_0000001960517841__screen201501640346">GET _cat/indices?v</pre>
|
|
<div class="fignone" id="EN-US_TOPIC_0000001960517841__fig985919114415"><span class="figcap"><b>Figure 1 </b>Checking the number of replicas</span><br><span><img id="EN-US_TOPIC_0000001960517841__image4252362162" src="figure/en-us_image_0000002021082885.png"></span></div>
|
|
</li><li id="EN-US_TOPIC_0000001960517841__li3398121621715">Run the following command to configure the number of index replicas:<pre class="screen" id="EN-US_TOPIC_0000001960517841__screen13254200258">PUT /indexname/_settings
|
|
{
|
|
"number_of_replicas" :1 //Number of replicas
|
|
}</pre>
|
|
<p id="EN-US_TOPIC_0000001960517841__p427311208613"><span class="parmname" id="EN-US_TOPIC_0000001960517841__parmname351311268615"><b>indexname</b></span> indicates the name of the index to be modified, and <span class="parmname" id="EN-US_TOPIC_0000001960517841__parmname1214119291068"><b>number_of_replicas</b></span> indicates the number of replicas to be set.</p>
|
|
</li></ol>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="css_02_0055.html">Using CSS Cluster Search Engines</a></div>
|
|
</div>
|
|
</div>
|
|
|