LoginSignup
0

More than 5 years have passed since last update.

Elaschsearch 6.5 レプリカを無くす

Last updated at Posted at 2018-11-27

Elasticsearch のレプリカを無くすには

テスト用途などで使う場合、シングルノードになるので、レプリカできません。
そういう場合、レプリカを無くす必要があります。
以前は、elasticsearch.yml に定義すればよかったのですが、現在(6.5)は違います。

レプリカをゼロに設定する

> curl -XPUT http://localhost:9200/_settings -H 'Content-Type: application/json' -d '
{
   "index" : {
      "number_of_replicas" : 0
   }
}'

※indices の数が多かったりすると、時間がかかります。

ところで、これって再起動すると number_of_shards:5 / number_of_replicas:1 に戻ってしまうのはどうにかならんですかね・・・

参照

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
0