さくさくっとElasticsearchをcentos6.xに入れるメモ


Elasticsearch INSTALL

以下の内容を自分用にメモ
https://www.elastic.co/guide/en/elasticsearch/reference/current/setup-repositories.html

JAVA入れる


# パッケージ検索
yum search openjdk
# install
yum install -y java-1.X.X-openjdk.x86_64
# 確認
java -version

Elasticsearch 入れる


rpm --import https://packages.elastic.co/GPG-KEY-elasticsearch

cat  << EOS > /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
EOS

yum install -y elasticsearch

/etc/init.d/elasticsearch start

chkconfig --add elasticsearch

Elasticsearch 設定


vim /etc/elasticsearch/elasticsearch.yml
++ network.host: 192.168.0.XXX

http://192.168.5.191:9200/
にアクセスして


{
  "name" : "Hussar",
  "cluster_name" : "elasticsearch",
  "version" : {
    "number" : "2.2.1",
    "build_hash" : "d045fc29d1932bce18b2e65ab8b297fbf6cd41a1",
    "build_timestamp" : "2016-03-09T09:38:54Z",
    "build_snapshot" : false,
    "lucene_version" : "5.4.1"
  },
  "tagline" : "You Know, for Search"
}

と出ることを確認

その他

データとかログは、デフォでは下記にある模様

  • /usr/share/elasticsearch
  • logs /var/log/elasticsearch
  • data /var/lib/elasticsearch
  • conf /etc/elasticsearch