Skip to content

Instantly share code, notes, and snippets.

@hagihala
Last active December 3, 2016 20:21
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hagihala/754e4e721549561b15ed09840419b2c1 to your computer and use it in GitHub Desktop.
Save hagihala/754e4e721549561b15ed09840419b2c1 to your computer and use it in GitHub Desktop.

Elasticsearch 5.0 での変更点

変更点は以下にまとまっている:

https://www.elastic.co/guide/en/elasticsearch/reference/5.0/breaking-changes.html

以下ではとりあえず Es 5.0.0-rc1 のクラスタを立てる上で詰まった or 気になった箇所を中心にメモるので、内容にはだいぶ偏りがある。

網羅的に知りたければ上の reference を読めばいい。

プラグイン関連

https://www.elastic.co/guide/en/elasticsearch/reference/5.0/breaking_50_plugins.html

プラグイン管理コマンド pluginelasticsearch-plugin にリネームされた

コマンド体系や機能は Es2 の時から大きな変更は無し?

cloud-aws プラグインが2つに分割された

以下の2つに。

  • discovery-ec2

  • repository-s3

なんか以前からそう言う話はあった気がする。

kopf は cerebro という名前のスタンドアロンアプリケーションになった

Scala (Play framework) ベースになった。

設定関連

https://www.elastic.co/guide/en/elasticsearch/reference/5.0/breaking_50_settings_changes.html

変な設定が入っていればちゃんと怒ってエラー終了するので、新しい設定への移行が素早く進む (スタックトレースが出るのでログは見づらいけど)。また、deprecation log というのも出ていて嬉しい。

elasticsearch.yml に index 設定とか書けなくなった

以下のようなログ。

*************************************************************************************
Found index level settings on node level configuration.

Since elasticsearch 5.x index level settings can NOT be set on the nodes
configuration like the elasticsearch.yaml, in system properties or command line
arguments.In order to upgrade all indices the settings must be updated via the
/${index}/_settings API. Unless all settings are dynamic all indices must be closed
in order to apply the upgradeIndices created in the future should use index templates
to set default values.

Please ensure all required values are updated on all indices by executing:

curl -XPUT 'http://localhost:9200/_all/_settings?preserve_existing=true' -d '{
  "index.indexing.slowlog.threshold.index.info" : "1s",
  "index.indexing.slowlog.threshold.index.trace" : "100ms",
  "index.indexing.slowlog.threshold.index.warn" : "5s",
  "index.mapper.dynamic" : "false",
  "index.number_of_replicas" : "1",
  "index.number_of_shards" : "1",
  "index.query.parse.allow_unmapped_fields" : "false",
  "index.refresh_interval" : "5s",
  "index.search.slowlog.threshold.fetch.info" : "1s",
  "index.search.slowlog.threshold.fetch.trace" : "100ms",
  "index.search.slowlog.threshold.fetch.warn" : "5s",
  "index.search.slowlog.threshold.query.info" : "1s",
  "index.search.slowlog.threshold.query.trace" : "100ms",
  "index.search.slowlog.threshold.query.warn" : "5s"
}'
*************************************************************************************

index 作成時に全て設定するか、作成時に自動で設定したければ index template に全部書いておけってことか。 index template と役割がかぶってた感あるし当然の流れかも知れない。

bootstrap.mlockall が bootstrap.memory_lock にリネームされた

https://www.elastic.co/guide/en/elasticsearch/reference/5.0/_script_settings.html#_memory_lock_settings

bootstrap check とかいうのが走る

スタンドアロンじゃないホストの場合はいくつかの設定が強制されるということ?

[2016-10-21T04:19:28,713][INFO ][o.e.t.TransportService   ] [some_host] publish_address {10.1.15.0:9300}, bound_addresses {[::]:9300}
[2016-10-21T04:19:28,723][INFO ][o.e.b.BootstrapCheck     ] [some_host] bound or publishing to a non-loopback or non-link-local address, enforcing bootstrap checks
[2016-10-21T04:19:28,728][ERROR][o.e.b.Bootstrap          ] [some_host] node validation exception
bootstrap checks failed
max virtual memory areas vm.max_map_count [65530] likely too low, increase to at least [262144]

vm.max_map_count が少ないとか言われる。 sysctl パラメータ。

パッケージ関連

ES_HEAP_SIZE など幾つかの環境変数廃止

起動時に怒られ、即終了してくれるので嬉しい。全部 ES_JAVA_OPTS に書けということ。裏で Java オプション設定してただけなのでまあ当然か。

Mapping 関連

https://www.elastic.co/guide/en/elasticsearch/reference/5.0/breaking_50_mapping_changes.html

stringtextkeyword に置きかえられた

analyze されるのが text 、されないのが keyword というくらいの認識でよさそう。

移行のための措置として、 2.x からアップグレードしてきた index では string が使えて、5.0 以降で新しく作る index では使えないようになっている。

他プロダクト

Kibana は apt リポジトリでも提供されるようになった

Kibana 以外の Elastic Stack プロダクトについてもそうかもしれない。

deb パッケージなので簡単にインストールできる。

独立したサービスとして動作し、 SysV init または systemd で管理される。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment