とりあえず、まぁ

かけだしインフラエンジニアの日々のまとめや趣味のことを書いていきます。

Elasticsearchを2系から6系にバージョンupしようとした話

今回もelasticsearch系の話を軽くしようと思います。

会社で使っているESが2系、kibanaが4系でしたので、 バーションアップをしようとしました。

現状、2系のほうは使っているため、6系を新しく構築しようという話になり、 構築し、ログも問題なくESに入れていました。

ある日、visualizeを作るぞと意気込んで、4系のkibanaからエクスポートして、 6系にインポートしましたが、うまく表示できませんでした。

原因は String 型の廃止

5.xからはtext, keywordという新しい2つの文字列型が導入され、明確に区別しています。

これが知らなかったので、色々と痛い目にあったというか、結局ぽちぽち作る羽目になったという

www.elastic.co

Perform a full cluster restart upgrade to 5.6, reindex the 2.x indices, then perform a rolling upgrade to 6.x. If your Elasticsearch 2.x cluster contains indices that were created before 2.x, you must either delete or reindex them before upgrading to 5.6. For more information about upgrading from 2.x to 5.6, see Upgrading Elasticsearch in the Elasticsearch 5.6 Reference. Create a new 6.x cluster and reindex from remote to import indices directly from the 2.x cluster.

うーん、もしかしたらこんなことをしなくてもいけたのかもしれないのかな

終わってみると何かいい案があったのではないかとおもいますが、、、

とりあえずの暫定対応で、、、 知らないことが多すぎましたね