Centos 6.4 yum安装最新版本elasticsearch

前端之家收集整理的这篇文章主要介绍了Centos 6.4 yum安装最新版本elasticsearch前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
下载安装签名证书
[root@sa ~]#rpm --import https://packages.elastic.co/GPG-KEY-elasticsearch


创建repo文件

[root@sa ~]#vim /etc/yum.repos.d/elasticsearch.repo
[elasticsearch-2.x]
name=Elasticsearch repository for 2.x packages
baseurl=https://packages.elastic.co/elasticsearch/2.x/centos
gpgcheck=1
gpgkey=https://packages.elastic.co/GPG-KEY-elasticsearch
enabled=1


yum安装ES

[root@sa ~]#yum install elasticsearch -y


启动ES
[root@sa ~]#service elasticsearch start


PS:我在运行的时候发生的报错,如下:

which: no java in (/sbin:/usr/sbin:/bin:/usr/bin)
Could not find any executable java binary. Please install java in your PATH or set JAVA_HOME

但是我的java配置都是正确的:

[root@sa ~]# java -version
java version "1.8.0_65"
Java(TM) SE Runtime Environment (build 1.8.0_65-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.65-b01,mixed mode)
[root@sa ~]# echo $JAVA_HOME
/usr/java/jdk1.8.0_65

没办法,做个链接解决了问题。

[root@sa ~]# ln -s /usr/java/jdk1.8.0_65/bin/java /usr/bin/java

[root@sa ~]# vim /etc/elasticsearch/elasticsearch.yml

修改54行代码,改为本机IP.

54 network.host: IP地址

访问一下:http://IP地址:9200/

{
  "name" : "Geiger","cluster_name" : "elasticsearch","version" : {
    "number" : "2.3.4","build_hash" : "e455fd0c13dceca8dbbdbb1665d068ae55dabe3f","build_timestamp" : "2016-06-30T11:24:31Z","build_snapshot" : false,"lucene_version" : "5.5.0"
  },"tagline" : "You Know,for Search"
}


默认安装目录为:/usr/share/elasticsearch/

默认配置目录为:/etc/elasticsearch/


ok,搞定!

猜你在找的CentOS相关文章