ES相关命令
一、备份es索引
需要修改金库审批日志,就先备份,然后修改备份的数据即可,减少数据库误操作风险
curl -XPOST -H "Content-Type: application/json" "http://10.226.83.92:9200/_reindex?wait_for_completion=false&scroll=5h" -d '{
"source": {
"index": "appfortress_log_2026_04",
"size": 1000
},
"dest": {
"index": "appfortress_log_test_2026_04",
"op_type": "create"
}
}'
source源索引 dest目标索引
scroll=5h执行时间,一小时大概在500万,根据数据调整时间限制
查询任务进度根据任务id进行查询(H7TtfHw1Syuu2YOIJv-PKg:166518778)
curl -XGET "http://10.226.83.92:9200/_tasks/yU-ePL48T0el4U_ioTxMng:168295537?pretty"
浙公网安备 33010602011771号