{"id":133,"date":"2022-02-06T07:23:21","date_gmt":"2022-02-05T23:23:21","guid":{"rendered":"http:\/\/nas.hepcloud.top:7000\/?p=133"},"modified":"2022-11-02T00:15:25","modified_gmt":"2022-11-01T16:15:25","slug":"%e7%be%a4%e6%99%96nas%e6%95%99%e7%a8%8b%e4%b8%83%e3%80%81%e5%88%a9%e7%94%a8docker%e5%ae%89%e8%a3%85elasticsearch%e5%b9%b6%e8%bf%9b%e8%a1%8c%e8%bf%9c%e7%a8%8b%e8%ae%bf%e9%97%ae","status":"publish","type":"post","link":"http:\/\/www.huerpu.cc:7000\/?p=133","title":{"rendered":"\u7fa4\u6656NAS docker\u7cfb\u5217\u6559\u7a0b(\u4e03)\u3001\u5229\u7528Docker\u5b89\u88c5elasticsearch\u5e76\u8fdb\u884c\u8fdc\u7a0b\u8bbf\u95ee"},"content":{"rendered":"<h1>\u7fa4\u6656NAS\u6559\u7a0b(\u4e03)\u3001\u5229\u7528Docker\u5b89\u88c5elasticsearch\u5e76\u8fdb\u884c\u8fdc\u7a0b\u8bbf\u95ee<\/h1>\n<h3>\u4e00\u3001\u4e0b\u8f7delasticsearch\u5b98\u65b9\u955c\u50cf<\/h3>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2022\/02\/06\/99.png\" alt=\"img\" \/><\/p>\n<p>\u7136\u540e\u76f4\u63a5\u4e0b\u8f7delasticsearch\u955c\u50cf\u5373\u53ef\u3002<\/p>\n<h3>\u4e8c\u3001\u914d\u7f6eelasticsearch\u955c\u50cf\u7684\u542f\u52a8\u53c2\u6570<\/h3>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2022\/02\/06\/100.png\" alt=\"img\" \/><\/p>\n<p>\u53cc\u51fb\u8fd0\u884c\uff0c\u8f93\u5165\u5bb9\u5668\u540d\u79f0\u3002\u9009\u62e9\u9ad8\u7ea7\u8bbe\u7f6e\u8fdb\u884c\u53c2\u6570\u8bbe\u5b9a\u3002<\/p>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2022\/02\/06\/101.png\" alt=\"img\" \/><\/p>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2022\/02\/06\/102.png\" alt=\"img\" \/><\/p>\n<p>\u8bbe\u7f6e\u73af\u5883\u53d8\u91cf\uff0c\u65b0\u589e\u4e00\u4e2adiscovery.type\uff0c\u8bbe\u5b9a\u4e3asingle-node\u3002<\/p>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2022\/02\/06\/103.png\" alt=\"img\" \/><\/p>\n<p>\u542f\u52a8\u955c\u50cf\u3002<\/p>\n<p>\u8fd9\u65f6\u5019\u5c31\u53ef\u4ee5\u9a8c\u8bc1\u4e00\u4e0b\uff0c\u6bd4\u5982\u4f7f\u7528postman\u5728\u5c40\u57df\u7f51\u5185\u8c03\u7528\u4e00\u4e0b\uff0c\u770b\u662f\u5426\u6210\u529f\u542f\u52a8\uff1a<code>http:\/\/192.168.31.19:9200<\/code>\uff0c<code>192.168.31.19<\/code>\u662f\u6211\u7684\u7fa4\u6656NAS\u5185\u5916IP\u3002<\/p>\n<h3>\u4e09\u3001\u8def\u7531\u5668\u8bbe\u7f6emongo\u7684\u7aef\u53e3\u8f6c\u53d1\u5230\u5916\u7f51<\/h3>\n<table>\n<thead>\n<tr>\n<th>\u540d\u79f0<\/th>\n<th>\u534f\u8bae<\/th>\n<th>\u5916\u90e8\u7aef\u53e3<\/th>\n<th>\u5185\u90e8IP\u5730\u5740<\/th>\n<th>\u5185\u90e8\u7aef\u53e3<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>6384<\/td>\n<td>TCP<\/td>\n<td>6384<\/td>\n<td>192.168.31.19<\/td>\n<td>9200<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u540d\u79f0\u53ef\u4ee5\u968f\u4fbf\u586b\uff0c\u534f\u8bae\u9009\u62e9TCP\uff0c\u5916\u90e8\u7aef\u53e3\u662f\u5916\u7f51\u8bbf\u95ee\u7684\u7aef\u53e3\uff0c\u5185\u90e8IP\u5730\u5740\u662f\u7fa4\u6656\u7684\u672c\u5730IP\uff0c\u5185\u90e8\u7aef\u53e3\u662f\u5bb9\u5668\u66b4\u9732\u7ed9\u5bbf\u4e3b\u673a\u7684\u7aef\u53e3\u53f7\uff0c\u8fd9\u91cc\u8bbe\u7f6e\u62106384\u3002\u5982\u679c\u628a\u5916\u90e8\u7aef\u53e3\u8bbe\u7f6e\u62109200\u7f51\u7edc\u4f1a\u4e0d\u901a\uff0c\u6240\u4ee5\u6211\u4eec\u8bbe\u7f6e\u6210\u4e866384\u7aef\u53e3\uff0c\u4e00\u822c\u5927\u7684\u7aef\u53e3\u53ef\u80fd\u4f1a\u6709\u5404\u79cd\u7f51\u7edc\u7684\u95ee\u9898\uff0c\u8fd8\u662f\u5efa\u8bae\u4f7f\u7528\u5c0f\u4e00\u4e9b\u7684\u7aef\u53e3\uff0c\u61d2\u5f97\u6298\u817e\u4e86\uff0c\u5c31\u5148\u7528\u8fd9\u4e2a\u7aef\u53e3\uff0c6384\u7aef\u53e3\u662f\u6ca1\u6709\u4efb\u4f55\u95ee\u9898\u7684\u3002<\/p>\n<h3>\u56db\u3001\u4e3aelasticsearch\u8bbe\u7f6e\u5bc6\u7801<\/h3>\n<p>\u9996\u5148\u4f7f\u7528postman\u5728\u5c40\u57df\u7f51\u8c03\u7528\u4e00\u4e0b\u8fd9\u4e2a\u8bf7\u6c42\uff1a<code>http:\/\/192.168.31.19:9200\/_xpack\/license\/start_trial?acknowledge=true<\/code><\/p>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2022\/02\/06\/104.png\" alt=\"img\" \/><\/p>\n<p>\u8fd4\u56de\u8fd9\u4e2a\u5373\u4e3a\u6210\u529f\uff1a<code>{&quot;acknowledged&quot;:true,&quot;trial_was_started&quot;:true,&quot;type&quot;:&quot;trial&quot;}<\/code>\u3002<\/p>\n<p>\u7136\u540e\u6253\u5f00\u5bb9\u5668bash\u7a97\u53e3\uff1a<\/p>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2022\/02\/06\/105.png\" alt=\"img\" \/><\/p>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2022\/02\/06\/106.png\" alt=\"img\" \/><\/p>\n<p>\u9996\u5148\u627e\u5230elasticsearch.yml\u6587\u4ef6\u7684\u4f4d\u7f6e\uff0c\u6211\u4eec\u4f7f\u7528<code>whereis elasticsearch.yml<\/code>\u547d\u4ee4\u3002\u7136\u540e\u8fdb\u5165\u76ee\u5f55\u8fdb\u884cvim\u7f16\u8f91\u3002<\/p>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2022\/02\/06\/107.png\" alt=\"img\" \/><\/p>\n<p>\u5728elasticsearch.yml\u6587\u4ef6\u672b\u5c3e\u589e\u52a0\u8fd9\u51e0\u9879\uff1a<\/p>\n<pre><code>http.cors.enabled: true                                                                             \nhttp.cors.allow-origin: &quot;*&quot;                                                                         \nhttp.cors.allow-headers: Authorization                                                              \nxpack.security.enabled: true                                                                        \nxpack.security.transport.ssl.enabled: true <\/code><\/pre>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2022\/02\/06\/108.png\" alt=\"img\" \/><\/p>\n<p>\u4fdd\u6301\u5e76\u9000\u51fa\u4e4b\u540e\uff0ccd\u5230bin\u76ee\u5f55\uff0c\u5e76\u6267\u884c<code>.\/elasticsearch-setup-passwords interactive<\/code>\uff0c\u8fdb\u884c\u79d8\u5bc6\u8bbe\u5b9a\u3002<\/p>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2022\/02\/06\/98.png\" alt=\"img\" \/><\/p>\n<p>\u91cd\u542fes\u3002<\/p>\n<h3>\u4e94\u3001\u4f7f\u7528elasticsearch head\u63d2\u4ef6\u8fdb\u884c\u8bbf\u95ee<\/h3>\n<p>\u767e\u5ea6\u8fd9\u4e2aelasticsearch head\u63d2\u4ef6\uff0c\u4e0b\u8f7d\u5230\u540e\u7f00\u4e3acrx\u7684\u6587\u4ef6\u8fdb\u884c\u5b89\u88c5\u5373\u53ef\uff0c\u8d85\u7ea7\u7b80\u5355\uff0c\u4e0d\u4f1a\u7684\u53ef\u4ee5\u767e\u5ea6\u6559\u7a0b\u3002\u5f53\u7136\u4e5f\u53ef\u4ee5\u4f7f\u7528kibana\u3001postman\u7b49\u53bb\u505a\u5404\u79cd\u64cd\u4f5c\u3002<\/p>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2022\/02\/06\/109.png\" alt=\"img\" \/><\/p>\n<p>\u5b89\u88c5\u597d\u4e4b\u540e\uff0c\u5728Chrome\u7684\u53f3\u4e0a\u65b9\uff0c\u4f1a\u6709\u8fd9\u6837\u4e00\u4e2a\u5c0f\u63d2\u4ef6\u6309\u94ae\u3002<\/p>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2022\/02\/06\/110.png\" alt=\"img\" \/><\/p>\n<p>\u70b9\u51fb\u8fd9\u4e2a\u5c0f\u6309\u94ae\uff0c\u6253\u5f00elasticsearch head\u63d2\u4ef6\u3002\u7136\u540e\u8f93\u5165\u8fde\u63a5\u5730\u5740\uff0c\u70b9\u51fbconnect\uff0c\u5e76\u4e14\u8f93\u5165\u8bbe\u7f6e\u7684\u7528\u6237\u540d\u548c\u5bc6\u7801\uff0c\u5373\u53ef\u8fde\u63a5\uff0c\u4ece\u800c\u8fdb\u884c\u5404\u79cd\u67e5\u8be2\u4e0e\u5b58\u50a8\u64cd\u4f5c\u3002<\/p>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2022\/02\/06\/111.png\" alt=\"img\" \/><\/p>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2022\/02\/06\/112.png\" alt=\"img\" \/><\/p>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2022\/02\/06\/113.png\" alt=\"img\" \/><\/p>\n<p>\u5230\u6b64\u5927\u529f\u544a\u6210\uff0celasticsearch\u5c31\u53ef\u4ee5\u6109\u5feb\u7684\u5916\u7f51\u8bbf\u95ee\u5566\uff01<\/p>\n<p>\u5e76\u4e14\u8fd9\u4e2a\u955c\u50cf\u662f\u53ef\u4ee5\u5f00\u673a\u81ea\u542f\u52a8elasticsearch\u7684\uff0c\u6240\u4ee5\u65e0\u9700\u989d\u5916\u7684\u914d\u7f6e\u4e86\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u7fa4\u6656NAS\u6559\u7a0b(\u4e03)\u3001\u5229\u7528Docker\u5b89\u88c5elasticsearch\u5e76\u8fdb\u884c\u8fdc\u7a0b\u8bbf\u95ee \u4e00\u3001\u4e0b\u8f7delasticse [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,10],"tags":[],"class_list":["post-133","post","type-post","status-publish","format-standard","hentry","category-nas","category-nas-docker"],"_links":{"self":[{"href":"http:\/\/www.huerpu.cc:7000\/index.php?rest_route=\/wp\/v2\/posts\/133","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.huerpu.cc:7000\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.huerpu.cc:7000\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.huerpu.cc:7000\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.huerpu.cc:7000\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=133"}],"version-history":[{"count":1,"href":"http:\/\/www.huerpu.cc:7000\/index.php?rest_route=\/wp\/v2\/posts\/133\/revisions"}],"predecessor-version":[{"id":549,"href":"http:\/\/www.huerpu.cc:7000\/index.php?rest_route=\/wp\/v2\/posts\/133\/revisions\/549"}],"wp:attachment":[{"href":"http:\/\/www.huerpu.cc:7000\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=133"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.huerpu.cc:7000\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=133"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.huerpu.cc:7000\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=133"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}