是时候用 ES 拯救发际线啦

reindex异常终止,怎么在断点继续执行

Elasticsearch | 作者 excellent95 | 发布于2019年10月26日 | 阅读数:3309

生产环境迁移,使用reindex操作老数据迁移,同时生产也在往索引写数据,老数据迁移了好几天,由于网络问题导致reindex中断,不想重新reindex,该怎么操作?
使用默认的迁移脚本:
POST _reindex
{
"source": {
"remote": {
"host": "http://otherhost:9200",
"username": "user",
"password": "pass"
},
"index": "source",
"query": {
"match": {
"test": "data"
}
}
},
"dest": {
"index": "dest"
}
}
已邀请:

a1158139810

赞同来自:

@的

mobikarl

赞同来自:

Settings op_type to create will cause _reindex to only create missing documents in the target index. All existing documents will cause a version conflict:
POST _reindex
{
  "source": {
    "index": "twitter"
  },
  "dest": {
    "index": "new_twitter",
    "op_type": "create"
  }
}
 

qiye

赞同来自:

如果是同版本ES数据迁移的话,建议使用文件拷贝的方式

要回复问题请先登录注册