{"id":107,"date":"2020-11-20T17:10:54","date_gmt":"2020-11-20T09:10:54","guid":{"rendered":"http:\/\/blog.gamekingtao.top\/?p=107"},"modified":"2020-11-20T17:49:28","modified_gmt":"2020-11-20T09:49:28","slug":"centos7-%e5%ae%89%e8%a3%85elasticsearch%e5%8f%8aelasticsearch-head","status":"publish","type":"post","link":"https:\/\/blog.gamekingtao.top\/index.php\/2020\/11\/20\/centos7-%e5%ae%89%e8%a3%85elasticsearch%e5%8f%8aelasticsearch-head\/","title":{"rendered":"centos7  \u5b89\u88c5elasticsearch\u53caelasticsearch-head"},"content":{"rendered":"\n<p>1.\u65b0\u589ees\u7528\u6237\u5e76\u521b\u5efa\u5bf9\u5e94\u6587\u4ef6(\/home\/es  data,logs\u7b49)\uff0c\u4fee\u6539\/home\/es\u7684\u6240\u6709\u6587\u4ef6\u6743\u9650\u4e3aes<br> 2.visudo  \u65b0\u589e es  ALL=(ALL)   ALL <\/p>\n\n\n\n<p>elasticearch\u4e0b\u8f7d\u5730\u5740<a href=\"https:\/\/artifacts.elastic.co\/downloads\/elasticsearch\/elasticsearch-7.10.0-linux-x86_64.tar.gz\">https:\/\/artifacts.elastic.co\/downloads\/elasticsearch\/elasticsearch-7.6.1<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/artifacts.elastic.co\/downloads\/elasticsearch\/elasticsearch-7.10.0-linux-x86_64.tar.gz\">-linux-x86_64.tar.gz<\/a><\/p>\n\n\n\n<p>\u95ee\u9898\u4e00\uff1aERROR: bootstrap checks failed<\/p>\n\n\n\n<p>vi \/etc\/security\/limits.conf <\/p>\n\n\n\n<p>\u6dfb\u52a0\u5982\u4e0b\u5185\u5bb9:<\/p>\n\n\n\n<ul><li>soft nproc 65536<\/li><li>hard nproc 65536<\/li><li>soft nofile 65536<\/li><li>hard nofile 65536<\/li><\/ul>\n\n\n\n<p>\u95ee\u9898\u4e8c\uff1amax number of threads [1024] for user [lish] likely too low, increase to at least [2048]<\/p>\n\n\n\n<p>\u89e3\u51b3\uff1a\u5207\u6362\u5230root\u7528\u6237\uff0c\u8fdb\u5165limits.d\u76ee\u5f55\u4e0b\u4fee\u6539\u914d\u7f6e\u6587\u4ef6\u3002<br>\nvi \/etc\/security\/limits.d\/90-nproc.conf <br>\n\u4fee\u6539\u5982\u4e0b\u5185\u5bb9\uff1a<\/p>\n\n\n\n<ul><li>soft nproc 1024<\/li><\/ul>\n\n\n\n<h1>\u4fee\u6539\u4e3a<\/h1>\n\n\n\n<ul><li>soft nproc 2048<\/li><\/ul>\n\n\n\n<p>\u95ee\u9898\u4e09\uff1amax virtual memory areas vm.max_map_count [65530] likely too low, increase to at least [262144]<br>\nvi \/etc\/sysctl.conf <br>\n\u6dfb\u52a0\u4e0b\u9762\u914d\u7f6e\uff1a<br>\nvm.max_map_count=655360<br>\n\u6700\u540e\u5e76\u6267\u884c\u547d\u4ee4\uff1a<br>\nsysctl -p<\/p>\n\n\n\n<p>3.\u4e0a\u4f20elasticsearch\u5b89\u88c5\u5305\u5e76\u4fee\u6539\u914d\u7f6e\u6587\u4ef6<br> \u5e76\u5728\u914d\u7f6e\u6587\u4ef6config\/elasticsearch.yml\u672b\u5c3e\u52a0\u4e0a  (\u4f9belasticsearch-head\u8bbf\u95ee\u4f7f\u7528)<br> http.cors.enabled: true<br> http.cors.allow-origin: &#8220;*&#8221;<\/p>\n\n\n\n<p>\u540e\u53f0\u542f\u52a8elasticsearch  \/home\/es\/elasticsearch\/bin\/elasticsearch -d<\/p>\n\n\n\n<p>4.\u6253\u5f00\u7f51\u5740\u67e5\u770bes\u662f\u5426\u5b89\u88c5\u6210\u529f<br>\nhttp:\/\/localhost:9200\/<\/p>\n\n\n\n<p>5.\u5b89\u88c5elasticsearch-analysis-ik\u5206\u8bcd\u63d2\u4ef6<br>\n\/home\/es\/elasticsearch\/bin\/elasticsearch-plugin install https:\/\/github.com\/medcl\/elasticsearch-analysis-ik\/releases\/download\/v7.6.1\/elasticsearch-analysis-ik-7.6.1.zip<\/p>\n\n\n\n<p>6.\u5b89\u88c5elasticsearch-head   https:\/\/www.jianshu.com\/p\/fdf90354e308<\/p>\n\n\n\n<p>\u4fee\u6539\/home\/es\/elasticsearch-head\/_site\/app.js  \u5185\u5bb9\u4e2d\u7684localhost\u4e3a\u5f53\u524d\u670d\u52a1\u5668\u7684ip\u5730\u5740\uff0c\u5426\u5219\u5f00\u542f\u96c6\u7fa4\u540e\u663e\u793a\u672a\u8fde\u63a5<\/p>\n\n\n\n<p>\u540e\u53f0\u542f\u52a8elasticsearch-head  nohup npm run start &amp;<\/p>\n\n\n\n<p>1.\u542f\u52a8head\uff1agrunt server<\/p>\n\n\n\n<p>2.\u67e5\u770bhead \u8fdb\u7a0b\uff1alsof -i :9100<\/p>\n\n\n\n<p>3.\u505c\u6b62head\uff1akill -9 \u8fdb\u7a0bid<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1.\u65b0\u589ees\u7528\u6237\u5e76\u521b\u5efa\u5bf9\u5e94\u6587\u4ef6(\/home\/es data,logs\u7b49)\uff0c\u4fee\u6539\/home\/es\u7684\u6240\u6709\u6587\u4ef6\u6743\u9650\u4e3a &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/blog.gamekingtao.top\/index.php\/2020\/11\/20\/centos7-%e5%ae%89%e8%a3%85elasticsearch%e5%8f%8aelasticsearch-head\/\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb<span class=\"screen-reader-text\">\u201ccentos7  \u5b89\u88c5elasticsearch\u53caelasticsearch-head\u201d<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[21],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.gamekingtao.top\/index.php\/wp-json\/wp\/v2\/posts\/107"}],"collection":[{"href":"https:\/\/blog.gamekingtao.top\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.gamekingtao.top\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.gamekingtao.top\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.gamekingtao.top\/index.php\/wp-json\/wp\/v2\/comments?post=107"}],"version-history":[{"count":3,"href":"https:\/\/blog.gamekingtao.top\/index.php\/wp-json\/wp\/v2\/posts\/107\/revisions"}],"predecessor-version":[{"id":112,"href":"https:\/\/blog.gamekingtao.top\/index.php\/wp-json\/wp\/v2\/posts\/107\/revisions\/112"}],"wp:attachment":[{"href":"https:\/\/blog.gamekingtao.top\/index.php\/wp-json\/wp\/v2\/media?parent=107"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.gamekingtao.top\/index.php\/wp-json\/wp\/v2\/categories?post=107"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.gamekingtao.top\/index.php\/wp-json\/wp\/v2\/tags?post=107"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}