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
}
}'
阅读 10271 · 发布于 2019-04-26
————        END        ————
Give me a Star, Thanks:)
https://github.com/fendoudebb扫描下方二维码关注公众号和小程序↓↓↓

昵称:
随便看看
换一批
-
不安装 redis-server 下连接 redis阅读 2987
-
Spring Boot OpenFeign 打印完整请求日志阅读 1016
-
Spring Boot JPA 控制台输出格式化后的 SQL 语句阅读 4942
-
JavaScript ES6 解构赋值阅读 790
-
MySQL 内置函数之时间函数阅读 1905
-
MySQL 内置函数之数学函数阅读 1873
-
Maven 父工程 dependencyManagement 管理依赖阅读 451
-
使用 trivy 扫描 Docker 镜像、K8S 集群的安全漏洞阅读 1449
-
Linux Shell 脚本监控进程状态阅读 4539
-
Docker 部署 Nginx阅读 1307