構成

INDEXRDBのDatabaseに相当。この単位でSHADE数が決まるので、更新頻度が違うものはINDEXを分ける
シャードインデックスを何分割するか?作成時のみしか指定できず
DOCUMENTRDBの1レコード
FIELD列定義
CLUSTERNODEの集合
NODEESの1プロセス
RDBElasticsearch
DatabasesIndices
TablesTypes
RowsDocuments
FieldsColumns

AWS Elasticserach Service

Elastic Cloud(旧Found)

運用

本番環境向け推奨マシンスペック

実験用途で2GBのマシンに入れたが、結構な割合でOomKillerを発動させたり、落ちてたりする。

設定

JVM1GB以上推奨。最小と最大を同じにしておく。
File Descriptors65535
mmaprpmであれば変更済みとなる
swapdisable swap(swapoff -a)

投入までの流れ

  1. INDEX作成(curl -XPUT "${ES_URL}/${INDEX_NAME}")
  2. 検索で使う型を定義するmappingをJSONで指定(curl -XPUT "${ES_URL}/${INDEX_NAME}/_mapping/default" -d @${MAPPING_FILE})

クラスターの可視化

インストール後以下のURLで参照可能。

http://133.18.30.106:9200/_plugin/head/

プラグインインストール

yumの場合はコマンドは以下の場所にある

/usr/share/elasticsearch/bin

plugin install プラグイン名
# kuromojiインストール
/usr/share/elasticsearch/bin/plugin install analysis-kuromoji
# watcherのためのライセンスプラグイン
/usr/share/elasticsearch/bin/plugin install elasticsearch/license/latest
# watcher
/usr/share/elasticsearch/bin/plugin install elasticsearch/watcher/latest
# bigdisk
/usr/share/elasticsearch/bin/plugin install lukas-vlcek/bigdesk

アラート

無料ならelastalert(Yelp開発)。有料ならWatcher(サブスクリプション契約必要)

https://github.com/Yelp/elastalert

情報

パフォーマンスチューニングの注意点

http://qiita.com/rjkuro/items/e79eec7ffb0511b7c678

td-agentとの連携

/opt/td-agent/embedded/bin/fluent-gem install fluent-plugin-elasticsearch

Elasticsearch 2.2

デフォルトはローカルからのみ接続可能なので、以下の変更を入れる。

Kibana4.4

解凍して、host変えて、起動して5601ポートでアクセス。

Beats

エージェント型だが、マシンの情報を定期的に送ってくれる上にダッシュボードのテンプレートも併せて提供されている。

トラブルシューティング

fluentd + ElasticSearchServiceで時折「Cannot get new connection from pool」

運用履歴

Kagoya 2G

限界ぎりぎりまでメモリを使う。何もしてなくても自然に落ちるという・・

Apr 27 02:19:53 v9215 elasticsearch: # There is insufficient memory for the Java Runtime Environment to continue. Apr 28 09:11:22 v9215 elasticsearch: # There is insufficient memory for the Java Runtime Environment to continue. Apr 28 13:01:44 v9215 elasticsearch: # There is insufficient memory for the Java Runtime Environment to continue.


トップ   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS