Elasticsearchをインストールする

この辺りを参考にしてインストールしてみる。
dstat + fluentd + Elasticsearch + kibana でサーバモニタリングする - blog.nomadscafe.jp
Fluentd + Elasticsearch +Kibanaを導入したので手順をメモ - まっしろけっけ

とりあえずdstatのインストール

$ sudo yum install dstat

rpmでElasticsearchをインストールして、起動。

$ sudo rpm -Uvh https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.4.2.noarch.rpm
Retrieving https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.4.2.noarch.rpm
Preparing... ########################################### [100%]
1:elasticsearch ########################################### [100%]
### NOT starting on installation, please execute the following statements to configure elasticsearch to start automatically using chkconfig
sudo /sbin/chkconfig --add elasticsearch
### You can start elasticsearch by executing
sudo service elasticsearch start
$ sudo service elasticsearch start
Starting elasticsearch: [ OK ]

Nginxをyumでインストールして、起動。

$ sudo yum -y install nginx

/** インストールのメッセージが色々 */

Installed:
nginx.x86_64 0:1.0.15-11.el6

Dependency Installed:
GeoIP.x86_64 0:1.5.1-5.el6 gd.x86_64 0:2.0.35-11.el6 nginx-filesystem.noarch 0:1.0.15-11.el6

Complete!

$ sudo service nginx start
Starting nginx: [ OK ]

この方法でインストールした時のNginxのドキュメントルート

$ ll /usr/share/nginx/html/
total 20

  • rw-r--r-- 1 root root 3652 Nov 11 16:27 404.html
  • rw-r--r-- 1 root root 3695 Nov 11 16:27 50x.html
  • rw-r--r-- 1 root root 3698 Nov 11 16:27 index.html
  • rw-r--r-- 1 root root 370 Nov 11 16:27 nginx-logo.png
  • rw-r--r-- 1 root root 3034 Nov 11 16:27 poweredby.png

kibanaを入れる

$ cd
$ mkdir kibana
$ cd kibana
$ wget https://download.elasticsearch.org/kibana/kibana/kibana-3.1.2.tar.gz
$ tar xvzf kibana-3.1.2.tar.gz
$ mv kibana-3.1.2 /usr/share/nginx/html/kibana
mv: cannot move `kibana-3.1.2' to `/usr/share/nginx/html/kibana': Permission denied

お?

$ ll /usr/share/nginx/html/
total 20

  • rw-r--r-- 1 root root 3652 Nov 11 16:27 404.html
  • rw-r--r-- 1 root root 3695 Nov 11 16:27 50x.html
  • rw-r--r-- 1 root root 3698 Nov 11 16:27 index.html
  • rw-r--r-- 1 root root 370 Nov 11 16:27 nginx-logo.png
  • rw-r--r-- 1 root root 3034 Nov 11 16:27 poweredby.png

Nginxの設定が分かっていないな。
デフォルトのドキュメントルートはroot権限になっている。
これは別のドキュメントルートディレクトリを作って管理してね、という意味なのか?

ここで時間切れ。
後で↓を読む。
http://henteco-labs.com/labs/2014/04/14/rails-nginx/