Elasticsearch health status 显示为 yellow 解决方法
Elasticsearch 大约 1182 字查看 health
curl -XGET "http://localhost:9200/_cluster/health?pretty=true"
返回:
{
"cluster_name" : "elasticsearch",
"status" : "yellow",
"timed_out" : false,
"number_of_nodes" : 1,
"number_of_data_nodes" : 1,
"active_primary_shards" : 6,
"active_shards" : 6,
"relocating_shards" : 0,
"initializing_shards" : 0,
"unassigned_shards" : 2,
"delayed_unassigned_shards" : 0,
"number_of_pending_tasks" : 0,
"number_of_in_flight_fetch" : 0,
"task_max_waiting_in_queue_millis" : 0,
"active_shards_percent_as_number" : 75.0
}
查看索引状态
curl -XGET "http://localhost:9200/_cat/indices?v"
返回:
health | status | index | uuid | pri | rep | docs.count | docs.deleted | store.size | pri.store.size |
---|---|---|---|---|---|---|---|---|---|
yellow | open | megacorp | Cd6ahzdvSiScOyrYRzYA9g | 1 | 1 | 4 | 0 | 21.9kb | 21.9kb |
yellow | open | my_index | C3BkK5ACTI2EQvjIkqXXng | 1 | 1 | 7 | 0 | 12.1kb | 12.1kb |
设置所有副本(rep)个数为 0
curl -XPUT "http://localhost:9200/_settings" -H 'Content-Type: application/json' -d'
{
"index" : {
"number_of_replicas" : 0
}
}'
再次查看索引状态:显示为green
。
设置单个副本个数为 0
curl -XPUT "http://localhost:9200/my_index/_settings" -H 'Content-Type: application/json' -d'
{
"index" : {
"number_of_replicas" : 1
}
}'
阅读 8947 · 发布于 2019-04-26
————        END        ————
Give me a Star, Thanks:)
https://github.com/fendoudebb扫描下方二维码关注公众号和小程序↓↓↓

昵称:
随便看看
换一批
-
Notepad++ 的 HexEditor 插件下载安装阅读 4222
-
Spring Boot 使用 MongoDB 实现共享 Session阅读 2557
-
Windows 平台 lua-resty-upload 上传的文件无法打开阅读 1219
-
Angular Material mat-error 组件输入时不校验解决方法阅读 1009
-
Java 中的序列化 Serializable 和 Externalizable阅读 895
-
Golang 预定义标识符阅读 1535
-
使用 Chrome 进行网页长截图阅读 1934
-
PostgreSQL 错误: 编码 "UTF8" 的字符 0x0xc9 0x99 在编码 "GBK" 没有相对应值阅读 3317
-
Linux CentOS6 安装 Docker阅读 3335
-
Android 调节手机亮度阅读 3172