Think before you speak, read before you think.

elasticsearch 笔记

查看索引

http://127.0.0.1:9200/_cat/indices

查看节点

http://10.18.19.93:9200/_nodes

查看 mappings

http://10.18.19.70:9200/_mappings

查看健康状态

_cluster/health

每个 index 状态

_cluster/health?level=indices

删除 index

curl -XDELETE 1.2.3.4:9200/notification_msgcount_logs-2019.24

按存储大小排序

curl -XGET 'http://127.0.0.1:9200/_cat/indices/_all?v&s=store.size'  

查看未分配 shard 的原因
GET _cluster/allocation/explain?pretty

FORBIDDEN/12/index read-only 报错
es磁盘已满而无法索引更多文档,则elasticsearch将切换为只读。它确保了只读查询的可用性。

blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];: [cluster_block_exception] blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];
进行 index 的删除的同时。Elasticsearch不会自动切换回来,可以使用如下方法切换回正常模式:

PUT _settings
{
“index.blocks.read_only_allow_delete”: “false”
}

# 检查

GET _settings


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *