{"id":40854,"date":"2023-10-26T06:48:32","date_gmt":"2023-06-14T10:21:58","guid":{"rendered":"https:\/\/www.silicloud.com\/zh\/blog\/%e9%80%9a%e8%bf%87yum%e6%9d%a5%e8%ae%be%e7%bd%aeelasticsearch%e3%80%82\/"},"modified":"2024-01-15T10:47:33","modified_gmt":"2024-01-15T02:47:33","slug":"%e9%80%9a%e8%bf%87yum%e6%9d%a5%e8%ae%be%e7%bd%aeelasticsearch%e3%80%82","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/zh\/blog\/%e9%80%9a%e8%bf%87yum%e6%9d%a5%e8%ae%be%e7%bd%aeelasticsearch%e3%80%82\/","title":{"rendered":"\u901a\u8fc7Yum\u6765\u8bbe\u7f6eElasticsearch"},"content":{"rendered":"<p>\u5907\u5fd8\u5f55<\/p>\n<p>\u3010\u64cd\u4f5c\u7cfb\u7edf\u3011<br \/>\n\u672c\u6b21\u4f7f\u7528\u7684\u662fCentOS6.6_x86_64\u7248\u672c\u3002\u8be6\u60c5\u8bf7\u53c2\u8003\u4ee5\u4e0b\u94fe\u63a5\u3002<br \/>\nhttp:\/\/centos.server-manual.com\/<br \/>\n\u9884\u5148\u51c6\u5907<br \/>\n\u9700\u8981\u9884\u5148\u8bbe\u7f6e\u6240\u9700\u7684\u5b89\u88c5\u5305\u3002\u8bf7\u8bbe\u7f6e\u4ee5\u4e0b\u5168\u90e8\u5185\u5bb9\u3002<br \/>\n\u7531\u4e8e\u4f1a\u6709\u7cfb\u7edf\u53d8\u66f4\uff0c\u56e0\u6b64\u9700\u8981\u7ba1\u7406\u5458\u6743\u9650\u3002\u8bf7\u4ee5root\u7528\u6237\u8fdb\u884csu\u64cd\u4f5c\u3002<\/p>\n<p>\u3010YUM\u5305\u7ba1\u7406\u3011<br \/>\nyum -y\u5b89\u88c5yum-plugin-fastestmirror<br \/>\nyum -y\u66f4\u65b0<br \/>\nyum -y groupinstall &#8220;Base&#8221; &#8220;\u5f00\u53d1\u5de5\u5177&#8221; &#8220;\u65e5\u6587\u652f\u6301&#8221;<br \/>\n\u3010\u6dfb\u52a0RPMforge\u5b58\u50a8\u5e93\u3011<br \/>\nrpm &#8211;import http:\/\/apt.sw.be\/RPM-GPG-KEY.dag.txt<br \/>\nrpm -ivh http:\/\/apt.sw.be\/redhat\/el6\/en\/x86_64\/rpmforge\/RPMS\/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm<br \/>\n\u3010\u6dfb\u52a0EPEL\u5b58\u50a8\u5e93\u3011<br \/>\nrpm &#8211;import http:\/\/dl.fedoraproject.org\/pub\/epel\/RPM-GPG-KEY-EPEL-6<br \/>\nrpm -ivh http:\/\/dl.fedoraproject.org\/pub\/epel\/6\/x86_64\/epel-release-6-8.noarch.rpm<br \/>\n\u3010\u6dfb\u52a0ELRepo\u5b58\u50a8\u5e93\u3011<br \/>\nrpm &#8211;import https:\/\/www.elrepo.org\/RPM-GPG-KEY-elrepo.org<br \/>\nrpm -Uvh http:\/\/www.elrepo.org\/elrepo-release-6-6.el6.elrepo.noarch.rpm<br \/>\n\u3010\u6dfb\u52a0Remi\u5b58\u50a8\u5e93\u3011<br \/>\nrpm &#8211;import http:\/\/rpms.famillecollet.com\/RPM-GPG-KEY-remi<br \/>\nrpm -ivh http:\/\/rpms.famillecollet.com\/enterprise\/remi-release-6.rpm<\/p>\n<p>\u3010\u7981\u7528SELinux\u3011<br \/>\ngetenforce<br \/>\n\u5f37\u5236\u6267\u884c \u2190 SELinux\u542f\u7528<br \/>\nsetenforce 0<br \/>\ngetenforce<br \/>\n\u5bbd\u5bb9\u6001 \u2190 SELinux\u7981\u7528<br \/>\nvi \/etc\/sysconfig\/selinux<br \/>\nSELINUX=enforcing<br \/>\nSELINUX=disabled \u2190 \u4fee\u6539\uff08\u5f00\u673a\u7981\u7528\uff09<\/p>\n<p>\u5141\u8bb8HTTP\u901a\u8fc7iptables:<br \/>\nvi \/etc\/sysconfig\/iptables<br \/>\n-A INPUT -m state &#8211;state NEW -m tcp -p tcp &#8211;dport 22 -j ACCEPT<br \/>\n-A INPUT -m state &#8211;state NEW -m tcp -p tcp &#8211;dport 9200 -j ACCEPT \u2190\u6dfb\u52a0<br \/>\n-A INPUT -j REJECT &#8211;reject-with icmp-host-prohibited<br \/>\n-A FORWARD -j REJECT &#8211;reject-with icmp-host-prohibited<br \/>\nCOMMIT<br \/>\n\u91cd\u65b0\u542f\u52a8Iptables:<br \/>\nservice iptables restart<\/p>\n<p>\u3010JAVA\u3011<br \/>\n\u5728CentOS\u69cb\u5efa\u6642\uff0c\u5378\u8f09\u9ed8\u8a8d\u5b89\u88dd\u7684\u7248\u672c\u3002<br \/>\nyum erase java*<br \/>\n\u5f9e\u7db2\u4e0a\u7372\u53d6\u6700\u65b0\u7248\u672c\uff08rpm\u7248\uff09\u4e26\u5b89\u88dd\u3002<br \/>\nrpm \u2013ivh jdk-8u45-linux-x64.rpm<br \/>\n\u7248\u672c\u78ba\u8a8d<br \/>\njava \u2013version<br \/>\njava version &#8220;1.8.0_45&#8221;<br \/>\nJava(TM) SE Runtime Environment (build 1.8.0_45-b14)<br \/>\nJava HotSpot(TM) 64-Bit Server VM (build 25.45-b02, \u6df7\u5408\u6a21\u5f0f)<br \/>\n\u25a0\u8a2d\u7f6eJAVA_HOME<br \/>\nvi \/etc\/profile<\/p>\n<pre class=\"post-pre\"><code>\r\nexport JAVA_HOME=\/usr\/java\/default\r\nexport PATH=$PATH:$JAVA_HOME\/bin\r\nexport CLASSPATH=.:$JAVA_HOME\/jre\/lib:$JAVA_HOME\/lib:$JAVA_HOME\/lib\/tools.jar\r\n<\/code><\/pre>\n<p>\u3010Elasticsearch\u3011<br \/>\n\u25a0\u521b\u5efa\u5b58\u50a8\u5e93<br \/>\nrpm &#8211;import https:\/\/packages.elastic.co\/GPG-KEY-elasticsearch<br \/>\nvi \/etc\/yum.repos.d\/elasticsearch.repo<br \/>\n[elasticsearch-1.6]<br \/>\nname=\u7528\u4e8e1.6.x\u8f6f\u4ef6\u5305\u7684Elasticsearch\u5b58\u50a8\u5e93<br \/>\nbaseurl=http:\/\/packages.elastic.co\/elasticsearch\/1.6\/centos<br \/>\ngpgcheck=1<br \/>\ngpgkey=http:\/\/packages.elastic.co\/GPG-KEY-elasticsearch<br \/>\nenabled=1<br \/>\n\u25a0\u5b89\u88c5\u548c\u542f\u52a8<br \/>\nyum install elasticsearch<br \/>\nservice elasticsearch start<br \/>\nchkconfig elasticsearch on<br \/>\n\u25a0\u786e\u8ba4<br \/>\ncurl &#8216;localhost:9200\/_cat\/health?v&#8217;<\/p>\n<pre class=\"post-pre\"><code>epoch      timestamp cluster       status node.total node.data shards pri relo init unassign\r\n1436159102 14:05:02  elasticsearch green           1         1      0   0    0    0        0<\/code><\/pre>\n<p>\u3010kuromoji\u3011<br \/>\n\u4e3a\u4e86\u4f7f\u65e5\u8bed\u80fd\u591f\u641c\u7d22\uff0c\u60a8\u9700\u8981\u5b89\u88c5\u548c\u8bbe\u7f6ekuromoji\u3002<br \/>\n\u6700\u65b0\u7248\u672c\u53ef\u5728https:\/\/github.com\/elastic\/elasticsearch-analysis-kuromoji\u4e0b\u8f7d\u3002<br \/>\n\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<br \/>\ncd \/usr\/share\/elasticsearch<br \/>\nbin\/plugin &#8211;install elasticsearch\/elasticsearch-analysis-kuromoji\/2.6.0<\/p>\n<p>\u6253\u5f00\/etc\/elasticsearch\/elasticsearch.yml\u6587\u4ef6\uff0c\u627e\u5230index.analysis.analyzer.default.type\u8fd9\u4e00\u884c\uff0c\u5e76\u5c06\u5176\u4fee\u6539\u4e3acustom\u3002\u63a5\u7740\u627e\u5230index.analysis.analyzer.default.tokenizer\u8fd9\u4e00\u884c\uff0c\u5e76\u5c06\u5176\u4fee\u6539\u4e3akuromoji_tokenizer\u3002<\/p>\n<p>\u91cd\u65b0\u542f\u52a8elasticsearch\u670d\u52a1<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5907\u5fd8\u5f55 \u3010\u64cd\u4f5c\u7cfb\u7edf\u3011 \u672c\u6b21\u4f7f\u7528\u7684\u662fCentOS6.6_x86_64\u7248\u672c\u3002\u8be6\u60c5\u8bf7\u53c2\u8003\u4ee5\u4e0b\u94fe\u63a5\u3002 http:\/\/c [&hellip;]<\/p>\n","protected":false},"author":10,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-40854","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u901a\u8fc7Yum\u6765\u8bbe\u7f6eElasticsearch - Blog - Silicon Cloud<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.silicloud.com\/zh\/blog\/\u901a\u8fc7yum\u6765\u8bbe\u7f6eelasticsearch\u3002\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u901a\u8fc7Yum\u6765\u8bbe\u7f6eElasticsearch\" \/>\n<meta property=\"og:description\" content=\"\u5907\u5fd8\u5f55 \u3010\u64cd\u4f5c\u7cfb\u7edf\u3011 \u672c\u6b21\u4f7f\u7528\u7684\u662fCentOS6.6_x86_64\u7248\u672c\u3002\u8be6\u60c5\u8bf7\u53c2\u8003\u4ee5\u4e0b\u94fe\u63a5\u3002 http:\/\/c [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/zh\/blog\/\u901a\u8fc7yum\u6765\u8bbe\u7f6eelasticsearch\u3002\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2023-06-14T10:21:58+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-01-15T02:47:33+00:00\" \/>\n<meta name=\"author\" content=\"\u5b87, \u534e\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u5b87, \u534e\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e9%80%9a%e8%bf%87yum%e6%9d%a5%e8%ae%be%e7%bd%aeelasticsearch%e3%80%82\/\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e9%80%9a%e8%bf%87yum%e6%9d%a5%e8%ae%be%e7%bd%aeelasticsearch%e3%80%82\/\",\"name\":\"\u901a\u8fc7Yum\u6765\u8bbe\u7f6eElasticsearch - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\"},\"datePublished\":\"2023-06-14T10:21:58+00:00\",\"dateModified\":\"2024-01-15T02:47:33+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/513018e4e121d3add1b7c5de8be21458\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e9%80%9a%e8%bf%87yum%e6%9d%a5%e8%ae%be%e7%bd%aeelasticsearch%e3%80%82\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/zh\/blog\/%e9%80%9a%e8%bf%87yum%e6%9d%a5%e8%ae%be%e7%bd%aeelasticsearch%e3%80%82\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e9%80%9a%e8%bf%87yum%e6%9d%a5%e8%ae%be%e7%bd%aeelasticsearch%e3%80%82\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/zh\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u901a\u8fc7Yum\u6765\u8bbe\u7f6eElasticsearch\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/\",\"name\":\"Blog - Silicon Cloud\",\"description\":\"\",\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/513018e4e121d3add1b7c5de8be21458\",\"name\":\"\u5b87, \u534e\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/63cd45cbc05a35fc4ff7637a163c83c4962ef58d27472726c3a3e0c9c5194f0f?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/63cd45cbc05a35fc4ff7637a163c83c4962ef58d27472726c3a3e0c9c5194f0f?s=96&d=mm&r=g\",\"caption\":\"\u5b87, \u534e\"},\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/author\/yuhua\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e9%80%9a%e8%bf%87yum%e6%9d%a5%e8%ae%be%e7%bd%aeelasticsearch%e3%80%82\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"\u901a\u8fc7Yum\u6765\u8bbe\u7f6eElasticsearch - Blog - Silicon Cloud","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.silicloud.com\/zh\/blog\/\u901a\u8fc7yum\u6765\u8bbe\u7f6eelasticsearch\u3002\/","og_locale":"zh_CN","og_type":"article","og_title":"\u901a\u8fc7Yum\u6765\u8bbe\u7f6eElasticsearch","og_description":"\u5907\u5fd8\u5f55 \u3010\u64cd\u4f5c\u7cfb\u7edf\u3011 \u672c\u6b21\u4f7f\u7528\u7684\u662fCentOS6.6_x86_64\u7248\u672c\u3002\u8be6\u60c5\u8bf7\u53c2\u8003\u4ee5\u4e0b\u94fe\u63a5\u3002 http:\/\/c [&hellip;]","og_url":"https:\/\/www.silicloud.com\/zh\/blog\/\u901a\u8fc7yum\u6765\u8bbe\u7f6eelasticsearch\u3002\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2023-06-14T10:21:58+00:00","article_modified_time":"2024-01-15T02:47:33+00:00","author":"\u5b87, \u534e","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"\u5b87, \u534e","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e9%80%9a%e8%bf%87yum%e6%9d%a5%e8%ae%be%e7%bd%aeelasticsearch%e3%80%82\/","url":"https:\/\/www.silicloud.com\/zh\/blog\/%e9%80%9a%e8%bf%87yum%e6%9d%a5%e8%ae%be%e7%bd%aeelasticsearch%e3%80%82\/","name":"\u901a\u8fc7Yum\u6765\u8bbe\u7f6eElasticsearch - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website"},"datePublished":"2023-06-14T10:21:58+00:00","dateModified":"2024-01-15T02:47:33+00:00","author":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/513018e4e121d3add1b7c5de8be21458"},"breadcrumb":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e9%80%9a%e8%bf%87yum%e6%9d%a5%e8%ae%be%e7%bd%aeelasticsearch%e3%80%82\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/zh\/blog\/%e9%80%9a%e8%bf%87yum%e6%9d%a5%e8%ae%be%e7%bd%aeelasticsearch%e3%80%82\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e9%80%9a%e8%bf%87yum%e6%9d%a5%e8%ae%be%e7%bd%aeelasticsearch%e3%80%82\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/zh\/blog\/"},{"@type":"ListItem","position":2,"name":"\u901a\u8fc7Yum\u6765\u8bbe\u7f6eElasticsearch"}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website","url":"https:\/\/www.silicloud.com\/zh\/blog\/","name":"Blog - Silicon Cloud","description":"","inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/513018e4e121d3add1b7c5de8be21458","name":"\u5b87, \u534e","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/63cd45cbc05a35fc4ff7637a163c83c4962ef58d27472726c3a3e0c9c5194f0f?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/63cd45cbc05a35fc4ff7637a163c83c4962ef58d27472726c3a3e0c9c5194f0f?s=96&d=mm&r=g","caption":"\u5b87, \u534e"},"url":"https:\/\/www.silicloud.com\/zh\/blog\/author\/yuhua\/"},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e9%80%9a%e8%bf%87yum%e6%9d%a5%e8%ae%be%e7%bd%aeelasticsearch%e3%80%82\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/40854","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/comments?post=40854"}],"version-history":[{"count":2,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/40854\/revisions"}],"predecessor-version":[{"id":58760,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/40854\/revisions\/58760"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/media?parent=40854"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/categories?post=40854"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/tags?post=40854"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}