wordpress使用文档,温州快速排名优化,知科网站,wordpress5.1.1集群健康检查
Elasticsearch 的集群监控信息中包含了许多的统计数据#xff0c;其中最为重要的一项就是集群健康#xff0c;它在 status字段中展示为 green#xff08;所有主分片和副本分片都正常#xff09;、yellow#xff08;所有数据可用#xff0c;有些副本分片尚未…集群健康检查
Elasticsearch 的集群监控信息中包含了许多的统计数据其中最为重要的一项就是集群健康它在 status字段中展示为 green所有主分片和副本分片都正常、yellow所有数据可用有些副本分片尚未分配集群功能完全或者 red(该状态下数据已经丢失有主分片没能正常运行)。
可以通过以下命令查看集群的状态
GET /_cluster/health 分片验证 验证一个分片
创建一个名为test的索引让它有一个分片看看结果
put test {settings: {index: {number_of_shards: 1,number_of_replicas: 0}}
} 可以使用cerebro来查看分片的情况 验证两个分片
put test1 {settings: {index: {number_of_shards: 2,number_of_replicas: 0}}
} 可以使用cerebro来查看分片的情况 验证四个分片
put test2 {settings: {index: {number_of_shards: 4,number_of_replicas: 0}}
} 可以使用cerebro来查看分片的情况 验证副本
验证一个主分片2个副本分片
put test3 {settings: {index: {number_of_shards: 1,number_of_replicas: 2}}
} 可以使用cerebro来查看分片的情况 验证一主分片3个副本分片
put test4 {settings: {index: {number_of_shards: 1,number_of_replicas: 3}}
} 可以使用cerebro来查看分片的情况 此时有一个副本分片是无法分配的此时集群状态会是yellow。一个分片不能同时在一个节点上因此会出现这个问题不过集群还是能正常运行。
默认分片
默认是创建一个主分片一个副本分片
PUT test5 {settings: {index:{}}
} 默认方式在数据量大的时候是不推荐的因为数据写的压力全都在主分片所在的节点上。
分片与副本组合
两副本两分片 put test6 {settings: {index: {number_of_shards: 2,number_of_replicas: 2}}
} 三分片两副本
put test7 {settings: {index: {number_of_shards: 3,number_of_replicas: 2}}
}