{"id":654,"date":"2023-02-26T13:46:36","date_gmt":"2023-02-26T05:46:36","guid":{"rendered":"https:\/\/www.appblog.cn\/?p=654"},"modified":"2023-04-29T18:44:28","modified_gmt":"2023-04-29T10:44:28","slug":"fast-installation-of-elasticsearch-under-centos","status":"publish","type":"post","link":"https:\/\/www.appblog.cn\/index.php\/2023\/02\/26\/fast-installation-of-elasticsearch-under-centos\/","title":{"rendered":"CentOS\u4e0bElasticSearch\u5feb\u901f\u5b89\u88c5"},"content":{"rendered":"<h2>\u5b89\u88c5ElasticSearch<\/h2>\n<pre><code>wget https:\/\/artifacts.elastic.co\/downloads\/elasticsearch\/elasticsearch-7.2.0.tar.gz\ntar -zxf elasticsearch-7.2.0.tar.gz -C \/usr\/local\/\nmv \/usr\/local\/elasticsearch-7.2.0 \/usr\/local\/elasticsearch<\/code><\/pre>\n<p><!-- more --><\/p>\n<h2>\u521b\u5efaes\u7528\u6237<\/h2>\n<pre><code>groupadd es\nuseradd -g es -M -s \/sbin\/nologin es\nchown -R es:es \/usr\/local\/elasticsearch\/\ncd \/usr\/local\/elasticsearch<\/code><\/pre>\n<h2>\u914d\u7f6e\u73af\u5883<\/h2>\n<p>\u4fee\u6539<code>config\/jvm.options<\/code>\u4e3a\u5185\u5b58\u7684\u4e00\u534a\u5927\u5c0f\uff1a<code>vim config\/jvm.options<\/code><\/p>\n<pre><code>-Xms512m\n-Xmx512m<\/code><\/pre>\n<p>\u4fee\u6539<code>max file<\/code>\u548c<code>max virtual memory<\/code>\u53c2\u6570\uff0c\u4f7f\u7528root\u6216sudo\u7528\u6237\uff1a<code>vim \/etc\/sysctl.conf<\/code>\uff0c\u6dfb\u52a0\u4e0b\u9762\u914d\u7f6e\uff1a<\/p>\n<pre><code>vm.max_map_count=655360<\/code><\/pre>\n<p>\u5e76\u6267\u884c\u547d\u4ee4\uff1a<code>sysctl -p<\/code><\/p>\n<h2>\u914d\u7f6e\u6587\u4ef6<\/h2>\n<p>\u914d\u7f6e\u7aef\u53e3\u53ca\u8de8\u57df<\/p>\n<pre><code>vim \/usr\/local\/elasticsearch-7.2.0\/config\/elasticsearch.yml<\/code><\/pre>\n<pre><code class=\"language-yml\">cluster.name: elasticsearch\nnode.name: node-1\nnetwork.host: 0.0.0.0\nhttp.port: 9200\nnode.max_local_storage_nodes: 2\nhttp.cors.enabled: true\nhttp.cors.allow-origin: &quot;*&quot;\nnode.master: true\nnode.data: true<\/code><\/pre>\n<h2>\u5b89\u88c5\u63d2\u4ef6<\/h2>\n<p>\u5207\u6362es\u7528\u6237\uff0c\u5728Elasticsearch\u4e3b\u76ee\u5f55\u4e0b\u8fd0\u884c\u4e0b\u5217\u547d\u4ee4\u6765\u5b89\u88c5\u63d2\u4ef6<\/p>\n<pre><code>su - es\nbin\/elasticsearch-plugin install xxx<\/code><\/pre>\n<h2>\u542f\u52a8ES<\/h2>\n<p>es\u7528\u6237\u542f\u52a8<\/p>\n<pre><code>\/usr\/local\/elasticsearch-7.2.0\/bin\/elasticsearch -d<\/code><\/pre>\n<p>root\u7528\u6237\u542f\u52a8<\/p>\n<pre><code>su - es -c &#039;\/usr\/local\/elasticsearch-7.2.0\/bin\/elasticsearch -d&#039;<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u5b89\u88c5ElasticSearch wget https:\/\/artifacts.elastic.co\/downl [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[180],"class_list":["post-654","post","type-post","status-publish","format-standard","hentry","category-devops-base","tag-elasticsearch"],"_links":{"self":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/654","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/comments?post=654"}],"version-history":[{"count":0,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/654\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/media?parent=654"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/categories?post=654"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/tags?post=654"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}