ElasticSearch Split 切分主分片数

 ElasticSearch Split 增加主分片数

ElasticSearch 7.2.0

Split 的使用方式和Shrink很像见:https://blog.csdn.net/u014646662/article/details/103575489

如果不完全符合,可以重新索引:https://blog.csdn.net/u014646662/article/details/97638792

目录

1、使用条件

2、使用

2.1 创建index(准备源索引)

  • 4.2 将索引更改为只读
  • 4.3 切分主分片
  • 4.4 取消只读
  • 4.5 测试

1、使用条件

  • 目标索引不能存在
  • 源索引必须具有比目标索引更少的主分片。
  • 目标索引中主分片的数量必须是源索引中主分片的数量的倍数
  • 处理拆分过程的节点必须具有足够的可用磁盘空间,以容纳现有索引的第二个副本。
  • 源索引必须只读(可以设置)

2、使用

2.1 创建index(准备源索引)

PUT test
{
  "settings": {
    "number_of_replicas": 0,
    "number_of_shards": 4
  }
}

4.2 将索引更改为只读

PUT /test/_settings
{
  "settings": {
    "index.blocks.write": true
  }
}

4.3 切分主分片

#把索引大卸八块
POST test/_split/test1
{
  "settings": {
    "index.number_of_shards": 8
  }
}

4.4 取消只读

PUT /test1/_settings
{
  "settings": {
    "index.blocks.write": null
  }
}

4.5 测试


PUT test1/_doc/2
{
  "name":"king"
}



GET test1/_search

5、对人工智能感兴趣点下面链接

现在人工智能非常火爆,很多朋友都想学,但是一般的教程都是为博硕生准备的,太难看懂了。最近发现了一个非常适合小白入门的教程,不仅通俗易懂而且还很风趣幽默。所以忍不住分享一下给大家。点这里可以跳转到教程。

https://www.cbedai.net/u014646662

发布了139 篇原创文章 · 获赞 273 · 访问量 666万+

猜你喜欢

转载自blog.csdn.net/u014646662/article/details/103579425