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>
592 lines
58 KiB
HTML
592 lines
58 KiB
HTML
<a name="css_01_0406"></a><a name="css_01_0406"></a>
|
||
|
||
<h1 class="topictitle1">Configuring Flow Control 2.0 for an Elasticsearch Cluster</h1>
|
||
<div id="body0000001485293237"><div class="section" id="css_01_0406__section20798162114246"><h4 class="sectiontitle">Scenario</h4><p id="css_01_0406__p13110332192412">Flow Control 2.0 controls traffic at the node level. You can configure blacklists and whitelists per node, the maximum concurrent HTTP connections allowed, and the maximum HTTP connections allowed. You can also configure node heap memory-based flow control that uses a backpressure mechanism, or one-click traffic blocking. CSS can also collect statistics on node access IP addresses and URLs. When backpressure is enabled, large requests will be rejected by nodes when their heap memory usage is high. This mechanism prevents nodes from breaking down and reduces the risk of node unavailability.</p>
|
||
|
||
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="css_01_0406__table184021944184915" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Flow control policies</caption><thead align="left"><tr id="css_01_0406__row154031944104913"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.1.3.2.4.1.1"><p id="css_01_0406__p8403104418494">Policy</p>
|
||
</th>
|
||
<th align="left" class="cellrowborder" valign="top" width="55.00000000000001%" id="mcps1.3.1.3.2.4.1.2"><p id="css_01_0406__p6403344154917">Description</p>
|
||
</th>
|
||
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.1.3.2.4.1.3"><p id="css_01_0406__p840364434913">Details</p>
|
||
</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody><tr id="css_01_0406__row140384444912"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.1.3.2.4.1.1 "><p id="css_01_0406__p740317443499">HTTP/HTTPS flow control</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="55.00000000000001%" headers="mcps1.3.1.3.2.4.1.2 "><ul id="css_01_0406__en-us_topic_0000001435653860_ul7877151619443"><li id="css_01_0406__en-us_topic_0000001435653860_li162251814505">You can control cluster access by client IP address or subnet through the HTTP/HTTPS blacklist or whitelist. If an IP address is in the blacklist, the client is disconnected right away and all its requests are rejected. The whitelist takes precedence over the blacklist. If a client IP address is on both the blacklist and whitelist, requests from it will not be rejected.</li><li id="css_01_0406__en-us_topic_0000001435653860_li1515102425012">Flow control based on concurrent HTTP/HTTPS connections limits the total number of HTTP/HTTPS connections to a node per second.</li><li id="css_01_0406__en-us_topic_0000001435653860_li8866192713502">Flow control based on new HTTP/HTTPS connections limits the number of new connections to a node.</li></ul>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.1.3.2.4.1.3 "><p id="css_01_0406__p124031144124912"><a href="#css_01_0406__section1023014371242">Enabling HTTP/HTTPS Flow Control per Node</a></p>
|
||
</td>
|
||
</tr>
|
||
<tr id="css_01_0406__row940304434916"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.1.3.2.4.1.1 "><p id="css_01_0406__p640374454910">Memory flow control</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="55.00000000000001%" headers="mcps1.3.1.3.2.4.1.2 "><p id="css_01_0406__p224422815105">Memory flow control limits write traffic based on the node heap memory. It uses a backpressure mechanism to ask the client to slow down or stop sending requests. In the meantime, it triggers garbage collection to reclaim resources, and continues to process requests based on heap memory available.</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.1.3.2.4.1.3 "><p id="css_01_0406__p64031744164916"><a href="#css_01_0406__section12926193210818">Enabling Memory Flow Control</a></p>
|
||
</td>
|
||
</tr>
|
||
<tr id="css_01_0406__row5403194410491"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.1.3.2.4.1.1 "><p id="css_01_0406__p154031344194910">Request sampling</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="55.00000000000001%" headers="mcps1.3.1.3.2.4.1.2 "><p id="css_01_0406__p1974103413103">Request sampling can record the access of client IP addresses and the type of requests from the client. Based on such statistics, you can identify the access traffic of specific client IP addresses and analyze write and query traffic from them.</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.1.3.2.4.1.3 "><p id="css_01_0406__p1063520551952"><a href="#css_01_0406__section846243514132">Enabling Request Sampling</a></p>
|
||
</td>
|
||
</tr>
|
||
<tr id="css_01_0406__row19403144413497"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.1.3.2.4.1.1 "><p id="css_01_0406__p640315445493">One-click traffic blocking</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="55.00000000000001%" headers="mcps1.3.1.3.2.4.1.2 "><p id="css_01_0406__p108911538171010">One-click traffic blocking blocks all client connections to a node. This, however, does not include connections for Kibana access, CSS O&M, or monitoring APIs. The purpose is to protect cluster nodes in the face of traffic spikes or to quickly restore clusters.</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.1.3.2.4.1.3 "><p id="css_01_0406__p84031844174915"><a href="#css_01_0406__section364216459204">Enable One-Click Traffic Blocking</a></p>
|
||
</td>
|
||
</tr>
|
||
<tr id="css_01_0406__row1740318444495"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.1.3.2.4.1.1 "><p id="css_01_0406__p1140314444914">Flow control</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="55.00000000000001%" headers="mcps1.3.1.3.2.4.1.2 "><p id="css_01_0406__p146419425107">Flow control provides an independent API for checking traffic statistics, including the number of existing client connections as well as client connections where backpressure has been applied. You can evaluate the flow control threshold and analyze the cluster load based on these statistics.</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.1.3.2.4.1.3 "><p id="css_01_0406__p1540317443491"><a href="#css_01_0406__section03781045277">Viewing Flow Control Information</a></p>
|
||
</td>
|
||
</tr>
|
||
<tr id="css_01_0406__row3403114494912"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.1.3.2.4.1.1 "><p id="css_01_0406__p1640384474919">Access logging</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="55.00000000000001%" headers="mcps1.3.1.3.2.4.1.2 "><p id="css_01_0406__p14728104619109">Access logs record the URLs and bodies of HTTP/HTTPS requests received by nodes within a period of time. You can analyze the current traffic load based on the access logs.</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.1.3.2.4.1.3 "><p id="css_01_0406__p15403174494918"><a href="#css_01_0406__section1626791610277">Enabling and Viewing Access Logs</a></p>
|
||
</td>
|
||
</tr>
|
||
<tr id="css_01_0406__row640315447498"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.1.3.2.4.1.1 "><p id="css_01_0406__p2403134414491">Access logging in files</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="55.00000000000001%" headers="mcps1.3.1.3.2.4.1.2 "><p id="css_01_0406__p640354434911">Any cluster access is recorded in the <strong id="css_01_0406__b18537151112418">{<em id="css_01_0406__i4658652416">Cluster name</em>_access_log.log}</strong> file. You can use the log backup function to view detailed access logs on OBS.</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.1.3.2.4.1.3 "><p id="css_01_0406__p140344419496"><a href="#css_01_0406__section072285622916">Enabling Access Logging in Files</a></p>
|
||
</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
</div>
|
||
<div class="section" id="css_01_0406__section1995816338248"><h4 class="sectiontitle">Constraints</h4><ul id="css_01_0406__en-us_topic_0000001268594569_ul1969619523572"><li id="css_01_0406__li6429455204117"><span id="css_01_0406__ph4459162313420">Elasticsearch 7.6.2 and Elasticsearch 7.10.2 clusters created after January 2023 support Flow Control 2.0 only, whereas those created before that support Flow Control 1.0 only.</span></li><li id="css_01_0406__li155602458257">Flow control may hurt the performance of some nodes.</li><li id="css_01_0406__li35609458253">If flow control is enabled, user requests that exceed the flow control threshold will be rejected.</li><li id="css_01_0406__li11758153101116">Enabling memory flow control may hurt the performance of some search requests or cause some Kibana search requests to fail.</li><li id="css_01_0406__li546091212271">Enabling access logging may hurt cluster performance.</li><li id="css_01_0406__en-us_topic_0000001268594569_li1569675205710">Memory flow control is based on request paths. Avoid configuring too many paths or paths that are too long, as they may hurt cluster performance.</li></ul>
|
||
</div>
|
||
<div class="section" id="css_01_0406__section1023014371242"><a name="css_01_0406__section1023014371242"></a><a name="section1023014371242"></a><h4 class="sectiontitle">Enabling HTTP/HTTPS Flow Control per Node</h4><ol id="css_01_0406__ol764618520817"><li id="css_01_0406__li96466521484">Run the following command to enable HTTP/HTTPS flow control for cluster nodes:<pre class="screen" id="css_01_0406__screen4250194796">PUT /_cluster/settings
|
||
{
|
||
"persistent": {
|
||
"flowcontrol.http.enabled": true,
|
||
"flowcontrol.http.allow": ["<em id="css_01_0406__i2025014419912">192.168.0.1/24</em>", "<em id="css_01_0406__i52507417911">192.168.2.1/24</em>"],
|
||
"flowcontrol.http.deny": "<em id="css_01_0406__i125015418914">192.168.1.1/24</em>",
|
||
"flowcontrol.http.concurrent": <em id="css_01_0406__i92501246919">1000</em>,
|
||
"flowcontrol.http.newconnect": <em id="css_01_0406__i182501849911">1000</em>,
|
||
"flowcontrol.http.warmup_period": <em id="css_01_0406__i52504411917">0</em>
|
||
}
|
||
}</pre>
|
||
|
||
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="css_01_0406__en-us_topic_0000001485533945_en-us_topic_0000001228531978_table131951219400" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Configuration items for HTTP/HTTPS flow control</caption><thead align="left"><tr id="css_01_0406__en-us_topic_0000001485533945_en-us_topic_0000001228531978_row161965164016"><th align="left" class="cellrowborder" valign="top" width="31.290000000000003%" id="mcps1.3.3.2.1.2.2.4.1.1"><p id="css_01_0406__en-us_topic_0000001485533945_en-us_topic_0000001228531978_p61968134011">Configuration Item</p>
|
||
</th>
|
||
<th align="left" class="cellrowborder" valign="top" width="17.44%" id="mcps1.3.3.2.1.2.2.4.1.2"><p id="css_01_0406__en-us_topic_0000001485533945_en-us_topic_0000001228531978_p71961116401">Type</p>
|
||
</th>
|
||
<th align="left" class="cellrowborder" valign="top" width="51.27%" id="mcps1.3.3.2.1.2.2.4.1.3"><p id="css_01_0406__en-us_topic_0000001485533945_en-us_topic_0000001228531978_p111961018403">Description</p>
|
||
</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody><tr id="css_01_0406__en-us_topic_0000001485533945_en-us_topic_0000001228531978_row1319619174010"><td class="cellrowborder" valign="top" width="31.290000000000003%" headers="mcps1.3.3.2.1.2.2.4.1.1 "><p id="css_01_0406__en-us_topic_0000001485533945_en-us_topic_0000001228531978_p1119661194016">flowcontrol.http.enabled</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="17.44%" headers="mcps1.3.3.2.1.2.2.4.1.2 "><p id="css_01_0406__en-us_topic_0000001485533945_en-us_topic_0000001228531978_p51961214407">Boolean</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="51.27%" headers="mcps1.3.3.2.1.2.2.4.1.3 "><p id="css_01_0406__en-us_topic_0000001485533945_en-us_topic_0000001228531978_p141961124012">Whether to enable HTTP/HTTPS flow control. HTTP/HTTPS flow control is disabled by default. Enabling it may affect node access performance.</p>
|
||
<p id="css_01_0406__en-us_topic_0000001485533945_en-us_topic_0000001228531978_p419620110406">Value: <strong id="css_01_0406__b203268458043112">true</strong> or <strong id="css_01_0406__b142690683543112">false</strong></p>
|
||
<p id="css_01_0406__en-us_topic_0000001485533945_en-us_topic_0000001228531978_p11196201104018">Default value: <strong id="css_01_0406__b165840579543112">false</strong></p>
|
||
</td>
|
||
</tr>
|
||
<tr id="css_01_0406__en-us_topic_0000001485533945_en-us_topic_0000001228531978_row1196201174015"><td class="cellrowborder" valign="top" width="31.290000000000003%" headers="mcps1.3.3.2.1.2.2.4.1.1 "><p id="css_01_0406__en-us_topic_0000001485533945_en-us_topic_0000001228531978_p5196813408">flowcontrol.http.allow</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="17.44%" headers="mcps1.3.3.2.1.2.2.4.1.2 "><p id="css_01_0406__en-us_topic_0000001485533945_en-us_topic_0000001228531978_p219613114408">List<String></p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="51.27%" headers="mcps1.3.3.2.1.2.2.4.1.3 "><p id="css_01_0406__en-us_topic_0000001485533945_en-us_topic_0000001228531978_p1427748174618">IP address whitelist.</p>
|
||
<p id="css_01_0406__en-us_topic_0000001485533945_en-us_topic_0000001228531978_p1219661174016">It can contain multiple IP addresses and subnet masks, or lists of IP addresses. Use commas (,) to separate different items. Example: <span class="parmvalue" id="css_01_0406__parmvalue187181613191211"><b>xx.xx.xx.xx/24,xx.xx.xx.xx/24</b></span>, or <span class="parmvalue" id="css_01_0406__parmvalue122871921151219"><b>xx.xx.xx.xx,xx.xx.xx.xx</b></span>.</p>
|
||
<p id="css_01_0406__en-us_topic_0000001485533945_en-us_topic_0000001228531978_p191969174015">The default value is null.</p>
|
||
</td>
|
||
</tr>
|
||
<tr id="css_01_0406__en-us_topic_0000001485533945_en-us_topic_0000001228531978_row171962111401"><td class="cellrowborder" valign="top" width="31.290000000000003%" headers="mcps1.3.3.2.1.2.2.4.1.1 "><p id="css_01_0406__en-us_topic_0000001485533945_en-us_topic_0000001228531978_p10196719403">flowcontrol.http.deny</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="17.44%" headers="mcps1.3.3.2.1.2.2.4.1.2 "><p id="css_01_0406__en-us_topic_0000001485533945_en-us_topic_0000001228531978_p11196151184013">List<String></p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="51.27%" headers="mcps1.3.3.2.1.2.2.4.1.3 "><p id="css_01_0406__en-us_topic_0000001485533945_en-us_topic_0000001228531978_p16196191144011">IP address blacklist.</p>
|
||
<p id="css_01_0406__en-us_topic_0000001485533945_en-us_topic_0000001228531978_p5196413406">It can contain multiple IP addresses and subnet masks, or lists of IP addresses. Use commas (,) to separate different items.</p>
|
||
<p id="css_01_0406__en-us_topic_0000001485533945_en-us_topic_0000001228531978_p01962117405">The default value is null.</p>
|
||
</td>
|
||
</tr>
|
||
<tr id="css_01_0406__en-us_topic_0000001485533945_en-us_topic_0000001228531978_row1619613194017"><td class="cellrowborder" valign="top" width="31.290000000000003%" headers="mcps1.3.3.2.1.2.2.4.1.1 "><p id="css_01_0406__en-us_topic_0000001485533945_en-us_topic_0000001228531978_p11968194014">flowcontrol.http.concurrent</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="17.44%" headers="mcps1.3.3.2.1.2.2.4.1.2 "><p id="css_01_0406__en-us_topic_0000001485533945_en-us_topic_0000001228531978_p819631194020">Integer</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="51.27%" headers="mcps1.3.3.2.1.2.2.4.1.3 "><p id="css_01_0406__en-us_topic_0000001485533945_en-us_topic_0000001228531978_p71967116401">Maximum concurrent HTTP/HTTPS connections.</p>
|
||
<p id="css_01_0406__en-us_topic_0000001485533945_en-us_topic_0000001228531978_p31968184017">Default value: Number of available cores on a node x 600.</p>
|
||
</td>
|
||
</tr>
|
||
<tr id="css_01_0406__en-us_topic_0000001485533945_en-us_topic_0000001228531978_row719671174016"><td class="cellrowborder" valign="top" width="31.290000000000003%" headers="mcps1.3.3.2.1.2.2.4.1.1 "><p id="css_01_0406__en-us_topic_0000001485533945_en-us_topic_0000001228531978_p171961513405">flowcontrol.http.newconnect</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="17.44%" headers="mcps1.3.3.2.1.2.2.4.1.2 "><p id="css_01_0406__en-us_topic_0000001485533945_en-us_topic_0000001228531978_p161969118405">Integer</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="51.27%" headers="mcps1.3.3.2.1.2.2.4.1.3 "><p id="css_01_0406__en-us_topic_0000001485533945_en-us_topic_0000001228531978_p18196111104010">Maximum new connections that can be created for HTTP/HTTPS requests per second.</p>
|
||
<p id="css_01_0406__en-us_topic_0000001485533945_en-us_topic_0000001228531978_p219616118407">Default value: Number of available cores on a node x 200.</p>
|
||
</td>
|
||
</tr>
|
||
<tr id="css_01_0406__en-us_topic_0000001485533945_en-us_topic_0000001228531978_row1519651144012"><td class="cellrowborder" valign="top" width="31.290000000000003%" headers="mcps1.3.3.2.1.2.2.4.1.1 "><p id="css_01_0406__en-us_topic_0000001485533945_en-us_topic_0000001228531978_p719612111408">flowcontrol.http.warmup_period</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="17.44%" headers="mcps1.3.3.2.1.2.2.4.1.2 "><p id="css_01_0406__en-us_topic_0000001485533945_en-us_topic_0000001228531978_p7196171144019">Integer</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="51.27%" headers="mcps1.3.3.2.1.2.2.4.1.3 "><p id="css_01_0406__en-us_topic_0000001485533945_en-us_topic_0000001228531978_p10196714405">Time required for the HTTP/HTTPS connection setup speed to reach the maximum. If <strong id="css_01_0406__b392253519336">flowcontrol.http.newconnect</strong> is set to <strong id="css_01_0406__b10923103543312">100</strong> and <strong id="css_01_0406__b2923193513319">flowcontrol.http.warmup_period</strong> is set to <strong id="css_01_0406__b6924203553310">5000ms</strong>, it indicates the system can set up 100 connections per second 5 seconds later.</p>
|
||
<p id="css_01_0406__en-us_topic_0000001485533945_en-us_topic_0000001228531978_p201961612402">Value range: 0–10000</p>
|
||
<p id="css_01_0406__en-us_topic_0000001485533945_en-us_topic_0000001228531978_p18196131144020">Unit: ms</p>
|
||
<p id="css_01_0406__en-us_topic_0000001485533945_en-us_topic_0000001228531978_p101963124013">Default value: <strong id="css_01_0406__b80622560143112">0</strong></p>
|
||
</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
<div class="note" id="css_01_0406__note892892541116"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="css_01_0406__p12929152551117">If all parameters are set to <strong id="css_01_0406__b14649174874111">null</strong>, they will be restored to their default values.</p>
|
||
</div></div>
|
||
</li><li id="css_01_0406__en-us_topic_0000001485533945_en-us_topic_0000001228531978_li96343413449">Run the following command to disable HTTP/HTTPS flow control for cluster nodes:<pre class="screen" id="css_01_0406__en-us_topic_0000001485533945_en-us_topic_0000001228531978_screen463412415444">PUT /_cluster/settings
|
||
{
|
||
"persistent": {
|
||
"flowcontrol.http.enabled": false
|
||
}
|
||
}</pre>
|
||
</li></ol>
|
||
</div>
|
||
<div class="section" id="css_01_0406__section12926193210818"><a name="css_01_0406__section12926193210818"></a><a name="section12926193210818"></a><h4 class="sectiontitle">Enabling Memory Flow Control</h4><ol id="css_01_0406__ol12925259131314"><li id="css_01_0406__li0925145919136">Run the following command to enable memory flow control:<pre class="screen" id="css_01_0406__en-us_topic_0000001485373445_screen1857516140228">PUT /_cluster/settings
|
||
{
|
||
"persistent": {
|
||
"flowcontrol.memory.enabled": true,
|
||
"flowcontrol.memory.heap_limit": "80%"
|
||
}
|
||
}</pre>
|
||
|
||
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="css_01_0406__en-us_topic_0000001485373445_table1376624125014" frame="border" border="1" rules="all"><caption><b>Table 3 </b>Configuration items for memory flow control</caption><thead align="left"><tr id="css_01_0406__en-us_topic_0000001485373445_row071224195017"><th align="left" class="cellrowborder" valign="top" width="29.472947294729472%" id="mcps1.3.4.2.1.2.2.4.1.1"><p id="css_01_0406__en-us_topic_0000001485373445_p147182455018">Configuration Item</p>
|
||
</th>
|
||
<th align="left" class="cellrowborder" valign="top" width="16.251625162516252%" id="mcps1.3.4.2.1.2.2.4.1.2"><p id="css_01_0406__en-us_topic_0000001485373445_p187122413507">Type</p>
|
||
</th>
|
||
<th align="left" class="cellrowborder" valign="top" width="54.27542754275427%" id="mcps1.3.4.2.1.2.2.4.1.3"><p id="css_01_0406__en-us_topic_0000001485373445_p471152425019">Description</p>
|
||
</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody><tr id="css_01_0406__en-us_topic_0000001485373445_row1772172425018"><td class="cellrowborder" valign="top" width="29.472947294729472%" headers="mcps1.3.4.2.1.2.2.4.1.1 "><p id="css_01_0406__en-us_topic_0000001485373445_p1172924155011">flowcontrol.memory.enabled</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="16.251625162516252%" headers="mcps1.3.4.2.1.2.2.4.1.2 "><p id="css_01_0406__en-us_topic_0000001485373445_p3721024155016">Boolean</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="54.27542754275427%" headers="mcps1.3.4.2.1.2.2.4.1.3 "><p id="css_01_0406__p0416118201511">Whether to enable memory flow control. After this function is enabled, the memory usage is continuously monitored.</p>
|
||
<div class="p" id="css_01_0406__en-us_topic_0000001485373445_p107210242506">Value:<ul id="css_01_0406__en-us_topic_0000001485373445_ul57202413502"><li id="css_01_0406__en-us_topic_0000001485373445_li177262415018">true</li><li id="css_01_0406__en-us_topic_0000001485373445_li6721124185015">false (default value)</li></ul>
|
||
</div>
|
||
</td>
|
||
</tr>
|
||
<tr id="css_01_0406__en-us_topic_0000001485373445_row1673162455019"><td class="cellrowborder" valign="top" width="29.472947294729472%" headers="mcps1.3.4.2.1.2.2.4.1.1 "><p id="css_01_0406__en-us_topic_0000001485373445_p57262417501">flowcontrol.memory.heap_limit</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="16.251625162516252%" headers="mcps1.3.4.2.1.2.2.4.1.2 "><p id="css_01_0406__en-us_topic_0000001485373445_p77212248507">String</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="54.27542754275427%" headers="mcps1.3.4.2.1.2.2.4.1.3 "><p id="css_01_0406__en-us_topic_0000001485373445_p107262465010">Maximum heap memory usage of a node that is used as a threshold for triggering backpressure for flow control.</p>
|
||
<p id="css_01_0406__en-us_topic_0000001485373445_p872182485012">Value range: 10%–100%</p>
|
||
<p id="css_01_0406__en-us_topic_0000001485373445_p772324105019">Default value: <strong id="css_01_0406__b171435181143112">90%</strong></p>
|
||
<div class="note" id="css_01_0406__note23401351615"><span class="notetitle"> NOTE: </span><div class="notebody"><ul id="css_01_0406__ul598214191189"><li id="css_01_0406__li1998301961815">The default value 90% of <span class="parmname" id="css_01_0406__parmname13379192518366"><b>flowcontrol.memory.heap_limit</b></span> is a conservative threshold. When the heap memory usage is greater than 90%, the system stops reading large requests that exceed 64 KB from the client until heap memory usage decreases. If the heap memory usage decreases to 85%, the maximum client data that can be read is 5% x maximum heap memory capacity. If the heap memory usage stays above 90% for a long time, client requests cannot be processed. In this case, a GC algorithm is triggered to perform garbage collection until the heap memory usage drops below the threshold.</li><li id="css_01_0406__li10869122415184">Generally, you can set the <span class="parmname" id="css_01_0406__en-us_topic_0000001485373445_parmname153931214125818"><b>flowcontrol.memory.heap_limit</b></span> threshold to 80% or less to ensure that the node has reserved some heap memory for operations besides data writing, such as Elasticsearch query and segment merge.</li></ul>
|
||
</div></div>
|
||
</td>
|
||
</tr>
|
||
<tr id="css_01_0406__en-us_topic_0000001485373445_row107342416503"><td class="cellrowborder" valign="top" width="29.472947294729472%" headers="mcps1.3.4.2.1.2.2.4.1.1 "><p id="css_01_0406__en-us_topic_0000001485373445_p12739246508">flowcontrol.holding.in_flight_factor</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="16.251625162516252%" headers="mcps1.3.4.2.1.2.2.4.1.2 "><p id="css_01_0406__en-us_topic_0000001485373445_p6731224185015">Float</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="54.27542754275427%" headers="mcps1.3.4.2.1.2.2.4.1.3 "><p id="css_01_0406__en-us_topic_0000001485373445_p27362416506">Backpressure release factor, which works similarly to the circuit breaker parameter <strong id="css_01_0406__b0993184913710">network.breaker.inflight_requests.overhead</strong>. With the memory usage exceeding the limit, a larger value of this parameter indicates stronger backpressure, in which case, write traffic will be limited.</p>
|
||
<p id="css_01_0406__en-us_topic_0000001485373445_p11731324155015">Value range: ≥ 0.5</p>
|
||
<p id="css_01_0406__en-us_topic_0000001485373445_p1473122417506">Default value: <strong id="css_01_0406__b150592346643112">1.0</strong></p>
|
||
</td>
|
||
</tr>
|
||
<tr id="css_01_0406__en-us_topic_0000001485373445_row12736245506"><td class="cellrowborder" valign="top" width="29.472947294729472%" headers="mcps1.3.4.2.1.2.2.4.1.1 "><p id="css_01_0406__en-us_topic_0000001485373445_p2073924135018">flowcontrol.holding.max</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="16.251625162516252%" headers="mcps1.3.4.2.1.2.2.4.1.2 "><p id="css_01_0406__en-us_topic_0000001485373445_p1173724135015">TimeValue</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="54.27542754275427%" headers="mcps1.3.4.2.1.2.2.4.1.3 "><p id="css_01_0406__en-us_topic_0000001485373445_p473192435019">Maximum delay of each request. If the delay exceeds the value of this parameter, backpressure may be stopped or the request connection may be disconnected. For details, see the setting of <span class="parmname" id="css_01_0406__en-us_topic_0000001485373445_parmname612453745515"><b>flowcontrol.holding.max_strategy</b></span>.</p>
|
||
<p id="css_01_0406__en-us_topic_0000001485373445_p1673112425012">Value range: ≥ 15s</p>
|
||
<p id="css_01_0406__en-us_topic_0000001485373445_p37319243503">Default value: <strong id="css_01_0406__b48679758443112">60s</strong></p>
|
||
</td>
|
||
</tr>
|
||
<tr id="css_01_0406__en-us_topic_0000001485373445_row1174122416504"><td class="cellrowborder" valign="top" width="29.472947294729472%" headers="mcps1.3.4.2.1.2.2.4.1.1 "><p id="css_01_0406__en-us_topic_0000001485373445_p147372405013">flowcontrol.holding.max_strategy</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="16.251625162516252%" headers="mcps1.3.4.2.1.2.2.4.1.2 "><p id="css_01_0406__en-us_topic_0000001485373445_p147472485010">String</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="54.27542754275427%" headers="mcps1.3.4.2.1.2.2.4.1.3 "><p id="css_01_0406__p1375603214193">The policy applied after the maximum delay time is exceeded.</p>
|
||
<div class="p" id="css_01_0406__en-us_topic_0000001485373445_p27462414509">The value can be:<ul id="css_01_0406__en-us_topic_0000001485373445_ul774182495016"><li id="css_01_0406__en-us_topic_0000001485373445_li13741124165015"><strong id="css_01_0406__b80221426143112">keep</strong> (default value): If the heap memory is still high, continue the backpressure. The server determines when to execute the request based on the real-time memory.</li><li id="css_01_0406__en-us_topic_0000001485373445_li1574112435018"><strong id="css_01_0406__b55634724443112">soft</strong>: The requests will be executed even if the heap memory usage is still high. The <strong id="css_01_0406__b26573227043112">inFlight</strong> circuit breaker will determine whether to execute or reject the requests.</li><li id="css_01_0406__en-us_topic_0000001485373445_li674192475015"><strong id="css_01_0406__b140605814943112">hard</strong>: If the heap memory usage is still high, requests will be discarded and the client connections will be disconnected.</li></ul>
|
||
</div>
|
||
</td>
|
||
</tr>
|
||
<tr id="css_01_0406__en-us_topic_0000001485373445_row5751124115018"><td class="cellrowborder" valign="top" width="29.472947294729472%" headers="mcps1.3.4.2.1.2.2.4.1.1 "><p id="css_01_0406__en-us_topic_0000001485373445_p974102495015">flowcontrol.memory.once_free_max</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="16.251625162516252%" headers="mcps1.3.4.2.1.2.2.4.1.2 "><p id="css_01_0406__en-us_topic_0000001485373445_p675112495013">String</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="54.27542754275427%" headers="mcps1.3.4.2.1.2.2.4.1.3 "><p id="css_01_0406__en-us_topic_0000001485373445_p97520248502">Maximum memory that can be made available at a time for a suspended request queue. This parameter helps prevent a cluster from becoming completely unavailable due to low memory availability under high pressure.</p>
|
||
<p id="css_01_0406__en-us_topic_0000001485373445_p1775122414500">Value range: 1%–50%</p>
|
||
<p id="css_01_0406__en-us_topic_0000001485373445_p4751024145010">Default value: <strong id="css_01_0406__b178623350843112">10%</strong></p>
|
||
</td>
|
||
</tr>
|
||
<tr id="css_01_0406__en-us_topic_0000001485373445_row17692475019"><td class="cellrowborder" valign="top" width="29.472947294729472%" headers="mcps1.3.4.2.1.2.2.4.1.1 "><p id="css_01_0406__en-us_topic_0000001485373445_p27592417509">flowcontrol.memory.nudges_gc</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="16.251625162516252%" headers="mcps1.3.4.2.1.2.2.4.1.2 "><p id="css_01_0406__en-us_topic_0000001485373445_p137512244504">Boolean</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="54.27542754275427%" headers="mcps1.3.4.2.1.2.2.4.1.3 "><p id="css_01_0406__en-us_topic_0000001485373445_p1575924145015">Whether to trigger garbage collection to ensure write stability when the write pressure is too high. (The backpressure connection pool is checked every second. The write pressure is considered high if all the existing connections are blocked and new write requests cannot be accepted.) The value can be:</p>
|
||
<ul id="css_01_0406__en-us_topic_0000001485373445_ul147516243503"><li id="css_01_0406__en-us_topic_0000001485373445_li1375112419506">true (default value)</li><li id="css_01_0406__en-us_topic_0000001485373445_li137512416505">false</li></ul>
|
||
</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
<div class="note" id="css_01_0406__note26211411182018"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="css_01_0406__css_01_0406_p12929152551117">If all parameters are set to <strong id="css_01_0406__css_01_0406_b14649174874111">null</strong>, they will be restored to their default values.</p>
|
||
</div></div>
|
||
</li><li id="css_01_0406__li39259597131">Run the following command to disable memory flow control:<pre class="screen" id="css_01_0406__en-us_topic_0000001485373445_screen38095315235">PUT /_cluster/settings
|
||
{
|
||
"persistent": {
|
||
"flowcontrol.memory.enabled": false
|
||
}
|
||
}</pre>
|
||
</li></ol>
|
||
</div>
|
||
<div class="section" id="css_01_0406__section846243514132"><a name="css_01_0406__section846243514132"></a><a name="section846243514132"></a><h4 class="sectiontitle">Enabling Request Sampling</h4><ol id="css_01_0406__ol4475813132113"><li id="css_01_0406__li547591314210">Run the following command to enable request sampling:<pre class="screen" id="css_01_0406__en-us_topic_0000001229251898_screen11422663329">PUT _cluster/settings
|
||
{
|
||
"transient": {
|
||
"flowcontrol.log.access.enabled": true
|
||
}
|
||
}</pre>
|
||
|
||
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="css_01_0406__en-us_topic_0000001435176996_table119653339296" frame="border" border="1" rules="all"><caption><b>Table 4 </b>Configuration items for request sampling</caption><thead align="left"><tr id="css_01_0406__en-us_topic_0000001435176996_row4965733122914"><th align="left" class="cellrowborder" valign="top" width="33.5033503350335%" id="mcps1.3.5.2.1.2.2.4.1.1"><p id="css_01_0406__en-us_topic_0000001435176996_p2966183317293">Configuration Item</p>
|
||
</th>
|
||
<th align="left" class="cellrowborder" valign="top" width="16.58165816581658%" id="mcps1.3.5.2.1.2.2.4.1.2"><p id="css_01_0406__en-us_topic_0000001435176996_p179661933182914">Type</p>
|
||
</th>
|
||
<th align="left" class="cellrowborder" valign="top" width="49.91499149914991%" id="mcps1.3.5.2.1.2.2.4.1.3"><p id="css_01_0406__en-us_topic_0000001435176996_p8966123313297">Description</p>
|
||
</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody><tr id="css_01_0406__en-us_topic_0000001435176996_row59660338299"><td class="cellrowborder" valign="top" width="33.5033503350335%" headers="mcps1.3.5.2.1.2.2.4.1.1 "><p id="css_01_0406__en-us_topic_0000001435176996_p653813441717">flowcontrol.log.access.enabled</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="16.58165816581658%" headers="mcps1.3.5.2.1.2.2.4.1.2 "><p id="css_01_0406__en-us_topic_0000001435176996_p19538248171">Boolean</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="49.91499149914991%" headers="mcps1.3.5.2.1.2.2.4.1.3 "><p id="css_01_0406__p16687209192411">Whether to collect statistics on client IP addresses that accessed the Elasticsearch cluster recently and the number of requests from them, including the quantities of bulk write, search, and msearch requests.</p>
|
||
<div class="p" id="css_01_0406__en-us_topic_0000001435176996_p7538134181717">The value can be:<ul id="css_01_0406__en-us_topic_0000001435176996_ul1710319303196"><li id="css_01_0406__en-us_topic_0000001435176996_li5103133010198">true</li><li id="css_01_0406__en-us_topic_0000001435176996_li1748743371912">false (default value)</li></ul>
|
||
</div>
|
||
</td>
|
||
</tr>
|
||
<tr id="css_01_0406__en-us_topic_0000001435176996_row7966933172918"><td class="cellrowborder" valign="top" width="33.5033503350335%" headers="mcps1.3.5.2.1.2.2.4.1.1 "><p id="css_01_0406__en-us_topic_0000001435176996_p153818418177">flowcontrol.log.access.count</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="16.58165816581658%" headers="mcps1.3.5.2.1.2.2.4.1.2 "><p id="css_01_0406__en-us_topic_0000001435176996_p185383413173">Integer</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="49.91499149914991%" headers="mcps1.3.5.2.1.2.2.4.1.3 "><p id="css_01_0406__en-us_topic_0000001435176996_p1653894131717">Number of client IP addresses that accessed a cluster recently. The IP address statistics switches control whether to collect request type statistics and whether to enable logging.</p>
|
||
<p id="css_01_0406__en-us_topic_0000001435176996_p1953824111712">Value range: 0–100</p>
|
||
<p id="css_01_0406__en-us_topic_0000001435176996_p5538144191712">Default value: <strong id="css_01_0406__b100517576643112">10</strong></p>
|
||
</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
<div class="note" id="css_01_0406__note13343145911257"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="css_01_0406__css_01_0406_p12929152551117_1">If all parameters are set to <strong id="css_01_0406__css_01_0406_b14649174874111_1">null</strong>, they will be restored to their default values.</p>
|
||
</div></div>
|
||
</li><li id="css_01_0406__li547581314213">Run the following command to disable request sampling:<pre class="screen" id="css_01_0406__screen347116118229">PUT /_cluster/settings
|
||
{
|
||
"persistent": {
|
||
"flowcontrol.log.access.enabled": false
|
||
}
|
||
}</pre>
|
||
</li></ol>
|
||
</div>
|
||
<div class="section" id="css_01_0406__section364216459204"><a name="css_01_0406__section364216459204"></a><a name="section364216459204"></a><h4 class="sectiontitle">Enable One-Click Traffic Blocking</h4><ol id="css_01_0406__ol10755164012261"><li id="css_01_0406__li6755104018263">Run the following command to enable one-click traffic blocking:<pre class="screen" id="css_01_0406__en-us_topic_0000001435336968_screen32595165917">PUT /_cluster/settings
|
||
{
|
||
"persistent": {
|
||
"flowcontrol.break.enabled": true
|
||
}
|
||
}</pre>
|
||
</li><li id="css_01_0406__li6755040112610">Run the following command to disable one-click traffic blocking:<pre class="screen" id="css_01_0406__en-us_topic_0000001435336968_screen125153596">PUT /_cluster/settings
|
||
{
|
||
"persistent": {
|
||
"flowcontrol.break.enabled": false
|
||
}
|
||
}</pre>
|
||
</li></ol>
|
||
</div>
|
||
<div class="section" id="css_01_0406__section03781045277"><a name="css_01_0406__section03781045277"></a><a name="section03781045277"></a><h4 class="sectiontitle">Viewing Flow Control Information</h4><ul id="css_01_0406__en-us_topic_0000001435180316_ul19124627174116"><li id="css_01_0406__en-us_topic_0000001435180316_li1124132724114">Check the flow control status of all nodes.<pre class="screen" id="css_01_0406__en-us_topic_0000001435180316_screen39443424212">GET /_nodes/stats/filter/v2</pre>
|
||
</li><li id="css_01_0406__en-us_topic_0000001435180316_li1931146103111">View the flow control details of all nodes.<pre class="screen" id="css_01_0406__en-us_topic_0000001435180316_screen123174618312">GET /_nodes/stats/filter/v2?detail</pre>
|
||
</li><li id="css_01_0406__en-us_topic_0000001435180316_li6489194354113">View the flow control status of a specific node.<pre class="screen" id="css_01_0406__en-us_topic_0000001435180316_screen9507113922510">GET /_nodes/<em id="css_01_0406__en-us_topic_0000001435180316_i8507123972519">{nodeId}</em>/stats/filter/v2</pre>
|
||
<p id="css_01_0406__en-us_topic_0000001435180316_p647618221453"><span class="parmvalue" id="css_01_0406__parmvalue93001839183115"><b>{nodeId}</b></span> indicates the ID of the node you want to check.</p>
|
||
</li></ul>
|
||
<div class="p" id="css_01_0406__p20433144220284">Example response:<pre class="screen" id="css_01_0406__screen276044142816">{
|
||
"_nodes" : {
|
||
"total" : 1,
|
||
"successful" : 1,
|
||
"failed" : 0
|
||
},
|
||
"cluster_name" : "css-xxxx",
|
||
"nodes" : {
|
||
"d3qnVIpPTtSoadkV0LQEkA" : {
|
||
"name" : "css-xxxx-ess-esn-1-1",
|
||
"host" : "192.168.x.x",
|
||
"timestamp" : 1672236425112,
|
||
"flow_control" : {
|
||
"http" : {
|
||
"current_connect" : 52,
|
||
"rejected_concurrent" : 0,
|
||
"rejected_rate" : 0,
|
||
"rejected_black" : 0,
|
||
"rejected_breaker" : 0
|
||
},
|
||
"access_items" : [
|
||
{
|
||
"remote_address" : "10.0.0.x",
|
||
"search_count" : 0,
|
||
"bulk_count" : 0,
|
||
"other_count" : 4
|
||
}
|
||
],
|
||
"holding_requests" : 0
|
||
}
|
||
}
|
||
}
|
||
}</pre>
|
||
|
||
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="css_01_0406__table27611841152812" frame="border" border="1" rules="all"><caption><b>Table 5 </b>Response parameters</caption><thead align="left"><tr id="css_01_0406__row676064112286"><th align="left" class="cellrowborder" valign="top" width="28.59%" id="mcps1.3.7.3.2.2.3.1.1"><p id="css_01_0406__p13760114119285">Parameter</p>
|
||
</th>
|
||
<th align="left" class="cellrowborder" valign="top" width="71.41%" id="mcps1.3.7.3.2.2.3.1.2"><p id="css_01_0406__p10760184118281">Description</p>
|
||
</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody><tr id="css_01_0406__row4760741202819"><td class="cellrowborder" valign="top" width="28.59%" headers="mcps1.3.7.3.2.2.3.1.1 "><p id="css_01_0406__p12760164112284">current_connect</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="71.41%" headers="mcps1.3.7.3.2.2.3.1.2 "><p id="css_01_0406__p276044115287">Number of HTTP connections of a node, which is recorded regardless of whether flow control is enabled. This value is equivalent to the <strong id="css_01_0406__b135742489043112">current_open</strong> value of <strong id="css_01_0406__b68672738643112">GET /_nodes/stats/http</strong> API. It shows the current client connections of each node.</p>
|
||
</td>
|
||
</tr>
|
||
<tr id="css_01_0406__row7760041172816"><td class="cellrowborder" valign="top" width="28.59%" headers="mcps1.3.7.3.2.2.3.1.1 "><p id="css_01_0406__p97601141142815">rejected_concurrent</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="71.41%" headers="mcps1.3.7.3.2.2.3.1.2 "><p id="css_01_0406__p137606412285">Number of concurrent connections rejected during HTTP flow control. Disabling HTTP flow control does not clear this record.</p>
|
||
</td>
|
||
</tr>
|
||
<tr id="css_01_0406__row9760541182819"><td class="cellrowborder" valign="top" width="28.59%" headers="mcps1.3.7.3.2.2.3.1.1 "><p id="css_01_0406__p1276004120282">rejected_rate</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="71.41%" headers="mcps1.3.7.3.2.2.3.1.2 "><p id="css_01_0406__p1076094116283">Number of new connections rejected during HTTP flow control. Disabling HTTP flow control does not clear this record.</p>
|
||
</td>
|
||
</tr>
|
||
<tr id="css_01_0406__row197601341112815"><td class="cellrowborder" valign="top" width="28.59%" headers="mcps1.3.7.3.2.2.3.1.1 "><p id="css_01_0406__p47601241112813">rejected_black</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="71.41%" headers="mcps1.3.7.3.2.2.3.1.2 "><p id="css_01_0406__p6760941132811">Number of requests rejected based on the blacklist during HTTP flow control. Disabling HTTP flow control does not clear this record.</p>
|
||
</td>
|
||
</tr>
|
||
<tr id="css_01_0406__row12760114119289"><td class="cellrowborder" valign="top" width="28.59%" headers="mcps1.3.7.3.2.2.3.1.1 "><p id="css_01_0406__p1076074115282">rejected_breaker</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="71.41%" headers="mcps1.3.7.3.2.2.3.1.2 "><p id="css_01_0406__p1376015415289">Number of new connections rejected after one-click traffic blocking is enabled.</p>
|
||
</td>
|
||
</tr>
|
||
<tr id="css_01_0406__row18760144102817"><td class="cellrowborder" valign="top" width="28.59%" headers="mcps1.3.7.3.2.2.3.1.1 "><p id="css_01_0406__p1776064132810">remote_address</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="71.41%" headers="mcps1.3.7.3.2.2.3.1.2 "><p id="css_01_0406__p1576012412288">IP addresses and the number of requests.</p>
|
||
</td>
|
||
</tr>
|
||
<tr id="css_01_0406__row147614419285"><td class="cellrowborder" valign="top" width="28.59%" headers="mcps1.3.7.3.2.2.3.1.1 "><p id="css_01_0406__p1760164118281">search_count</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="71.41%" headers="mcps1.3.7.3.2.2.3.1.2 "><p id="css_01_0406__p176114113283">Number of times a client accessed a database using <strong id="css_01_0406__b162890607343112">_search</strong> and <strong id="css_01_0406__b67045531343112">_msearch</strong>.</p>
|
||
</td>
|
||
</tr>
|
||
<tr id="css_01_0406__row127611541102815"><td class="cellrowborder" valign="top" width="28.59%" headers="mcps1.3.7.3.2.2.3.1.1 "><p id="css_01_0406__p11761941172812">bulk_count</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="71.41%" headers="mcps1.3.7.3.2.2.3.1.2 "><p id="css_01_0406__p8761154112817">Number of times a client accessed a database using <strong id="css_01_0406__b58186458943112">_bulk</strong>.</p>
|
||
</td>
|
||
</tr>
|
||
<tr id="css_01_0406__row67611841122817"><td class="cellrowborder" valign="top" width="28.59%" headers="mcps1.3.7.3.2.2.3.1.1 "><p id="css_01_0406__p1976144115283">other_count</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="71.41%" headers="mcps1.3.7.3.2.2.3.1.2 "><p id="css_01_0406__p376114115288">Number of times a client accessed a database using other request methods.</p>
|
||
</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="section" id="css_01_0406__section1626791610277"><a name="css_01_0406__section1626791610277"></a><a name="section1626791610277"></a><h4 class="sectiontitle">Enabling and Viewing Access Logs</h4><ol id="css_01_0406__en-us_topic_0000001435340292_ol1451314268310"><li id="css_01_0406__en-us_topic_0000001435340292_li13513102653113">Run the following command to enable access logging:<ul id="css_01_0406__en-us_topic_0000001435340292_ul14793171816334"><li id="css_01_0406__en-us_topic_0000001435340292_li37931181334">Enable access logging for all nodes in a cluster.<pre class="screen" id="css_01_0406__en-us_topic_0000001435340292_screen17931818123313">PUT /_access_log?duration_limit=30s&capacity_limit=1mb</pre>
|
||
</li><li id="css_01_0406__en-us_topic_0000001435340292_li0793111893316">Enable access logging for a specified node in a cluster.<pre class="screen" id="css_01_0406__en-us_topic_0000001435340292_screen379391812337">PUT /_access_log/<em id="css_01_0406__en-us_topic_0000001435340292_i1679351813312">{nodeId}</em>?duration_limit=30s&capacity_limit=1mb</pre>
|
||
<p id="css_01_0406__en-us_topic_0000001435340292_p8794141853314"><span class="parmvalue" id="css_01_0406__parmvalue56872239318"><b>{nodeId}</b></span> indicates the node ID.</p>
|
||
</li></ul>
|
||
|
||
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="css_01_0406__en-us_topic_0000001435340292_table14438151713712" frame="border" border="1" rules="all"><caption><b>Table 6 </b>Configuration items for configuring access logging</caption><thead align="left"><tr id="css_01_0406__en-us_topic_0000001435340292_row134385172373"><th align="left" class="cellrowborder" valign="top" width="24.39%" id="mcps1.3.8.2.1.2.2.4.1.1"><p id="css_01_0406__en-us_topic_0000001435340292_p94387177375">Configuration Item</p>
|
||
</th>
|
||
<th align="left" class="cellrowborder" valign="top" width="15.379999999999999%" id="mcps1.3.8.2.1.2.2.4.1.2"><p id="css_01_0406__en-us_topic_0000001435340292_p35341047113710">Type</p>
|
||
</th>
|
||
<th align="left" class="cellrowborder" valign="top" width="60.23%" id="mcps1.3.8.2.1.2.2.4.1.3"><p id="css_01_0406__en-us_topic_0000001435340292_p84381717153717">Description</p>
|
||
</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody><tr id="css_01_0406__en-us_topic_0000001435340292_row10438717163713"><td class="cellrowborder" valign="top" width="24.39%" headers="mcps1.3.8.2.1.2.2.4.1.1 "><p id="css_01_0406__en-us_topic_0000001435340292_p17438317183719">duration_limit</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="15.379999999999999%" headers="mcps1.3.8.2.1.2.2.4.1.2 "><p id="css_01_0406__en-us_topic_0000001435340292_p145341647133719">String</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="60.23%" headers="mcps1.3.8.2.1.2.2.4.1.3 "><p id="css_01_0406__en-us_topic_0000001435340292_p164381817183717">Duration recorded in an access log.</p>
|
||
<p id="css_01_0406__en-us_topic_0000001435340292_p154384172374">Value range: 10 to 120</p>
|
||
<p id="css_01_0406__en-us_topic_0000001435340292_p9438111793716">Unit: s</p>
|
||
<p id="css_01_0406__en-us_topic_0000001435340292_p0438417143712">Default value: <strong id="css_01_0406__b128785585543112">30</strong></p>
|
||
</td>
|
||
</tr>
|
||
<tr id="css_01_0406__en-us_topic_0000001435340292_row34381417173716"><td class="cellrowborder" valign="top" width="24.39%" headers="mcps1.3.8.2.1.2.2.4.1.1 "><p id="css_01_0406__en-us_topic_0000001435340292_p18438201753718">capacity_limit</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="15.379999999999999%" headers="mcps1.3.8.2.1.2.2.4.1.2 "><p id="css_01_0406__en-us_topic_0000001435340292_p853404783711">String</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="60.23%" headers="mcps1.3.8.2.1.2.2.4.1.3 "><p id="css_01_0406__en-us_topic_0000001435340292_p9438111753718">Size of an access log. When the size of an access log reaches this value, access logging stops.</p>
|
||
<p id="css_01_0406__en-us_topic_0000001435340292_p743820171376">Value range: 1 to 5</p>
|
||
<p id="css_01_0406__en-us_topic_0000001435340292_p4438161714372">Unit: MB</p>
|
||
<p id="css_01_0406__en-us_topic_0000001435340292_p1343871763718">Default value: <strong id="css_01_0406__b2781871043112">1</strong></p>
|
||
</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
<div class="note" id="css_01_0406__en-us_topic_0000001435340292_note047294821315"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="css_01_0406__ul5728121683318"><li id="css_01_0406__li1728151683310">Access logging stops when either <strong id="css_01_0406__b45930865343112">duration_limit</strong> or <strong id="css_01_0406__b5668892143112">capacity_limit</strong> reaches their thresholds.</li><li id="css_01_0406__li117281516143319">If all parameters are set to <strong id="css_01_0406__b1910045114114">null</strong>, they will be restored to their default values.</li></ul>
|
||
</div></div>
|
||
</li><li id="css_01_0406__en-us_topic_0000001435340292_li148131484332">Run the following command to check access logs:<ul id="css_01_0406__en-us_topic_0000001435340292_ul1492754423311"><li id="css_01_0406__en-us_topic_0000001435340292_li139271444163318">API for checking the access logs of all nodes in a cluster<pre class="screen" id="css_01_0406__en-us_topic_0000001435340292_screen9927164493314">GET /_access_log</pre>
|
||
</li><li id="css_01_0406__en-us_topic_0000001435340292_li13927144403310">API for checking the access logs of a specified node in a cluster<pre class="screen" id="css_01_0406__en-us_topic_0000001435340292_screen1092704483317">GET /_access_log/<em id="css_01_0406__en-us_topic_0000001435340292_i209271044183311">{nodeId}</em></pre>
|
||
<p id="css_01_0406__en-us_topic_0000001435340292_p2927164443316"><span class="parmvalue" id="css_01_0406__parmvalue0573183063310"><b>{nodeId}</b></span> indicates the node ID.</p>
|
||
</li></ul>
|
||
<div class="p" id="css_01_0406__p5405653133319">Example response:<pre class="screen" id="css_01_0406__en-us_topic_0000001435340292_screen195443596430">{
|
||
"_nodes" : {
|
||
"total" : 1,
|
||
"successful" : 1,
|
||
"failed" : 0
|
||
},
|
||
"cluster_name" : "css-flowcontroller",
|
||
"nodes" : {
|
||
"8x-ZHu-wTemBQwpcGivFKg" : {
|
||
"name" : "css-flowcontroller-ess-esn-1-1",
|
||
"host" : "10.0.0.98",
|
||
"count" : 2,
|
||
"access" : [
|
||
{
|
||
"time" : "2021-02-23 02:09:50",
|
||
"remote_address" : "/10.0.0.98:28191",
|
||
"url" : "/_access/security/log?pretty",
|
||
"method" : "GET",
|
||
"content" : ""
|
||
},
|
||
{
|
||
"time" : "2021-02-23 02:09:52",
|
||
"remote_address" : "/10.0.0.98:28193",
|
||
"url" : "/_access/security/log?pretty",
|
||
"method" : "GET",
|
||
"content" : ""
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}</pre>
|
||
|
||
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="css_01_0406__en-us_topic_0000001435340292_table79421457173012" frame="border" border="1" rules="all"><caption><b>Table 7 </b>Response parameters</caption><thead align="left"><tr id="css_01_0406__en-us_topic_0000001435340292_row12943105753011"><th align="left" class="cellrowborder" valign="top" width="28.59%" id="mcps1.3.8.2.2.2.2.2.3.1.1"><p id="css_01_0406__en-us_topic_0000001435340292_p1494335719307">Parameter</p>
|
||
</th>
|
||
<th align="left" class="cellrowborder" valign="top" width="71.41%" id="mcps1.3.8.2.2.2.2.2.3.1.2"><p id="css_01_0406__en-us_topic_0000001435340292_p199431457183013">Description</p>
|
||
</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody><tr id="css_01_0406__en-us_topic_0000001435340292_row194320579307"><td class="cellrowborder" valign="top" width="28.59%" headers="mcps1.3.8.2.2.2.2.2.3.1.1 "><p id="css_01_0406__en-us_topic_0000001435340292_p894310579302">name</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="71.41%" headers="mcps1.3.8.2.2.2.2.2.3.1.2 "><p id="css_01_0406__en-us_topic_0000001435340292_p59431557113017">Node name</p>
|
||
</td>
|
||
</tr>
|
||
<tr id="css_01_0406__en-us_topic_0000001435340292_row69435575302"><td class="cellrowborder" valign="top" width="28.59%" headers="mcps1.3.8.2.2.2.2.2.3.1.1 "><p id="css_01_0406__en-us_topic_0000001435340292_p09431057113020">host</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="71.41%" headers="mcps1.3.8.2.2.2.2.2.3.1.2 "><p id="css_01_0406__en-us_topic_0000001435340292_p8943657193020">Node IP address</p>
|
||
</td>
|
||
</tr>
|
||
<tr id="css_01_0406__en-us_topic_0000001435340292_row694345717303"><td class="cellrowborder" valign="top" width="28.59%" headers="mcps1.3.8.2.2.2.2.2.3.1.1 "><p id="css_01_0406__en-us_topic_0000001435340292_p13943115753016">count</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="71.41%" headers="mcps1.3.8.2.2.2.2.2.3.1.2 "><p id="css_01_0406__en-us_topic_0000001435340292_p494375723012">Number of node access requests in a statistical period</p>
|
||
</td>
|
||
</tr>
|
||
<tr id="css_01_0406__en-us_topic_0000001435340292_row1994312574305"><td class="cellrowborder" valign="top" width="28.59%" headers="mcps1.3.8.2.2.2.2.2.3.1.1 "><p id="css_01_0406__en-us_topic_0000001435340292_p189431657143012">access</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="71.41%" headers="mcps1.3.8.2.2.2.2.2.3.1.2 "><p id="css_01_0406__en-us_topic_0000001435340292_p13943125716308">Details about node access requests in a statistical period For details, see <a href="#css_01_0406__table72934522332">Table 8</a>.</p>
|
||
</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
|
||
<div class="tablenoborder"><a name="css_01_0406__table72934522332"></a><a name="table72934522332"></a><table cellpadding="4" cellspacing="0" summary="" id="css_01_0406__table72934522332" frame="border" border="1" rules="all"><caption><b>Table 8 </b>access</caption><thead align="left"><tr id="css_01_0406__row162921152173315"><th align="left" class="cellrowborder" valign="top" width="28.59%" id="mcps1.3.8.2.2.2.3.2.3.1.1"><p id="css_01_0406__p829265213333">Parameter</p>
|
||
</th>
|
||
<th align="left" class="cellrowborder" valign="top" width="71.41%" id="mcps1.3.8.2.2.2.3.2.3.1.2"><p id="css_01_0406__p22922528332">Description</p>
|
||
</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody><tr id="css_01_0406__row16292205212331"><td class="cellrowborder" valign="top" width="28.59%" headers="mcps1.3.8.2.2.2.3.2.3.1.1 "><p id="css_01_0406__p1829215211330">time</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="71.41%" headers="mcps1.3.8.2.2.2.3.2.3.1.2 "><p id="css_01_0406__p92928523335">Request time</p>
|
||
</td>
|
||
</tr>
|
||
<tr id="css_01_0406__row10292175210331"><td class="cellrowborder" valign="top" width="28.59%" headers="mcps1.3.8.2.2.2.3.2.3.1.1 "><p id="css_01_0406__p112921052133317">remote_address</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="71.41%" headers="mcps1.3.8.2.2.2.3.2.3.1.2 "><p id="css_01_0406__p529245220330">Source IP address and port number in the request</p>
|
||
</td>
|
||
</tr>
|
||
<tr id="css_01_0406__row132931152103316"><td class="cellrowborder" valign="top" width="28.59%" headers="mcps1.3.8.2.2.2.3.2.3.1.1 "><p id="css_01_0406__p16293135273312">url</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="71.41%" headers="mcps1.3.8.2.2.2.3.2.3.1.2 "><p id="css_01_0406__p12933522339">Original URL of the request</p>
|
||
</td>
|
||
</tr>
|
||
<tr id="css_01_0406__row929375243318"><td class="cellrowborder" valign="top" width="28.59%" headers="mcps1.3.8.2.2.2.3.2.3.1.1 "><p id="css_01_0406__p4293185203318">method</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="71.41%" headers="mcps1.3.8.2.2.2.3.2.3.1.2 "><p id="css_01_0406__p5293205203311">Method corresponding to the request path</p>
|
||
</td>
|
||
</tr>
|
||
<tr id="css_01_0406__row62933528337"><td class="cellrowborder" valign="top" width="28.59%" headers="mcps1.3.8.2.2.2.3.2.3.1.1 "><p id="css_01_0406__p4293195213310">content</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="71.41%" headers="mcps1.3.8.2.2.2.3.2.3.1.2 "><p id="css_01_0406__p1829355218338">Request content</p>
|
||
</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
</div>
|
||
</li><li id="css_01_0406__en-us_topic_0000001435340292_li11157142918335">Run the following commands to delete access logs.<ul id="css_01_0406__en-us_topic_0000001435340292_ul202347235377"><li id="css_01_0406__en-us_topic_0000001435340292_li1323442393712">Delete access logs of all nodes in a cluster.<pre class="screen" id="css_01_0406__en-us_topic_0000001435340292_screen223415231372">DELETE /_access_log</pre>
|
||
</li><li id="css_01_0406__en-us_topic_0000001435340292_li823492393716">Delete access logs of a specified node in a cluster.<pre class="screen" id="css_01_0406__en-us_topic_0000001435340292_screen92347236376">DELETE /_access_log/<em id="css_01_0406__en-us_topic_0000001435340292_i3234623123711">{nodeId}</em></pre>
|
||
<p id="css_01_0406__en-us_topic_0000001435340292_p5234162343718"><span class="parmvalue" id="css_01_0406__parmvalue17923192073412"><b>{nodeId}</b></span> indicates the node ID.</p>
|
||
</li></ul>
|
||
</li></ol>
|
||
</div>
|
||
<div class="section" id="css_01_0406__section072285622916"><a name="css_01_0406__section072285622916"></a><a name="section072285622916"></a><h4 class="sectiontitle">Enabling Access Logging in Files</h4><div class="note" id="css_01_0406__note1331351231910"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="css_01_0406__ul5927755174419"><li id="css_01_0406__li1092735511443">When access logging in files is enabled, any cluster access is recorded in the <strong id="css_01_0406__b24921055194313">{<em id="css_01_0406__i8491755104319">Cluster name</em>_access_log.log}</strong> file. You can use the log backup function to view detailed access logs on OBS.</li><li id="css_01_0406__li5991165715446">You are advised to use this function for troubleshooting only. After problems are solved, disable this function.</li></ul>
|
||
</div></div>
|
||
<ol id="css_01_0406__ol871152419322"><li id="css_01_0406__li5712245322">Run the following command to enable access logging in files:<pre class="screen" id="css_01_0406__screen282114492348">PUT /_cluster/settings
|
||
{
|
||
"persistent": {
|
||
"flowcontrol.log.file.enabled": true
|
||
}
|
||
}</pre>
|
||
|
||
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="css_01_0406__table082114917343" frame="border" border="1" rules="all"><caption><b>Table 9 </b>Configuration items for enabling access logging in files</caption><thead align="left"><tr id="css_01_0406__row83302171662"><th align="left" class="cellrowborder" valign="top" width="33.5033503350335%" id="mcps1.3.9.3.1.2.2.4.1.1"><p id="css_01_0406__p1331141710611">Parameter</p>
|
||
</th>
|
||
<th align="left" class="cellrowborder" valign="top" width="16.58165816581658%" id="mcps1.3.9.3.1.2.2.4.1.2"><p id="css_01_0406__p133310171567">Type</p>
|
||
</th>
|
||
<th align="left" class="cellrowborder" valign="top" width="49.91499149914991%" id="mcps1.3.9.3.1.2.2.4.1.3"><p id="css_01_0406__p1533112175616">Description</p>
|
||
</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody><tr id="css_01_0406__en-us_topic_0000001435176996_row19966533112920"><td class="cellrowborder" valign="top" width="33.5033503350335%" headers="mcps1.3.9.3.1.2.2.4.1.1 "><p id="css_01_0406__en-us_topic_0000001435176996_p1553811461715">flowcontrol.log.file.enabled</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="16.58165816581658%" headers="mcps1.3.9.3.1.2.2.4.1.2 "><p id="css_01_0406__en-us_topic_0000001435176996_p55389481717">Boolean</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="49.91499149914991%" headers="mcps1.3.9.3.1.2.2.4.1.3 "><p id="css_01_0406__p1570615197353">Whether to record the details of each request in the log file.</p>
|
||
<div class="p" id="css_01_0406__en-us_topic_0000001435176996_p75381745179">Value:<ul id="css_01_0406__en-us_topic_0000001435176996_ul1015915575192"><li id="css_01_0406__en-us_topic_0000001435176996_li616025719198">true</li><li id="css_01_0406__en-us_topic_0000001435176996_li91601057111913">false (default value)</li></ul>
|
||
</div>
|
||
</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
</li><li id="css_01_0406__li7679839163220">Run the following command to disable access logging in files:<pre class="screen" id="css_01_0406__screen5341356143211">PUT /_cluster/settings
|
||
{
|
||
"persistent": {
|
||
"flowcontrol.log.file.enabled": false
|
||
}
|
||
}</pre>
|
||
</li></ol>
|
||
</div>
|
||
</div>
|
||
<div>
|
||
<div class="familylinks">
|
||
<div class="parentlink"><strong>Parent topic:</strong> <a href="css_01_0111.html">Enhancing Search Capabilities for Elasticsearch Clusters</a></div>
|
||
</div>
|
||
</div>
|
||
|