elasticsearch错误(索引数据损坏)
查看索引信息
curl -XGET 'http://localhost:9200/_cluster/health?pretty=true'
查看所有的状态
curl 'localhost:9200/_cat/indices?v'
删除red索引
curl 'localhost:9200/_cat/indices?v' | grep red | awk '{print $4}' > delete.sh
vim delete.sh
curl -XDELETE http://localhost:9200/DdFE2rdbSJy-cUI2lHHkWw
curl -XDELETE http://localhost:9200/APbdeEjPTeeLWZkW-coKBQ
curl -XDELETE http://localhost:9200/ZTM9v3iJRLq9yv0P92X3XA
curl -XDELETE http://localhost:9200/_FOPlWh7RL-vhV6z57aeaQ
curl -XDELETE http://localhost:9200/rXqWwxkQRjC9qXxMdWDeFA
sh delete.sh
处理yellow索引
curl -XPUT "http://localhost:9200/_settings" -H 'Content-Type: application/json' -d'
{
"index" : {
"number_of_replicas" : 0
}
}'
检测状态
curl -XGET 'http://localhost:9200/_cluster/health?pretty=true'
{
"cluster_name" : "es",
"status" : "green",
"timed_out" : false,
"number_of_nodes" : 1,
"number_of_data_nodes" : 1,
"active_primary_shards" : 759,
"active_shards" : 759,
"relocating_shards" : 0,
"initializing_shards" : 0,
"unassigned_shards" : 0,
"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" : 100.0
}
|