{"id":4633,"date":"2020-04-04T10:22:57","date_gmt":"2020-04-04T02:22:57","guid":{"rendered":"http:\/\/www.menglanglang.cn\/?p=4633"},"modified":"2022-09-16T05:50:57","modified_gmt":"2022-09-15T21:50:57","slug":"%e5%a4%a7%e6%95%b0%e6%8d%ae%e5%ad%a6%e4%b9%a0%e5%88%9d%e7%ba%a7%e5%85%a5%e9%97%a8%e6%95%99%e7%a8%8b%ef%bc%88%e5%85%ab%ef%bc%89-elasticsearch-7-6-2-%e5%8d%95%e8%8a%82%e7%82%b9","status":"publish","type":"post","link":"http:\/\/www.menglanglang.cn\/?p=4633","title":{"rendered":"\u5927\u6570\u636e\u5b66\u4e60\u521d\u7ea7\u5165\u95e8\u6559\u7a0b\uff08\u516b\uff09 \u2014\u2014 Elasticsearch 7.6.2 \u5355\u8282\u70b9\u7684\u5b89\u88c5\u3001\u542f\u52a8\u548c\u6d4b\u8bd5"},"content":{"rendered":"\n<p>\u672c\u7bc7\u6587\u7ae0\u4e3b\u8981\u4ecb\u7ecd Elasticsearch 7.6.2 \u7248\u672c\u7684\u5355\u8282\u70b9\u5b89\u88c5\u3001\u542f\u52a8\u53ca\u6d4b\u8bd5\u6b65\u9aa4\uff0c\u4f9b\u521d\u5b66\u8005\u53c2\u8003\u3002\u6d4b\u8bd5\u7cfb\u7edf\u4e3a CentOS 6.9\uff0cJDK \u7248\u672c\u4e3a&nbsp;1.8.0_172\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u7b2c\u4e00\u6b65\uff1a\u4e0b\u8f7d\u5b89\u88c5\u5305\u5e76\u4e0a\u4f20\u5230\u6d4b\u8bd5\u670d\u52a1\u5668<\/h3>\n\n\n\n<p>\u4e0b\u8f7d\u5730\u5740\u4e3a\u5b98\u7f51\u5730\u5740\uff1a<a href=\"https:\/\/artifacts.elastic.co\/downloads\/elasticsearch\/elasticsearch-7.6.2-linux-x86_64.tar.gz\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/artifacts.elastic.co\/downloads\/elasticsearch\/elasticsearch-7.6.2-linux-x86_64.tar.gz<\/a>\u3002<\/p>\n\n\n\n<p>\u4e0b\u8f7d\u540e\u4e0a\u4f20\u5230\u6d4b\u8bd5\u670d\u52a1\u5668\uff0c\u8fd9\u91cc\u4e0a\u4f20\u5230\u8def\u5f84\uff1a\/opt\/es\u4e0b\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u7b2c\u4e8c\u6b65\uff1a\u89e3\u538b\u5b89\u88c5\u5305<\/h3>\n\n\n\n<p># tar -zxvf elasticsearch-7.6.2-linux-x86_64.tar.gz<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u7b2c\u4e09\u6b65\uff1a\u542f\u52a8 ES \u670d\u52a1<\/h3>\n\n\n\n<p># cd elasticsearch-7.6.2<\/p>\n\n\n\n<p># .\/bin\/elasticsearch<\/p>\n\n\n\n<p>\u62a5\u9519\u4fe1\u606f\u5982\u4e0b\uff1a<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>[2018-07-31T04:25:46,553][ERROR][o.e.b.ElasticsearchUncaughtExceptionHandler] [test242] uncaught exception in thread [main]<br \/>org.elasticsearch.bootstrap.StartupException: java.lang.RuntimeException: can not run elasticsearch as root<br \/>&nbsp; &nbsp; &nbsp; &nbsp; at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:174) ~[elasticsearch-7.6.2.jar:7.6.2]<br \/>&nbsp; &nbsp; &nbsp; &nbsp; at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:161) ~[elasticsearch-7.6.2.jar:7.6.2]<br \/>&nbsp; &nbsp; &nbsp; &nbsp; at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86) ~[elasticsearch-7.6.2.jar:7.6.2]<br \/>&nbsp; &nbsp; &nbsp; &nbsp; at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:125) ~[elasticsearch-cli-7.6.2.jar:7.6.2]<br \/>&nbsp; &nbsp; &nbsp; &nbsp; at org.elasticsearch.cli.Command.main(Command.java:90) ~[elasticsearch-cli-7.6.2.jar:7.6.2]<br \/>&nbsp; &nbsp; &nbsp; &nbsp; at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:126) ~[elasticsearch-7.6.2.jar:7.6.2]<br \/>&nbsp; &nbsp; &nbsp; &nbsp; at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:92) ~[elasticsearch-7.6.2.jar:7.6.2]<br \/>Caused by: java.lang.RuntimeException: can not run elasticsearch as root<br \/>&nbsp; &nbsp; &nbsp; &nbsp; at org.elasticsearch.bootstrap.Bootstrap.initializeNatives(Bootstrap.java:105) ~[elasticsearch-7.6.2.jar:7.6.2]<br \/>&nbsp; &nbsp; &nbsp; &nbsp; at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:172) ~[elasticsearch-7.6.2.jar:7.6.2]<br \/>&nbsp; &nbsp; &nbsp; &nbsp; at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:349) ~[elasticsearch-7.6.2.jar:7.6.2]<br \/>&nbsp; &nbsp; &nbsp; &nbsp; at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:170) ~[elasticsearch-7.6.2.jar:7.6.2]<br \/>&nbsp; &nbsp; &nbsp; &nbsp; ... 6 more<\/p><\/blockquote>\n\n\n\n<p>\u53ef\u4ee5\u770b\u5230\u9519\u8bef\u539f\u56e0\u4e3a\uff1a\u4e0d\u80fd\u7528 root \u8fd0\u884c Elasticsearch\uff01\uff01\uff01<\/p>\n\n\n\n<p>\u90a3\u4e3a\u4ec0\u4e48\u4e0d\u80fd\u7528 root \u8d26\u53f7\u8fd0\u884c\u5462\uff1f\u8fd9\u662f\u51fa\u4e8e\u7cfb\u7edf\u5b89\u5168\u8003\u8651\u8bbe\u7f6e\u7684\u6761\u4ef6\u3002\u7531\u4e8e es \u53ef\u4ee5\u63a5\u6536\u7528\u6237\u8f93\u5165\u7684\u811a\u672c\u5e76\u4e14\u6267\u884c\uff0c\u4e3a\u4e86\u7cfb\u7edf\u5b89\u5168\u8003\u8651\uff0ces5 \u4e4b\u540e\u7684\u90fd\u4e0d\u80fd\u4f7f\u7528\u6dfb\u52a0\u542f\u52a8\u53c2\u6570\u6216\u8005\u4fee\u6539\u914d\u7f6e\u6587\u4ef6\u7b49\u65b9\u6cd5\u542f\u52a8\u4e86\uff0c\u4e0d\u5141\u8bb8\u4f7f\u7528 root \u7528\u6237\u542f\u52a8 es\uff0c\u5efa\u8bae\u521b\u5efa\u4e00\u4e2a\u5355\u72ec\u7684\u7528\u6237\u7528\u6765\u8fd0\u884c\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u7b2c\u56db\u6b65\uff1a\u521b\u5efa\u5355\u72ec\u7cfb\u7edf\u7528\u6237<\/h3>\n\n\n\n<p># adduser elastic<\/p>\n\n\n\n<p># passwd elastic<\/p>\n\n\n\n<p><img loading=\"lazy\" decoding=\"async\" width=\"698\" height=\"171\" src=\"\/\/images.weserv.nl\/?url=https:\/\/img-blog.csdnimg.cn\/20200404031225587.png\" alt=\"\"\/><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u7b2c\u4e94\u6b65\uff1a\u4fee\u6539\u76ee\u5f55\u6743\u9650<\/h3>\n\n\n\n<p>\u5bf9\u4e8e\u7b2c\u4e8c\u6b65\u89e3\u538b\u7f29\u7684\u5305\uff0c\u76ee\u5f55\u6743\u9650\u76ee\u524d\u662f root\uff0c\u9700\u8981\u4fee\u6539\u4e3a elastic\u3002<\/p>\n\n\n\n<p># cd \/opt\/es\/<\/p>\n\n\n\n<p># chown -R elastic elasticsearch-7.6.2<\/p>\n\n\n\n<p># chgrp -R elastic elasticsearch-7.6.2<\/p>\n\n\n\n<p><img loading=\"lazy\" decoding=\"async\" width=\"900\" height=\"196\" src=\"\/\/images.weserv.nl\/?url=https:\/\/img-blog.csdnimg.cn\/20200404031624751.png?x-oss-process=image\/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3R6aHV3Yg==,size_16,color_FFFFFF,t_70\" alt=\"\"\/><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u7b2c\u516d\u6b65\uff1a\u5207\u6362\u7528\u6237\u5e76\u542f\u52a8\u670d\u52a1<\/h3>\n\n\n\n<p>\u5207\u6362\u65b0\u5efa\u7684\u7528\u6237 elastic\uff0c\u5e76\u5728\u6b64\u542f\u52a8 es \u670d\u52a1\u3002<\/p>\n\n\n\n<p># su elastic<\/p>\n\n\n\n<p>$ cd elasticsearch-7.6.2<\/p>\n\n\n\n<p>$ .\/bin\/elasticsearch<\/p>\n\n\n\n<p>\u5982\u679c\u51fa\u73b0\u5982\u4e0b\u9519\u8bef\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;2018-07-31T05:14:58,860]&#91;WARN ]&#91;o.e.b.JNANatives         ] &#91;test242] unable to install syscall filter: \njava.lang.UnsupportedOperationException: seccomp unavailable: CONFIG_SECCOMP not compiled into kernel, \nCONFIG_SECCOMP and CONFIG_SECCOMP_FILTER are needed\n        at org.elasticsearch.bootstrap.SystemCallFilter.linuxImpl(SystemCallFilter.java:342) ~&#91;elasticsearch-7.6.2.jar:7.6.2]\n        at org.elasticsearch.bootstrap.SystemCallFilter.init(SystemCallFilter.java:617) ~&#91;elasticsearch-7.6.2.jar:7.6.2]\n        at org.elasticsearch.bootstrap.JNANatives.tryInstallSystemCallFilter(JNANatives.java:260) &#91;elasticsearch-7.6.2.jar:7.6.2]\n        at org.elasticsearch.bootstrap.Natives.tryInstallSystemCallFilter(Natives.java:113) &#91;elasticsearch-7.6.2.jar:7.6.2]\n        at org.elasticsearch.bootstrap.Bootstrap.initializeNatives(Bootstrap.java:110) &#91;elasticsearch-7.6.2.jar:7.6.2]\n        at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:172) &#91;elasticsearch-7.6.2.jar:7.6.2]\n        at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:349) &#91;elasticsearch-7.6.2.jar:7.6.2]\n        at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:170) &#91;elasticsearch-7.6.2.jar:7.6.2]\n        at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:161) &#91;elasticsearch-7.6.2.jar:7.6.2]\n        at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86) &#91;elasticsearch-7.6.2.jar:7.6.2]\n        at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:125) &#91;elasticsearch-cli-7.6.2.jar:7.6.2]\n        at org.elasticsearch.cli.Command.main(Command.java:90) &#91;elasticsearch-cli-7.6.2.jar:7.6.2]\n        at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:126) &#91;elasticsearch-7.6.2.jar:7.6.2]\n        at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:92) &#91;elasticsearch-7.6.2.jar:7.6.2]<\/code><\/pre>\n\n\n\n<p>\u539f\u56e0\u662f\uff1aCentos6 \u4e0d\u652f\u6301 SecComp\uff0c\u800c ES \u9ed8\u8ba4 bootstrap.system_call_filter \u4e3a true \u8fdb\u884c\u68c0\u6d4b\uff0c\u5bfc\u81f4\u68c0\u6d4b\u5931\u8d25\uff0c\u5931\u8d25\u540e\u76f4\u63a5\u5bfc\u81f4ES \u4e0d\u80fd\u542f\u52a8\u3002E3.5 \u7248\u672c\u4ee5\u4e0a\uff0c\u76f4\u63a5\u7981\u7528\u8fd9\u4e2a\u63d2\u4ef6\u5373\u53ef\u3002<\/p>\n\n\n\n<p>\u89e3\u51b3\u65b9\u5f0f\uff1a\u4fee\u6539 elasticsearch.yml\u3002<\/p>\n\n\n\n<p>$ vi config\/elasticsearch.yml<\/p>\n\n\n\n<p>\u6dfb\u52a0\u5982\u4e0b\u914d\u7f6e\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># ----------------------------------- Memory -----------------------------------\n#\n# Lock the memory on startup:\n#\n#bootstrap.memory_lock: true\nbootstrap.system_call_filter: false\n#\n# Make sure that the heap size is set to about half the memory available\n# on the system and that the owner of the process is allowed to use this\n# limit.\n#\n# Elasticsearch performs poorly when the system is swapping the memory.\n#<\/code><\/pre>\n\n\n\n<p>\u518d\u6b21\u542f\u52a8\u670d\u52a1\uff0c\u53ef\u4ee5\u770b\u5230\u53c8\u51fa\u73b0\u4e00\u4e9b\u9519\u8bef\u5bfc\u81f4\u542f\u52a8\u4e0d\u4e86\uff0c\u8be6\u7ec6\u5982\u4e0b\uff1a<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>[4] bootstrap checks failed<br \/>[1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65535]<br \/>[2]: max number of threads [1024] for user [elastic] is too low, increase to at least [4096]<br \/>[3]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]<br \/>[4]: the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes] must&nbsp;<br \/>be configured<\/p><\/blockquote>\n\n\n\n<p>\u30101\u3011\u9519\u8bef\u539f\u56e0\u662f\uff1a\u6bcf\u4e2a\u8fdb\u7a0b\u6700\u5927\u540c\u65f6\u6253\u5f00\u6587\u4ef6\u6570\u592a\u5c0f\u3002\u53ef\u901a\u8fc7\u4e0b\u9762\u4ee5\u4e0b\u547d\u4ee4\u67e5\u770b\u5f53\u524d\u6570\u91cf\uff1a<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>[root@test242 logs]# ulimit -Hn<br \/>4096<br \/>[root@test242 logs]# ulimit -Sn<br \/>1024<br \/>[root@test242 logs]#&nbsp;<\/p><\/blockquote>\n\n\n\n<p>\u89e3\u51b3\u65b9\u6cd5\uff1a\u4fee\u6539 \/etc\/security\/limits.conf \u6587\u4ef6\uff0c\u589e\u52a0\u914d\u7f6e\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>*               soft    nofile          65535\n*               hard    nofile          65535<\/code><\/pre>\n\n\n\n<p>\u7528\u6237\u9000\u51fa\u540e\u91cd\u65b0\u767b\u5f55\u751f\u6548\u3002&nbsp;<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>[root@test242 ~]# ulimit -Hn<br \/>65535<br \/>[root@test242 ~]# ulimit -Sn<br \/>65535<br \/>[root@test242 ~]#&nbsp;<\/p><\/blockquote>\n\n\n\n<p>\u30102\u3011\u9519\u8bef\u539f\u56e0\u662f\uff1a\u6700\u5927\u7ebf\u7a0b\u4e2a\u6570\u592a\u4f4e\u3002\u53ef\u901a\u8fc7\u4e0b\u9762\u4ee5\u4e0b\u547d\u4ee4\u67e5\u770b\u5f53\u524d\u6570\u91cf\uff1a<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>[root@test242 ~]# ulimit -Hu<br \/>3838<br \/>[root@test242 ~]# ulimit -Su<br \/>3838<br \/>[root@test242 ~]#&nbsp;<\/p><\/blockquote>\n\n\n\n<p>\u89e3\u51b3\u65b9\u6cd5\uff1a\u4fee\u6539 \/etc\/security\/limits.conf \u6587\u4ef6\uff0c\u589e\u52a0\u914d\u7f6e\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>*               soft    nproc           4096\n*               hard    nproc           4096<\/code><\/pre>\n\n\n\n<p>\u4fee\u6539 vi \/etc\/security\/limits.d\/90-nproc.conf \u6587\u4ef6\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>*          soft    nproc     4096\nroot       soft    nproc     unlimited<\/code><\/pre>\n\n\n\n<p>\u7528\u6237\u9000\u51fa\u540e\u91cd\u65b0\u767b\u5f55\u751f\u6548\u3002&nbsp;<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>[root@test242 ~]# ulimit -Hu<br \/>4096<br \/>[root@test242 ~]# ulimit -Su<br \/>4096<br \/>[root@test242 ~]#&nbsp;<\/p><\/blockquote>\n\n\n\n<p>\u30103\u3011\u9519\u8bef\u539f\u56e0\u662f\uff1aJVM \u7ebf\u7a0b\u6570\u9650\u5236\u6570\u91cf\u592a\u4f4e\uff0c\u9700\u8981\u8c03\u9ad8\u3002<\/p>\n\n\n\n<p>\u89e3\u51b3\u65b9\u6cd5\uff1a\u4fee\u6539 \/etc\/sysctl.conf \u6587\u4ef6\uff0c\u589e\u52a0\u914d\u7f6e vm.max_map_count=262144<\/p>\n\n\n\n<p>\u6267\u884c\u547d\u4ee4 sysctl -p \u4f7f\u4e4b\u914d\u7f6e\u751f\u6548\u3002<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>[root@test242 ~]# sysctl -p<br \/>net.ipv4.ip_forward = 0<br \/>net.ipv4.conf.default.rp_filter = 1<br \/>net.ipv4.conf.default.accept_source_route = 0<br \/>kernel.sysrq = 0<br \/>kernel.core_uses_pid = 1<br \/>net.ipv4.tcp_syncookies = 1<br \/>kernel.msgmnb = 65536<br \/>kernel.msgmax = 65536<br \/>kernel.shmmax = 68719476736<br \/>kernel.shmall = 4294967296<br \/>vm.max_map_count = 262144<\/p><\/blockquote>\n\n\n\n<p>\u30104\u3011\u9519\u8bef\u539f\u56e0\u662f\uff1a\u6ca1\u6709\u6307\u5b9a\u521d\u59cb\u5316\u8282\u70b9\u3002<\/p>\n\n\n\n<p>\u89e3\u51b3\u65b9\u6cd5\uff1a\u4fee\u6539 es \u7684\u914d\u7f6e\u6587\u4ef6 elasticsearch-7.6.2\/config\/elasticsearch.yml\uff0c\u628a&nbsp;#cluster.initial_master_nodes: [\"node-1\", \"node-2\"] \u53bb\u6389\u6ce8\u91ca\u540e\uff0c\u53ea\u4fdd\u7559 node-1\u3002\u4fee\u6539\u540e\u914d\u7f6e\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># --------------------------------- Discovery ----------------------------------\n#\n# Pass an initial list of hosts to perform discovery when this node is started:\n# The default list of hosts is &#91;\"127.0.0.1\", \"&#91;::1]\"]\n#\n#discovery.seed_hosts: &#91;\"host1\", \"host2\"]\n#\n# Bootstrap the cluster using an initial set of master-eligible nodes:\n#\ncluster.initial_master_nodes: &#91;\"node-1\"]\n#\n# For more information, consult the discovery and cluster formation module documentation.\n#<\/code><\/pre>\n\n\n\n<p>\u6ce8\u9500\u7cfb\u7edf\u7528\u6237\uff0c\u91cd\u65b0\u767b\u5f55\u540e\u518d\u6b21\u542f\u52a8 ES\uff1a<\/p>\n\n\n\n<p><img loading=\"lazy\" decoding=\"async\" width=\"900\" height=\"269\" src=\"\/\/images.weserv.nl\/?url=https:\/\/img-blog.csdnimg.cn\/20200404044052984.png?x-oss-process=image\/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3R6aHV3Yg==,size_16,color_FFFFFF,t_70\" alt=\"\"\/><\/p>\n\n\n\n<p>\u53ef\u4ee5\u770b\u5230\u670d\u52a1\u542f\u52a8\u6210\u529f\u4e86\uff0c\u901a\u8fc7\u6d4f\u89c8\u5668\u8bbf\u95ee&nbsp;<a href=\"http:\/\/192.168.220.242:9200\/\">http:\/\/192.168.220.242:9200\/<\/a>&nbsp;\u8fdb\u884c\u6d4b\u8bd5\uff0c\u7ed3\u679c\u9875\u9762\u63d0\u793a ERR_CONNECTION_REFUSED\uff1a<\/p>\n\n\n\n<p><img loading=\"lazy\" decoding=\"async\" src=\"\/\/images.weserv.nl\/?url=https:\/\/img-blog.csdnimg.cn\/20200404034411687.png?x-oss-process=image\/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3R6aHV3Yg==,size_16,color_FFFFFF,t_70\" width=\"512\" height=\"261\" alt=\"\"\/><img loading=\"lazy\" decoding=\"async\" src=\"blob:http:\/\/www.menglanglang.cn\/b11e6fcf-4367-41bb-a8fb-644fd320293a\" width=\"15\" height=\"15\"\/>\u200b<\/p>\n\n\n\n<p>\u539f\u56e0\u662f\u6ca1\u6709\u6307\u5b9a es \u7f51\u7edc\u914d\u7f6e\uff0c\u9700\u8981\u4fee\u6539 Elasticsearch \u7684\u914d\u7f6e\u6587\u4ef6 elasticsearch.yml\uff0c\u8be6\u7ec6\u5982\u4e0b\uff1a<\/p>\n\n\n\n<p>$ vi config\/elasticsearch.yml<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># ---------------------------------- Network -----------------------------------\n#\n# Set the bind address to a specific IP (IPv4 or IPv6):\n#\nnetwork.host: 192.168.220.242\n#\n# Set a custom port for HTTP:\n#\nhttp.port: 9200\n#\n# For more information, consult the network module documentation.\n#<\/code><\/pre>\n\n\n\n<p>\u518d\u6b21\u91cd\u542f\u670d\u52a1\uff0c\u901a\u8fc7\u6d4f\u89c8\u5668\u8bbf\u95ee&nbsp;<a href=\"http:\/\/192.168.220.242:9200\/\">http:\/\/192.168.220.242:9200\/<\/a>&nbsp;\u8fdb\u884c\u6d4b\u8bd5\uff0c\u5982\u679c\u51fa\u73b0\u5982\u4e0b\u9875\u9762\u7ed3\u679c\uff0c\u8bf4\u660e\u670d\u52a1\u90e8\u7f72\u6210\u529f\u5e76\u542f\u52a8\u6210\u529f\u4e86\u3002<\/p>\n\n\n\n<p><img loading=\"lazy\" decoding=\"async\" width=\"746\" height=\"413\" src=\"\/\/images.weserv.nl\/?url=https:\/\/img-blog.csdnimg.cn\/20200404045850439.png?x-oss-process=image\/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3R6aHV3Yg==,size_16,color_FFFFFF,t_70\" alt=\"\"\/><\/p>\n\n\n\n<p>\u76ee\u524d\u542f\u52a8\u65f6\u524d\u53f0\u542f\u52a8\u65b9\u5f0f\uff0c\u5982\u679c\u8981\u540e\u53f0\u542f\u52a8\u670d\u52a1\uff0c\u542f\u52a8\u65f6\u6dfb\u52a0 -d \u53c2\u6570\u5373\u53ef\u3002<\/p>\n\n\n\n<p>\u540e\u53f0\u542f\u52a8\uff1a$ .\/bin\/elasticsearch -d<\/p>\n\n\n\n<p>\u67e5\u770b\u8fdb\u7a0b\uff1a$ ps -ef |grep java<\/p>\n\n\n\n<p>\u8fdb\u7a0b\u4fe1\u606f\u5982\u4e0b\uff1a<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>[elastic@test242 elasticsearch-7.6.2]$ ps -ef |grep java &nbsp;&nbsp;<br \/>elastic &nbsp; &nbsp;3944 &nbsp; &nbsp; &nbsp;1 25 11:04 pts\/0 &nbsp; &nbsp;00:00:40 \/opt\/es\/elasticsearch-7.6.2\/jdk\/bin\/java -Des.networkaddress.cache.ttl=60 -Des.networkaddress.cache.negative.ttl=10 -XX:+AlwaysPreTouch -Xss1m -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djna.nosys=true -XX:-OmitStackTraceInFastThrow -Dio.netty.noUnsafe=true -Dio.netty.noKeySetOptimization=true -Dio.netty.recycler.maxCapacityPerThread=0 -Dio.netty.allocator.numDirectArenas=0 -Dlog4j.shutdownHookEnabled=false -Dlog4j2.disable.jmx=true -Djava.locale.providers=COMPAT -Xms1g -Xmx1g -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -Djava.io.tmpdir=\/tmp\/elasticsearch-17990411953466674273 -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=data -XX:ErrorFile=logs\/hs_err_pid%p.log -Xlog:gc*,gc+age=trace,safepoint:file=logs\/gc.log:utctime,pid,tags:filecount=32,filesize=64m -XX:MaxDirectMemorySize=536870912 -Des.path.home=\/opt\/es\/elasticsearch-7.6.2 -Des.path.conf=\/opt\/es\/elasticsearch-7.6.2\/config -Des.distribution.flavor=default -Des.distribution.type=tar -Des.bundled_jdk=true -cp \/opt\/es\/elasticsearch-7.6.2\/lib\/* org.elasticsearch.bootstrap.Elasticsearch -d<br \/>elastic &nbsp; &nbsp;4023 &nbsp; 3170 &nbsp;0 11:07 pts\/0 &nbsp; &nbsp;00:00:00 grep java<br \/>[elastic@test242 elasticsearch-7.6.2]$&nbsp;<\/p><\/blockquote>\n\n\n\n<p>\u539f\u6587\u94fe\u63a5\uff1a<a href=\"https:\/\/blog.csdn.net\/tzhuwb\/article\/details\/105305078\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/blog.csdn.net\/tzhuwb\/article\/details\/105305078<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u672c\u7bc7\u6587\u7ae0\u4e3b\u8981\u4ecb\u7ecd Elasticsearch 7.6.2 \u7248\u672c\u7684\u5355\u8282\u70b9\u5b89\u88c5\u3001\u542f\u52a8\u53ca\u6d4b\u8bd5\u6b65\u9aa4\uff0c\u4f9b\u521d\u5b66\u8005\u53c2\u8003\u3002\u6d4b\u8bd5 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[804],"tags":[692,693,714,877,183,214,199],"class_list":["post-4633","post","type-post","status-publish","format-standard","hentry","category-es","tag-elasticsearch","tag-es","tag-714","tag-877","tag-183","tag-214","tag-199"],"_links":{"self":[{"href":"http:\/\/www.menglanglang.cn\/index.php?rest_route=\/wp\/v2\/posts\/4633","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.menglanglang.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.menglanglang.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.menglanglang.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.menglanglang.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4633"}],"version-history":[{"count":4,"href":"http:\/\/www.menglanglang.cn\/index.php?rest_route=\/wp\/v2\/posts\/4633\/revisions"}],"predecessor-version":[{"id":4637,"href":"http:\/\/www.menglanglang.cn\/index.php?rest_route=\/wp\/v2\/posts\/4633\/revisions\/4637"}],"wp:attachment":[{"href":"http:\/\/www.menglanglang.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4633"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.menglanglang.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4633"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.menglanglang.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4633"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}