{"id":60691,"date":"2026-01-16T07:41:26","date_gmt":"2026-01-15T23:41:26","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/60691.html"},"modified":"2026-01-16T07:41:26","modified_gmt":"2026-01-15T23:41:26","slug":"%e5%bf%ab%e9%80%9f%e7%90%86%e8%a7%a3es%e5%ae%89%e8%a3%85%e6%89%80%e9%9c%80%e6%9c%8d%e5%8a%a1%e5%99%a8%e5%86%85%e6%a0%b8%e5%8f%82%e6%95%b0%e4%bc%98%e5%8c%96%e6%96%b9%e5%bc%8f","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/60691.html","title":{"rendered":"\u5feb\u901f\u7406\u89e3es\u5b89\u88c5\u6240\u9700\u670d\u52a1\u5668\u5185\u6838\u53c2\u6570\u4f18\u5316\u65b9\u5f0f"},"content":{"rendered":"<h2>\n \u4e3a\u4ec0\u4e48\u4f60\u7684 Elasticsearch \u603b\u662f\u542f\u52a8\u5931\u8d25&#xff1f;90% \u7684\u4eba\u5ffd\u7565\u4e86\u8fd9\u4e00\u6b65<br \/>\n<\/h2>\n<p>\n \u4f60\u6709\u6ca1\u6709\u9047\u5230\u8fc7\u8fd9\u6837\u7684\u573a\u666f&#xff1a;\u5174\u51b2\u51b2\u5730\u5728\u670d\u52a1\u5668\u4e0a\u89e3\u538b\u5b8c Elasticsearch \u5b89\u88c5\u5305&#xff0c;\u4fe1\u5fc3\u6ee1\u6ee1\u5730\u6267\u884c<\/p>\n<p>  .\/bin\/elasticsearch<\/p>\n<p> &#xff0c;\u7ed3\u679c\u65e5\u5fd7\u91cc\u5f39\u51fa\u4e00\u884c\u7ea2\u5b57&#xff1a;\n<\/p>\n<p>max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]<\/p>\n<p>\n \u6216\u8005\u66f4\u60e8\u4e00\u70b9&#xff0c;\u8282\u70b9\u521a\u8dd1\u4e24\u5929&#xff0c;\u7a81\u7136\u67e5\u8be2\u53d8\u6162\u3001GC \u9891\u7e41&#xff0c;\u751a\u81f3\u76f4\u63a5 OOM \u5d29\u6e83&#xff1f;\n<\/p>\n<p>\n \u522b\u6025\u7740\u602a ES \u4e0d\u7a33\u5b9a\u3002<\/p>\n<p>  \u771f\u6b63\u7684\u95ee\u9898&#xff0c;\u5f80\u5f80\u4e0d\u5728\u5e94\u7528\u5c42&#xff0c;\u800c\u5728\u64cd\u4f5c\u7cfb\u7edf\u5e95\u5c42\u2014\u2014\u4f60\u8fd8\u6ca1\u7ed9\u5b83\u201c\u94fa\u597d\u8def\u201d\u3002<\/p>\n<p>\n Elasticsearch \u770b\u4f3c\u53ea\u662f\u4e00\u4e2a Java \u5e94\u7528&#xff0c;\u4f46\u5b83\u80cc\u540e\u662f Lucene \u5f3a\u5927\u7684\u7d22\u5f15\u5f15\u64ce&#xff0c;\u800c Lucene \u5927\u91cf\u4f9d\u8d56 mmap&#xff08;\u5185\u5b58\u6620\u5c04&#xff09;\u6765\u9ad8\u6548\u8bbf\u95ee\u78c1\u76d8\u6587\u4ef6\u3002\u8fd9\u610f\u5473\u7740&#xff0c;ES \u5bf9\u7cfb\u7edf\u7684\u865a\u62df\u5185\u5b58\u7ba1\u7406\u3001\u6587\u4ef6\u53e5\u67c4\u6570\u91cf\u3001\u7ebf\u7a0b\u8c03\u5ea6\u80fd\u529b\u6709\u7740\u8fdc\u8d85\u666e\u901a\u670d\u52a1\u7684\u82db\u523b\u8981\u6c42\u3002\n<\/p>\n<p>\n \u5982\u679c\u4f60\u8df3\u8fc7\u4e86\u5b89\u88c5\u524d\u7684\u5185\u6838\u53c2\u6570\u8c03\u4f18&#xff0c;\u90a3\u5c31\u50cf\u5f00\u7740\u8d8a\u91ce\u8f66\u51b2\u8fdb\u6ce5\u6f6d\u2014\u2014\u4e0d\u662f\u8f66\u4e0d\u884c&#xff0c;\u662f\u4f60\u6ca1\u9009\u5bf9\u8def\u3002\n<\/p>\n<hr \/>\n<h3>\n vm.max_map_count&#xff1a;\u90a3\u4e2a\u88ab\u6240\u6709\u4eba\u5ffd\u7565\u7684\u201c\u5c0f\u201d\u53c2\u6570<br \/>\n<\/h3>\n<p>\n \u6211\u4eec\u5148\u4ece\u6700\u7ecf\u5178\u7684\u9519\u8bef\u8bf4\u8d77&#xff1a;<\/p>\n<p>  max_map_count too low<\/p>\n<p> \u3002\n<\/p>\n<h4>\n \u8fd9\u4e2a\u53c2\u6570\u5230\u5e95\u7ba1\u4ec0\u4e48&#xff1f;<br \/>\n<\/h4>\n<p>\n \u7b80\u5355\u8bf4&#xff0c;<\/p>\n<p>  vm.max_map_count<\/p>\n<p> \u63a7\u5236\u7684\u662f<\/p>\n<p>  \u4e00\u4e2a\u8fdb\u7a0b\u6700\u591a\u80fd\u6709\u591a\u5c11\u4e2a\u5185\u5b58\u6620\u5c04\u533a\u57df&#xff08;VMA&#xff09;<\/p>\n<p> \u3002\n<\/p>\n<p>\n Linux \u628a\u6bcf\u4e2a\u901a\u8fc7<\/p>\n<p>  mmap()<\/p>\n<p> \u6620\u5c04\u8fdb\u6765\u7684\u6587\u4ef6\u7247\u6bb5\u90fd\u5f53\u4f5c\u4e00\u4e2a\u72ec\u7acb\u7684 VMA\u3002\u6bd4\u5982\u4f60\u6709\u4e00\u4e2a\u5206\u7247&#xff0c;\u91cc\u9762\u6709\u51e0\u767e\u4e2a\u6bb5\u6587\u4ef6&#xff08;segment&#xff09;&#xff0c;Lucene \u4f1a\u628a\u8fd9\u4e9b<\/p>\n<p>  .tim<\/p>\n<p> \u3001<\/p>\n<p>  .doc<\/p>\n<p> \u3001<\/p>\n<p>  .fdt<\/p>\n<p> \u6587\u4ef6\u4e00\u4e2a\u4e2a\u7528 mmap \u6620\u5c04\u5230\u5185\u5b58\u4e2d&#xff0c;\u4ee5\u4fbf\u5b9e\u73b0\u96f6\u62f7\u8d1d\u8bfb\u53d6\u3002\n<\/p>\n<p>\n \u6bcf\u4e00\u4e2a\u6620\u5c04 &#061; \u4e00\u4e2a VMA\u3002<\/p>\n<p> \u5206\u7247\u8d8a\u591a\u3001\u6bb5\u8d8a\u788e\u3001\u7d22\u5f15\u8d8a\u8001 \u2192 VMA \u6570\u91cf\u7206\u70b8\u5f0f\u589e\u957f\u3002\n<\/p>\n<p>\n \u9ed8\u8ba4\u503c\u662f\u591a\u5c11&#xff1f;65530\u3002\u542c\u8d77\u6765\u4e0d\u5c11\u5427&#xff1f;\u4f46\u5728\u751f\u4ea7\u73af\u5883&#xff0c;\u5c24\u5176\u662f\u591a\u5206\u7247\u96c6\u7fa4\u4e2d&#xff0c;\u8fd9\u4e2a\u6570\u53ef\u80fd\u51e0\u79d2\u5c31\u88ab\u6253\u7a7f\u3002\n<\/p>\n<h4>\n \u5b9e\u6218\u914d\u7f6e&#xff1a;\u522b\u518d\u4e34\u65f6\u6539\u4e86<br \/>\n<\/h4>\n<p>\n \u5f88\u591a\u4eba\u56fe\u7701\u4e8b&#xff0c;\u76f4\u63a5\u4e00\u53e5&#xff1a;\n<\/p>\n<p>sysctl -w vm.max_map_count&#061;262144<\/p>\n<p>\n \u786e\u5b9e\u80fd\u89e3\u51b3\u95ee\u9898&#xff0c;\u4f46\u91cd\u542f\u5c31\u5931\u6548\u4e86\u3002\u7ebf\u4e0a\u7cfb\u7edf\u8c01\u6562\u8fd9\u4e48\u73a9&#xff1f;\n<\/p>\n<p>\n \u6b63\u786e\u7684\u505a\u6cd5\u662f\u5199\u5165\u6301\u4e45\u5316\u914d\u7f6e&#xff1a;\n<\/p>\n<p>echo &#034;vm.max_map_count &#061; 262144&#034; &gt;&gt; \/etc\/sysctl.conf<br \/>\nsysctl -p<\/p>\n<p>\n  \u2705 \u63a8\u8350\u503c&#xff1a;<\/p>\n<p>   262144<\/p>\n<p>  \u662f ES \u5b98\u65b9\u5efa\u8bae\u7684\u6700\u4f4e\u95e8\u69db\u3002\u5bf9\u4e8e\u5927\u578b\u96c6\u7fa4&#xff0c;\u53ef\u4ee5\u8bbe\u4e3a 524288 \u751a\u81f3\u66f4\u9ad8\u3002\n <\/p>\n<p>\n \u4f60\u53ef\u4ee5\u8fd9\u6837\u7406\u89e3&#xff1a;\u8fd9\u4e2a\u503c\u51b3\u5b9a\u4e86\u4f60\u7684\u8282\u70b9\u201c\u80fd\u6253\u5f00\u591a\u5c11\u4e2a\u5c0f\u6587\u4ef6\u800c\u4e0d\u7ffb\u8f66\u201d\u3002\n<\/p>\n<hr \/>\n<h3>\n \u6587\u4ef6\u53e5\u67c4\u4e0d\u591f&#xff1f;\u4f60\u4ee5\u4e3a\u662f ES \u7684\u9505&#xff0c;\u5176\u5b9e\u662f\u7cfb\u7edf\u62e6\u4f4f\u4e86\u5b83<br \/>\n<\/h3>\n<p>\n \u53e6\u4e00\u4e2a\u9ad8\u9891\u62a5\u9519&#xff1a;\u201cToo many open files\u201d\u3002\n<\/p>\n<p>\n \u4f60\u4ee5\u4e3a\u53ea\u662f\u6253\u5f00\u4e86\u51e0\u4e2a\u65e5\u5fd7\u6587\u4ef6&#xff1f;\u9519\u3002Elasticsearch \u6253\u5f00\u7684\u4e1c\u897f\u6bd4\u4f60\u60f3\u8c61\u4e2d\u591a\u5f97\u591a&#xff1a;\n<\/p>\n<ul>\n<li>\n  \u6bcf\u4e2a\u7d22\u5f15\u5206\u7247 \u2192 \u6570\u5341\u4e2a segment \u6587\u4ef6\n <\/li>\n<li>\n  \u6bcf\u4e2a TCP \u8fde\u63a5 \u2192 \u4e00\u4e2a socket \u6587\u4ef6\u63cf\u8ff0\u7b26\n <\/li>\n<li>\n  \u5feb\u7167\u8def\u5f84\u3001\u63d2\u4ef6\u76ee\u5f55\u3001translog \u65e5\u5fd7\u2026\u2026\u5168\u90fd\u8981\u6253\u5f00\n <\/li>\n<\/ul>\n<p>\n \u8fd9\u4e9b\u52a0\u8d77\u6765\u8f7b\u677e\u7a81\u7834\u51e0\u5343\u751a\u81f3\u4e0a\u4e07 fd\u3002\n<\/p>\n<h4>\n \u4e24\u4e2a\u5c42\u7ea7\u5fc5\u987b\u540c\u65f6\u8c03\u6574<br \/>\n<\/h4>\n<p>\n \u5f88\u591a\u4eba\u53ea\u6539\u4e86<\/p>\n<p>  fs.file-max<\/p>\n<p> &#xff0c;\u5374\u5fd8\u4e86\u7528\u6237\u7ea7\u9650\u5236&#xff0c;\u7167\u6837\u5931\u8d25\u3002\n<\/p>\n<h5>\n 1. \u7cfb\u7edf\u7ea7&#xff1a;\u5168\u5c40\u6700\u5927\u6587\u4ef6\u53e5\u67c4\u6570<br \/>\n<\/h5>\n<p>echo &#034;fs.file-max &#061; 1048576&#034; &gt;&gt; \/etc\/sysctl.conf<\/p>\n<p>\n \u67e5\u770b\u5f53\u524d\u4f7f\u7528\u60c5\u51b5&#xff1a;\n<\/p>\n<p>cat \/proc\/sys\/fs\/file-nr<\/p>\n<p>\n \u8f93\u51fa\u4e09\u5217&#xff1a;\u5df2\u5206\u914d fd \u6570\u3001\u672a\u4f7f\u7528\u4f46\u4fdd\u7559\u7684\u3001\u7cfb\u7edf\u4e0a\u9650\u3002\u786e\u4fdd\u7b2c\u4e09\u5217 \u2265 1048576\u3002\n<\/p>\n<h5>\n 2. \u7528\u6237\u7ea7&#xff1a;elasticsearch \u7528\u6237\u80fd\u7528\u591a\u5c11&#xff1f;<br \/>\n<\/h5>\n<p>\n \u8fd9\u624d\u662f\u5173\u952e&#xff01;\u5373\u4f7f\u7cfb\u7edf\u5141\u8bb8\u767e\u4e07\u53e5\u67c4&#xff0c;\u5982\u679c\u8fd0\u884c ES \u7684\u7528\u6237\u88ab\u9650\u5236\u5728 1024&#xff0c;\u7167\u6837\u5bf8\u6b65\u96be\u884c\u3002\n<\/p>\n<p>\n \u7f16\u8f91<\/p>\n<p>  \/etc\/security\/limits.conf<\/p>\n<p> &#xff1a;\n<\/p>\n<p>elasticsearch soft nofile 65536<br \/>\nelasticsearch hard nofile 65536<br \/>\nelasticsearch soft nproc 4096<br \/>\nelasticsearch hard nproc 4096<\/p>\n<p>\n  &#x1f50d; \u89e3\u91ca&#xff1a;<\/p>\n<p>  &#8211;<\/p>\n<p>   nofile<\/p>\n<p>  &#xff1a;\u6700\u5927\u53ef\u6253\u5f00\u6587\u4ef6\u6570<\/p>\n<p>  &#8211;<\/p>\n<p>   nproc<\/p>\n<p>  &#xff1a;\u6700\u5927\u8fdb\u7a0b\/\u7ebf\u7a0b\u6570&#xff08;JVM \u8981\u521b\u5efa\u5927\u91cf\u7ebf\u7a0b&#xff09;<\/p>\n<p>  &#8211;<\/p>\n<p>   soft<\/p>\n<p>  \u548c<\/p>\n<p>   hard<\/p>\n<p>  \u90fd\u8981\u8bbe&#xff0c;\u907f\u514d\u67d0\u4e9b shell \u73af\u5883\u53ea\u8ba4 soft limit\n <\/p>\n<p>\n \u26a0\ufe0f \u6ce8\u610f&#xff1a;\u6539\u5b8c\u8fd9\u4e2a\u6587\u4ef6\u540e&#xff0c;<\/p>\n<p>  \u5fc5\u987b\u91cd\u65b0\u767b\u5f55\u6216\u91cd\u542f\u670d\u52a1\u624d\u80fd\u751f\u6548<\/p>\n<p> &#xff01;\n<\/p>\n<hr \/>\n<h3>\n systemd \u7528\u6237\u6ce8\u610f&#xff1a;limits.conf \u53ef\u80fd\u4e0d\u8d77\u4f5c\u7528&#xff01;<br \/>\n<\/h3>\n<p>\n \u5982\u679c\u4f60\u7528 systemd \u542f\u52a8 ES&#xff08;\u7edd\u5927\u591a\u6570\u73b0\u4ee3\u53d1\u884c\u7248\u90fd\u662f&#xff09;&#xff0c;\u4e0a\u9762\u7684<\/p>\n<p>  limits.conf<\/p>\n<p> \u5f88\u53ef\u80fd\u88ab\u5ffd\u7565\u3002\n<\/p>\n<p>\n \u56e0\u4e3a systemd \u6709\u81ea\u5df1\u7684\u8d44\u6e90\u63a7\u5236\u673a\u5236&#xff0c;\u4e0d\u5b8c\u5168\u9075\u5faa PAM \u7684 limits \u6a21\u5757\u3002\n<\/p>\n<p>\n \u600e\u4e48\u529e&#xff1f;\u8865\u4e00\u624b service override&#xff1a;\n<\/p>\n<p>mkdir -p \/etc\/systemd\/system\/elasticsearch.service.d<br \/>\ncat &gt; \/etc\/systemd\/system\/elasticsearch.service.d\/override.conf &lt;&lt; EOF<br \/>\n[Service]<br \/>\nLimitNOFILE&#061;65536<br \/>\nLimitNPROC&#061;4096<br \/>\nEOF<br \/>\nsystemctl daemon-reload<\/p>\n<p>\n \u8fd9\u6837\u65e0\u8bba\u4f60\u662f\u7528<\/p>\n<p>  systemctl start elasticsearch<\/p>\n<p> \u8fd8\u662f\u5f00\u673a\u81ea\u542f&#xff0c;\u90fd\u80fd\u62ff\u5230\u8db3\u591f\u7684\u8d44\u6e90\u914d\u989d\u3002\n<\/p>\n<hr \/>\n<h3>\n swap \u4e0d\u662f\u6551\u661f&#xff0c;\u800c\u662f\u5b9a\u65f6\u70b8\u5f39<br \/>\n<\/h3>\n<p>\n Elasticsearch &#043; JVM &#043; swap &#061; \u81ea\u6740\u4e09\u4ef6\u5957\u3002\n<\/p>\n<p>\n \u4f60\u53ef\u80fd\u4f1a\u60f3&#xff1a;\u201c\u5185\u5b58\u4e0d\u591f\u4e86&#xff0c;swap \u81f3\u5c11\u80fd\u8ba9\u670d\u52a1\u4e0d\u6b7b\u554a\u3002\u201d<\/p>\n<p> \u4f46\u73b0\u5b9e\u662f&#xff1a;\u4e00\u65e6\u5f00\u59cb swap&#xff0c;\u6027\u80fd\u65ad\u5d16\u5f0f\u4e0b\u8dcc\u3002\n<\/p>\n<p>\n \u4e3a\u4ec0\u4e48&#xff1f;\n<\/p>\n<ul>\n<li>\n  JVM \u5806\u5916\u5185\u5b58\u88ab\u6362\u51fa \u2192 GC \u65f6\u8981\u4ece\u78c1\u76d8\u8bfb\u56de\u6765 \u2192 STW \u65f6\u95f4\u98d9\u5347\n <\/li>\n<li>\n  \u6587\u4ef6\u7cfb\u7edf\u7f13\u5b58&#xff08;file system cache&#xff09;\u88ab\u6e05\u6389 \u2192 \u6240\u6709\u78c1\u76d8\u8bfb\u53d8\u6210\u771f\u5b9e I\/O \u2192 \u67e5\u8be2\u5ef6\u8fdf\u66b4\u6da8\n <\/li>\n<\/ul>\n<h4>\n \u6b63\u786e\u59ff\u52bf&#xff1a;\u51e0\u4e4e\u7981\u7528 swap<br \/>\n<\/h4>\n<p>\n \u8bbe\u7f6e<\/p>\n<p>  vm.swappiness&#061;1<\/p>\n<p> &#xff1a;\n<\/p>\n<p>echo &#034;vm.swappiness &#061; 1&#034; &gt;&gt; \/etc\/sysctl.conf<br \/>\nsysctl -p<\/p>\n<p>\n  &#x1f4cc; \u8bf4\u660e&#xff1a;<\/p>\n<p>   swappiness&#061;0<\/p>\n<p>  \u8868\u793a\u5b8c\u5168\u5173\u95ed swap&#xff08;\u6781\u7aef\u60c5\u51b5\u4e0b\u53ef\u80fd\u5bfc\u81f4OOM killer\u8bef\u6740&#xff09;&#xff1b;<\/p>\n<p>   &#061;1<\/p>\n<p>  \u662f Linux \u793e\u533a\u63a8\u8350\u7684\u201c\u4ec5\u5728\u7edd\u5bf9\u5fc5\u8981\u65f6\u624d\u542f\u7528\u201d\u7684\u5e73\u8861\u70b9\u3002\n <\/p>\n<p>\n \u914d\u5408\u64cd\u4f5c&#xff1a;\u786e\u4fdd\u4f60\u7ed9 ES \u5206\u914d\u7684\u5806\u5185\u5b58\u4e0d\u8d85\u8fc7\u7269\u7406\u5185\u5b58\u7684 50%&#xff0c;\u5269\u4e0b\u7684\u7559\u7ed9 OS \u7f13\u5b58\u3002\n<\/p>\n<hr \/>\n<h3>\n \u7f51\u7edc\u4e5f\u8981\u8ddf\u4e0a\u8282\u594f&#xff1a;\u522b\u8ba9\u8fde\u63a5\u961f\u5217\u6210\u74f6\u9888<br \/>\n<\/h3>\n<p>\n \u9ad8\u5e76\u53d1\u67e5\u8be2\u573a\u666f\u4e0b&#xff0c;\u5ba2\u6237\u7aef\u77ac\u95f4\u5efa\u7acb\u6570\u5343\u8fde\u63a5&#xff0c;\u5982\u679c\u5185\u6838\u5904\u7406\u4e0d\u8fc7\u6765&#xff0c;\u5c31\u4f1a\u51fa\u73b0&#xff1a;\n<\/p>\n<p>connection reset by peer<br \/>\naccept queue full<\/p>\n<p>\n \u7f6a\u9b41\u7978\u9996\u5c31\u662f<\/p>\n<p>  net.core.somaxconn<\/p>\n<p> \u2014\u2014 \u76d1\u542c\u7aef\u53e3\u7684 backlog \u961f\u5217\u957f\u5ea6\u3002\n<\/p>\n<p>\n \u9ed8\u8ba4\u901a\u5e38\u662f 128 \u6216 512&#xff0c;\u8fdc\u8fdc\u4e0d\u591f\u3002\n<\/p>\n<h4>\n \u63d0\u5347\u8fde\u63a5\u7f13\u51b2\u6c60<br \/>\n<\/h4>\n<p>echo &#034;net.core.somaxconn &#061; 65535&#034; &gt;&gt; \/etc\/sysctl.conf<br \/>\nsysctl -p<\/p>\n<p>\n \u540c\u65f6&#xff0c;\u5728 ES \u914d\u7f6e\u4e2d\u4e5f\u8981\u540c\u6b65\u8c03\u6574&#xff1a;\n<\/p>\n<p># elasticsearch.yml<br \/>\ntransport.tcp.listen_port: 9300<br \/>\nhttp.port: 9200<\/p>\n<p>\n \u867d\u7136 ES \u6ca1\u6709\u76f4\u63a5\u66b4\u9732 backlog \u53c2\u6570&#xff0c;\u4f46\u5b83\u5e95\u5c42 Netty \u4f1a\u81ea\u52a8\u9002\u914d\u7cfb\u7edf\u4e0a\u9650\u3002\n<\/p>\n<hr \/>\n<h3>\n \u4e00\u5957\u5b8c\u6574\u7684\u9884\u88c5\u68c0\u67e5\u6e05\u5355&#xff08;\u5efa\u8bae\u6536\u85cf&#xff09;<br \/>\n<\/h3>\n<p>\n \u522b\u7b49\u5230\u51fa\u95ee\u9898\u518d\u53bb\u7ffb\u6587\u6863\u3002\u628a\u4e0b\u9762\u8fd9\u4e9b\u505a\u6210\u90e8\u7f72\u811a\u672c\u7684\u4e00\u90e8\u5206&#xff0c;\u6bcf\u6b21\u4e0a\u7ebf\u81ea\u52a8\u68c0\u6d4b\u4fee\u590d\u3002\n<\/p>\n<p>#!\/bin\/bash<br \/>\n# es-prep.sh &#8211; Elasticsearch \u5b89\u88c5\u524d\u7cfb\u7edf\u51c6\u5907\u811a\u672c<\/p>\n<p># \u5185\u6838\u53c2\u6570<br \/>\ncat &gt;&gt; \/etc\/sysctl.conf &lt;&lt; EOF<br \/>\nvm.max_map_count&#061;262144<br \/>\nfs.file-max&#061;1048576<br \/>\nvm.swappiness&#061;1<br \/>\nnet.core.somaxconn&#061;65535<br \/>\nEOF<br \/>\nsysctl -p<\/p>\n<p># \u7528\u6237\u9650\u5236<br \/>\nuseradd -r elasticsearch 2&gt;\/dev\/null || true<br \/>\ncat &gt;&gt; \/etc\/security\/limits.conf &lt;&lt; EOF<br \/>\nelasticsearch soft nofile 65536<br \/>\nelasticsearch hard nofile 65536<br \/>\nelasticsearch soft nproc 4096<br \/>\nelasticsearch hard nproc 4096<br \/>\nEOF<\/p>\n<p># PAM \u652f\u6301&#xff08;\u786e\u4fdd limits \u751f\u6548&#xff09;<br \/>\ngrep -q &#034;pam_limits.so&#034; \/etc\/pam.d\/common-session || \\\\<br \/>\necho &#034;session required pam_limits.so&#034; &gt;&gt; \/etc\/pam.d\/common-session<\/p>\n<p># systemd override&#xff08;\u82e5\u5b58\u5728\u670d\u52a1\u6587\u4ef6&#xff09;<br \/>\nif systemctl cat elasticsearch &gt;\/dev\/null 2&gt;&amp;1; then<br \/>\n    mkdir -p \/etc\/systemd\/system\/elasticsearch.service.d<br \/>\n    cat &gt; \/etc\/systemd\/system\/elasticsearch.service.d\/override.conf &lt;&lt; EOF<br \/>\n[Service]<br \/>\nLimitNOFILE&#061;65536<br \/>\nLimitNPROC&#061;4096<br \/>\nEOF<br \/>\n    systemctl daemon-reload<br \/>\nfi<\/p>\n<p>echo &#034;\u2705 \u7cfb\u7edf\u9884\u914d\u7f6e\u5b8c\u6210&#xff0c;\u8bf7\u7ee7\u7eed\u5b89\u88c5 JDK \u4e0e Elasticsearch&#034;<\/p>\n<hr \/>\n<h3>\n \u5e38\u89c1\u8bef\u533a\u4e0e\u907f\u5751\u6307\u5357<br \/>\n<\/h3>\n<table>\n<tr>\n    \u95ee\u9898<\/p>\n<p>    \u9519\u8bef\u505a\u6cd5<\/p>\n<p>    \u6b63\u786e\u505a\u6cd5<br \/>\n   <\/tr>\n<tbody>\n<tr>\n<td>\n    \u4fee\u6539\u53c2\u6570\u540e\u4e0d\u751f\u6548\n   <\/td>\n<td>\n    \u53ea\u6539 sysctl&#xff0c;\u672a reload\n   <\/td>\n<td>\n    \u5fc5\u987b<\/p>\n<p>     sysctl -p<\/p>\n<p>    \u6216\u91cd\u542f\n   <\/td>\n<\/tr>\n<tr>\n<td>\n    limits.conf \u4e0d\u8d77\u4f5c\u7528\n   <\/td>\n<td>\n    \u5ffd\u89c6 systemd \u8986\u76d6\n   <\/td>\n<td>\n    \u6dfb\u52a0<\/p>\n<p>     .service.d\/override.conf<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n    swap \u8bbe\u4e3a 0\n   <\/td>\n<td>\n    \u5bfc\u81f4\u6781\u7aef\u60c5\u51b5\u65e0\u6cd5\u91ca\u653e\u5185\u5b58\n   <\/td>\n<td>\n    \u8bbe\u4e3a 1 \u66f4\u5b89\u5168\n   <\/td>\n<\/tr>\n<tr>\n<td>\n    \u53ea\u5173\u6ce8 data \u8282\u70b9\n   <\/td>\n<td>\n    master\/ingest \u8282\u70b9\u4e5f\u9700\u8c03\u4f18\n   <\/td>\n<td>\n    \u6240\u6709\u89d2\u8272\u7edf\u4e00\u57fa\u7840\u914d\u7f6e\n   <\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr \/>\n<h3>\n \u6700\u540e\u4e00\u53e5\u771f\u5fc3\u8bdd<br \/>\n<\/h3>\n<p>  Elasticsearch \u7684\u7a33\u5b9a\u6027&#xff0c;\u4e00\u534a\u9760\u914d\u7f6e&#xff0c;\u4e00\u534a\u9760\u7cfb\u7edf\u3002<\/p>\n<p>\n \u4f60\u82b1\u4e09\u5929\u7814\u7a76\u5206\u7247\u7b56\u7565\u3001\u51b7\u70ed\u67b6\u6784\u3001ILM \u751f\u547d\u5468\u671f&#xff0c;\u5374\u4e0d\u613f\u610f\u82b1\u5341\u5206\u949f\u8c03\u4e00\u4e0b\u5185\u6838\u53c2\u6570&#xff1f;\u90a3\u6240\u6709\u7684\u52aa\u529b\u90fd\u4f1a\u5728\u4e00\u6b21\u83ab\u540d\u5176\u5999\u7684\u5b95\u673a\u4e2d\u5f52\u96f6\u3002\n<\/p>\n<p>\n \u8bb0\u4f4f&#xff1a;<\/p>\n<p> \u6210\u529f\u7684 ES \u90e8\u7f72 \u2260 \u6210\u529f\u542f\u52a8\u3002<\/p>\n<p> \u771f\u6b63\u7684\u6210\u529f&#xff0c;\u662f\u5b83\u80fd\u5728\u9ad8\u538b\u4e0b\u6301\u7eed\u7a33\u5b9a\u8fd0\u884c\u4e00\u4e2a\u6708\u3001\u4e09\u4e2a\u6708\u3001\u4e00\u5e74\u3002\n<\/p>\n<p>\n \u800c\u8fd9&#xff0c;\u59cb\u4e8e\u4f60\u5728\u5b89\u88c5\u7b2c\u4e00\u6b65\u5c31\u505a\u5bf9\u7684\u4e8b\u3002\n<\/p>\n<p>\n \u5982\u679c\u4f60\u6b63\u5728\u642d\u5efa\u7b2c\u4e00\u4e2a ES \u96c6\u7fa4&#xff0c;\u4e0d\u59a8\u5148\u628a\u8fd9\u7bc7\u8d34\u5728\u663e\u793a\u5668\u65c1\u8fb9&#xff0c;\u9010\u6761\u6253\u52fe\u786e\u8ba4\u3002<\/p>\n<p> \u5c11\u8d70\u5f2f\u8def&#xff0c;\u624d\u662f\u6700\u5feb\u7684\u6377\u5f84\u3002\n<\/p>\n<p>\n  &#x1f4ac; \u4f60\u5728\u90e8\u7f72 ES \u65f6\u8fd8\u8e29\u8fc7\u54ea\u4e9b\u7cfb\u7edf\u5c42\u7684\u5751&#xff1f;\u6b22\u8fce\u7559\u8a00\u5206\u4eab&#xff0c;\u6211\u4eec\u4e00\u8d77\u586b\u5e73\u5b83\u4eec\u3002\n <\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e3a\u4ec0\u4e48\u4f60\u7684 Elasticsearch \u603b\u662f\u542f\u52a8\u5931\u8d25&#xff1f;90% \u7684\u4eba\u5ffd\u7565\u4e86\u8fd9\u4e00\u6b65\u4f60\u6709\u6ca1\u6709\u9047\u5230\u8fc7\u8fd9\u6837\u7684\u573a\u666f&#xff1a;\u5174\u51b2\u51b2\u5730\u5728\u670d\u52a1\u5668\u4e0a\u89e3\u538b\u5b8c Elasticsearch \u5b89\u88c5\u5305&#xff0c;\u4fe1\u5fc3\u6ee1\u6ee1\u5730\u6267\u884c.\/bin\/elasticsearch&#xff0c;\u7ed3\u679c\u65e5\u5fd7\u91cc\u5f39\u51fa\u4e00\u884c\u7ea2\u5b57&#xff1a;max virtual memory areas vm.max_map_count [65530] is too low, increase to at least <\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[6416],"topic":[],"class_list":["post-60691","post","type-post","status-publish","format-standard","hentry","category-server","tag-es"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u5feb\u901f\u7406\u89e3es\u5b89\u88c5\u6240\u9700\u670d\u52a1\u5668\u5185\u6838\u53c2\u6570\u4f18\u5316\u65b9\u5f0f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/60691.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u5feb\u901f\u7406\u89e3es\u5b89\u88c5\u6240\u9700\u670d\u52a1\u5668\u5185\u6838\u53c2\u6570\u4f18\u5316\u65b9\u5f0f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u4e3a\u4ec0\u4e48\u4f60\u7684 Elasticsearch \u603b\u662f\u542f\u52a8\u5931\u8d25&#xff1f;90% \u7684\u4eba\u5ffd\u7565\u4e86\u8fd9\u4e00\u6b65\u4f60\u6709\u6ca1\u6709\u9047\u5230\u8fc7\u8fd9\u6837\u7684\u573a\u666f&#xff1a;\u5174\u51b2\u51b2\u5730\u5728\u670d\u52a1\u5668\u4e0a\u89e3\u538b\u5b8c Elasticsearch \u5b89\u88c5\u5305&#xff0c;\u4fe1\u5fc3\u6ee1\u6ee1\u5730\u6267\u884c.\/bin\/elasticsearch&#xff0c;\u7ed3\u679c\u65e5\u5fd7\u91cc\u5f39\u51fa\u4e00\u884c\u7ea2\u5b57&#xff1a;max virtual memory areas vm.max_map_count [65530] is too low, increase to at least\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/60691.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-01-15T23:41:26+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/60691.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/60691.html\",\"name\":\"\u5feb\u901f\u7406\u89e3es\u5b89\u88c5\u6240\u9700\u670d\u52a1\u5668\u5185\u6838\u53c2\u6570\u4f18\u5316\u65b9\u5f0f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-01-15T23:41:26+00:00\",\"dateModified\":\"2026-01-15T23:41:26+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/60691.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/60691.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/60691.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u5feb\u901f\u7406\u89e3es\u5b89\u88c5\u6240\u9700\u670d\u52a1\u5668\u5185\u6838\u53c2\u6570\u4f18\u5316\u65b9\u5f0f\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u5feb\u901f\u7406\u89e3es\u5b89\u88c5\u6240\u9700\u670d\u52a1\u5668\u5185\u6838\u53c2\u6570\u4f18\u5316\u65b9\u5f0f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/60691.html","og_locale":"zh_CN","og_type":"article","og_title":"\u5feb\u901f\u7406\u89e3es\u5b89\u88c5\u6240\u9700\u670d\u52a1\u5668\u5185\u6838\u53c2\u6570\u4f18\u5316\u65b9\u5f0f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u4e3a\u4ec0\u4e48\u4f60\u7684 Elasticsearch \u603b\u662f\u542f\u52a8\u5931\u8d25&#xff1f;90% \u7684\u4eba\u5ffd\u7565\u4e86\u8fd9\u4e00\u6b65\u4f60\u6709\u6ca1\u6709\u9047\u5230\u8fc7\u8fd9\u6837\u7684\u573a\u666f&#xff1a;\u5174\u51b2\u51b2\u5730\u5728\u670d\u52a1\u5668\u4e0a\u89e3\u538b\u5b8c Elasticsearch \u5b89\u88c5\u5305&#xff0c;\u4fe1\u5fc3\u6ee1\u6ee1\u5730\u6267\u884c.\/bin\/elasticsearch&#xff0c;\u7ed3\u679c\u65e5\u5fd7\u91cc\u5f39\u51fa\u4e00\u884c\u7ea2\u5b57&#xff1a;max virtual memory areas vm.max_map_count [65530] is too low, increase to at least","og_url":"https:\/\/www.wsisp.com\/helps\/60691.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-01-15T23:41:26+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"3 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/60691.html","url":"https:\/\/www.wsisp.com\/helps\/60691.html","name":"\u5feb\u901f\u7406\u89e3es\u5b89\u88c5\u6240\u9700\u670d\u52a1\u5668\u5185\u6838\u53c2\u6570\u4f18\u5316\u65b9\u5f0f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-01-15T23:41:26+00:00","dateModified":"2026-01-15T23:41:26+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/60691.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/60691.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/60691.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u5feb\u901f\u7406\u89e3es\u5b89\u88c5\u6240\u9700\u670d\u52a1\u5668\u5185\u6838\u53c2\u6570\u4f18\u5316\u65b9\u5f0f"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/60691","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=60691"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/60691\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=60691"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=60691"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=60691"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=60691"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}