ElasticSearch management 관련 명령어
GET /_cat/snapshots/s3_repository?v&s=id
GET /_cluster/health/?level=indices
GET _cluster/settings
GET _cat/allocation?v
DELETE _snapshot/s3_repository/snap_index_20180101
PUT _snapshot/s3_repository/snap_index_20180101?wait_for_completion=false
{
"indices": ["index1", "index2", "index3"]
}
GET _snapshot/s3_repository/snap_index_20180101
GET _snapshot/s3_repository
-- 노드 하나 비우자
PUT _cluster/settings
{
"transient": {
"cluster.routing.allocation.exclude._ip": "10.211.205.93"
}
}
unssined shard 복구하기
1. 이슈있는 샤드 찾기
curl -XGET https://localhost/_cat/shards?h=index,shard,prirep,state,unassigned.reason| grep UNASSIGNED
2. 이슈있는 데이터 삭제
curl -XDELETE 'https://localhost/user-tracking-2019-07-22/'
curl -XGET https://localhost/_cluster/allocation/explain?pretty
-- 전체 리플리카 변경하기
curl -XPUT -H 'Content-Type: application/json' 'https://localhost/_settings' -d '
{
"index" : {
"number_of_replicas" : 2
}
}'