엔지니어 블로그
[Elasticsearch] reindex 본문
index가 서비스에 사용되고 있을 때 일반적인 방법으로 reindex를 실행하면 오류가 발생한다.
기존 index의 document가 10만개가 넘어가기 때문에 너무 큰 나머지 timeout error가 발생
#news index의 내용을 dict_test index로 reindex
POST _reindex
{
"source": {
"index": "news"
},
"dest": {
"index": "dict_test"
}
}
#오류 코드
{"statusCode":502,"error":"Bad Gateway","message":"Client request timeout"}
이때 API에 옵션을 추가해주면 비동기로 처리가 가능하다.
POST _reindex?wait_for_completion=false
{
"source": {
"index": "news"
},
"dest": {
"index": "dict_test"
}
}
'ELK > elasticsearch' 카테고리의 다른 글
[Elasticsearch] Elasticsearch nori-plugin 실험 (0) | 2023.03.27 |
---|---|
[Elasticsearhc] Enrich (0) | 2022.07.20 |
[Elasticsearch] minimum should match (0) | 2022.07.20 |
[Elasticsearch] 동의어 사전 (0) | 2022.05.19 |
[Elasticsearch]CRUD (0) | 2022.03.02 |