16
17

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Elasticsearch + Kibana with Nginx 構築備忘

Last updated at Posted at 2014-08-28

手順忘れるので。時間できたらansibleのplaybookにしようかなー。dockerにあったのは設定よくわかんなかった。

セットアップ

elasticserach

ダウンロード

# wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.3.2.tar.gz
# tar zxf elasticsearch-1.3.2.tar.gz
# mv elasticsearch-1.3.2 /opt/elasticsearch

設定。とりあえずこれだけでもOK。

# vim /opt/elasticsearch/config/elasticsearch.yml

index.number_of_replicas: 0
index.number_of_shards: 1
path.data: /data
path.logs: /var/log/elasticsearch/logs

起動

/opt/elasticsearch/bin/elasticsearch -d

Kibana

ダウンロード

# wget https://download.elasticsearch.org/kibana/kibana/kibana-3.1.0.tar.gz
# tar zxf kibana-3.1.0.tar.gz
# mv kibana-3.1.0 /opt/kibana

設定を編集

vim /opt/kibana/config.js

elasticsearch: "http://{elasticsearchのIP}:{elasticsearchのport}",

nginx

※この後行うnginxのmakeでエラーになったら、以下が必要(環境による)。事前にyum list等で確認しておくといいかも。

# yum -y install pcre-devel
# yum -y install gd-devel

ダウンロードとインストール

# wget http://nginx.org/download/nginx-1.5.10.tar.gz
# tar zxf nginx-1.5.10.tar.gz
# cd nginx-1.5.10
# ./configure
# make
# make install

設定。serverディレクレィブを書き換える。

  server {
    listen *:80;
    server_name localhost;
    access_log /var/log/nginx/access.log;

    location / {
      root /opt/kibana/;
      index index.html index.htm;
    }
  }

起動

# /usr/local/nginx/sbin/nginx

アクセス

以下にアクセスでKibanaのトップページが見れるはず。

http://{nginxのIP}:{nginxのport}

うまく表示されない場合は、chromeのconsole等でエラー出て無いか見るといいかも。

16
17
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
16
17

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?