橡皮、老虎皮、狮子皮哪一个最不好?

elasticsearch-dump查询结果再备份

Elasticsearch | 作者 jony | 发布于2018年06月27日 | 阅读数:3436

elasticsearch-dump能够对指定满足一些条件的数据进行备份吗,因为当前每天的数据都存在一个索引中,现在需要对前天的数据进行增量备份。
已邀请:

大慈大悲掌 - 要我一直笑吗?https://www.jianshu.com/u/bfa06856a726

赞同来自:

elasitcsearch-dump的github提供的示例
# Backup the results of a query to a file
elasticdump \
--input=http://production.es.com:9200/my_index \
--output=query.json \
--searchBody '{"query":{"term":{"username": "admin"}}}'
以及关于这个参数的解释
--searchBody
Preform a partial extract based on search results
when ES is the input, default values are
if ES > 5
`'{"query": { "match_all": {} }, "stored_fields": ["*"], "_source": true }'`
else
`'{"query": { "match_all": {} }, "fields": ["*"], "_source": true }'`

要回复问题请先登录注册