{"id":419113,"date":"2021-03-23T13:39:24","date_gmt":"2021-03-23T05:39:24","guid":{"rendered":"http:\/\/4563.org\/?p=419113"},"modified":"2021-03-23T13:39:24","modified_gmt":"2021-03-23T05:39:24","slug":"%e8%af%b7%e9%97%ae-elasticsearch-index-lifecycle-management-%e6%98%af%e6%94%b6%e8%b4%b9%e7%89%88%e6%9c%ac%e6%89%8d%e8%83%bd%e7%94%a8%e5%90%97","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=419113","title":{"rendered":"\u8bf7\u95ee Elasticsearch Index lifecycle management \u662f\u6536\u8d39\u7248\u672c\u624d\u80fd\u7528\u5417"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u8bf7\u95ee Elasticsearch Index lifecycle management \u662f\u6536\u8d39\u7248\u672c\u624d\u80fd\u7528\u5417               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : holinhot <\/span>  <span><i><\/i> 1<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u76ee\u524d\u6211\u914d\u7f6e\u4e86 Index Lifecycle Management \u4f46\u4f3c\u4e4e\u4e0d\u8d77\u4f5c\u7528\uff0c\u6211\u9650\u5236\u4e86\u6bcf\u4e2a Index \u6700\u5927 10mb \u6765\u6d4b\u8bd5\uff0c\u5e76\u6ca1\u6709\u4efb\u4f55\u6548\u679c\uff0cindex \u90fd 80MB \u4e86\u4e5f\u6ca1\u89c1\u81ea\u52a8\u65b0\u5efa\u4e00\u4e2a index.<\/p>\n<p>https:\/\/prnt.sc\/10y9b04<\/p>\n<p>ILM \u5df2\u7ecf\u94fe\u63a5\u5230\u6a21\u677f\u7684\uff0c\u6211\u770b\u5b98\u65b9\u5199\u7684\u514d\u8d39\u7248\u672c 1 \u6ca1\u6709 ILM, \u514d\u8d39\u7248\u672c 2 \u6709 ILM, \u6211\u5728 Kibana \u67e5\u770b\u6211\u7684\u7248\u672c\u662f Basic license.<\/p>\n<p><code>{ \"policy\": { \"phases\": { \"hot\": { \"min_age\": \"0ms\", \"actions\": { \"rollover\": { \"max_age\": \"30d\", \"max_size\": \"10mb\" } } } } } }<\/code><\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>3<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"5593548\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : SevenJ <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             ILM OSS\/\u5f00\u6e90\u7248\u672c\u4e5f\u80fd\u7528<br \/>ES \u6709\u63d0\u4f9b rest api \u67e5\u770b ILM \u7684 policy\uff0c\u4e0d\u4e00\u5b9a\u975e\u8981\u901a\u8fc7 kibana                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5593549\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : shiyijiufei <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u662f\u514d\u8d39\u7684\uff0c\u4f46\u662f\u7d22\u5f15\u751f\u547d\u5468\u671f\u9700\u8981\u914d\u5408 logstash \u6216\u8005 filebeat \u6765\u4f7f\u7528\uff0c<br \/>\u7ed9\u4f60\u53d1\u4e2a\u53c2\u8003<br \/>logstash \u4e0a\u914d\u7f6e\u5199\u4e0a\uff0c\u6211\u8fd9\u91cc\u7684\u7b56\u7565\u540d\u662f all-hot<br \/> ilm_rollover_alias =&gt; &#8220;filebeat-netflow&#8221; #\u6eda\u52a8\u522b\u540d\uff0c\u8ddf\u6a21\u677f\u91cc\u7684\u4e00\u81f4<br \/> ilm_pattern =&gt; &#8220;{now\/d}-000001&#8221; #\u547d\u540d\u89c4\u5219<br \/> ilm_policy =&gt; &#8220;all-hot&#8221; #\u751f\u547d\u5468\u671f\u7b56\u7565\u540d\u79f0\uff0c\u8ddf\u4f60 kibana \u4e0a\u5efa\u7684\u4e00\u81f4<\/p>\n<p>\u7d22\u5f15\u6a21\u677f<br \/>{<br \/> &#8220;index&#8221;: {<br \/> &#8220;lifecycle&#8221;: {<br \/> &#8220;name&#8221;: &#8220;all-hot&#8221;,<br \/> &#8220;rollover_alias&#8221;: &#8220;filebeat-netflow&#8221;<br \/> },<br \/> &#8220;number_of_shards&#8221;: &#8220;1&#8221;,<br \/> &#8220;refresh_interval&#8221;: &#8220;5s&#8221;<br \/> }<br \/>}<\/p>\n<p>\u6211\u4e0d\u7528 filebeat\uff0c\u4e0d\u8fc7\u7c7b\u4f3c                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5593550\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : holinhot <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @shiyijiufei \u6628\u5929\u914d\u7f6e\u4e0a\u662f\u4e0d\u884c\u7684\uff0c\u4eca\u5929\u6211\u767b\u9646 Kibana \u67e5\u770b\u4e86\u4e00\u4e0b\u662f\u81ea\u52a8\u62c6\u5206 Index \u4e86\uff0c\u4f46\u5927\u5c0f\u4e0d\u51c6\uff0c\u524d\u51e0\u4e2a\u90fd\u8d85\u51fa 100MB \u540e\u9762\u7684\u90fd\u5728 80MB \u5de6\u53f3\uff0c\u6211\u914d\u7f6e\u7684\u662f 10MB \u81ea\u52a8\u62c6\u5206\u3002<br \/>https:\/\/prnt.sc\/10yqxpq                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u8bf7\u95ee Elasticsearch &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/419113"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=419113"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/419113\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=419113"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=419113"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=419113"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}