LoginSignup
14
13

More than 5 years have passed since last update.

Elasticsearch を Vagrant + CentOS にインストールする

Last updated at Posted at 2015-07-17

Elasticsearch を CentOS にインストールする方法は、以下のようにいくつかあります。
* 公式サイトで配布されている Zip や Tar を解凍・配置
* 公式サイトで配布されている RPM でインストール
* yum でインストールする(他記事参照

この記事では、最初の「公式サイトで配布されている Zip や Tar を解凍・配置」をやります。

環境

  • Vagrant 1.7.2
  • CentOS 6.5

インストール手順

まず、Elasticsearch を公式サイトからダウンロードし、展開・配置します(ここでは vagrantユーザーのために権限も変更しています)。

root# cd /usr/local/src
root# wget https://download.elastic.co/elasticsearch/elasticsearch
/elasticsearch-1.6.0.tar.gz
root# cd /usr/local
root# tar zxf src/elasticsearch-1.6.0.tar.gz
root# chown -R vagrant elasticsearch-1.6.0
root# ln -s elasticsearch-1.6.0 elasticsearch

Elasticsearch のパスを登録します。

vagrant$ vi ~/.zshrc
  PATH=$PATH:/usr/local/elasticsearch/bin

シェルの設定ファイルを再度読み込み、elasticsearch を起動します。

vagrant$ source ~/.zshrc
vagrant$ elasticsearch

Kuromojiプラグインを入れる場合

Github の Kuromoji のリポジトリで、インストールした Elastic のバージョンに合う Kuromoji のバージョンを調べてから、以下のようにインストールします。

root# /usr/local/elasticsearch/bin/plugin --install elasticsearch/elasticsearch-analysis-kuromoji/2.6.0

ブラウザから Elasticsearch の状態を確認する

Github の elasticsearch-head のリポジトリの手順に従ってプラグインをインストールします。

root# /usr/local/elasticsearch/bin/plugin -install mobz/elasticsearch-head

その後、http://localhost:9200/_plugin/head/ を開きます(Elasticsearch を 9200番で動かしている場合)。

参考

14
13
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
14
13