{"id":653,"date":"2023-02-26T13:45:33","date_gmt":"2023-02-26T05:45:33","guid":{"rendered":"https:\/\/www.appblog.cn\/?p=653"},"modified":"2023-04-29T18:44:39","modified_gmt":"2023-04-29T10:44:39","slug":"install-and-config-elasticsearch-using-yum","status":"publish","type":"post","link":"https:\/\/www.appblog.cn\/index.php\/2023\/02\/26\/install-and-config-elasticsearch-using-yum\/","title":{"rendered":"\u4f7f\u7528yum\u5b89\u88c5\u914d\u7f6eElasticSearch"},"content":{"rendered":"<h2>\u5b89\u88c5<\/h2>\n<pre><code class=\"language-bash\">vim \/etc\/yum.repos.d\/elasticsearch.repo<\/code><\/pre>\n<pre><code>[elasticsearch]  \nname=Elasticsearch repository for 7.x packages  \nbaseurl=https:\/\/artifacts.elastic.co\/packages\/7.x\/yum  \ngpgcheck=1  \ngpgkey=https:\/\/artifacts.elastic.co\/GPG-KEY-elasticsearch  \nenabled=0  \nautorefresh=1  \ntype=rpm-md<\/code><\/pre>\n<p><!-- more --><\/p>\n<pre><code class=\"language-bash\">yum install --enablerepo=elasticsearch elasticsearch<\/code><\/pre>\n<h2>\u914d\u7f6e<\/h2>\n<pre><code class=\"language-bash\">vim \/etc\/elasticsearch\/elasticsearch.yml<\/code><\/pre>\n<pre><code>[cluster.name](http:\/\/cluster.name\/): my-application  \n[node.name](http:\/\/node.name\/): node-1  \npath.data: \/var\/lib\/elasticsearch  \npath.logs: \/var\/log\/elasticsearch  \nnetwork.host: 127.0.0.1  \nhttp.port: 9200<\/code><\/pre>\n<h2>\u542f\u52a8<\/h2>\n<p>ElasticSearch\u4e0d\u5141\u8bb8root\u7528\u6237\u6267\u884c\uff0c\u65b0\u5efa\u5206\u7ec4es\u548c\u7528\u6237es\uff0c\u7528\u4e8e\u6267\u884cElasticSearch<\/p>\n<pre><code class=\"language-bash\">groupadd es\nuseradd -g es es<\/code><\/pre>\n<p>\u4fee\u6539owner<\/p>\n<pre><code class=\"language-bash\">chown -R es.es \/usr\/share\/elasticsearch \/var\/lib\/elasticsearch \/var\/log\/elasticsearch \/etc\/sysconfig\/elasticsearch \/etc\/elasticsearch<\/code><\/pre>\n<p>\u5207\u6362\u5230es\u7528\u6237\uff0c\u7136\u540e\u542f\u52a8Elasticsearch<\/p>\n<pre><code class=\"language-bash\">su es\n\/usr\/share\/elasticsearch\/bin\/elasticsearch<\/code><\/pre>\n<p>\u9a8c\u8bc1<\/p>\n<pre><code class=\"language-bash\">curl -XGET &#039;127.0.0.1:9200\/_cat\/health?v&amp;pretty&#039;<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u5b89\u88c5 vim \/etc\/yum.repos.d\/elasticsearch.repo [elasticsear [&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-653","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\/653","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=653"}],"version-history":[{"count":0,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/653\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/media?parent=653"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/categories?post=653"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/tags?post=653"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}