这是一个创建于 1803 天前的主题,其中的信息可能已经有所发展或是发生改变。
RT
现在有需求把本地 elasticsearch 的一个索引(26G 的数据,接近 300W 数据)迁移到阿里云的 elasticsearch 中, 但是使用 logstash 只能迁移 1W 条数据, 请问如何把索引中的所有数据都迁移过去?
logstash 配置文件:
input {
elasticsearch {
hosts => ["1.1.1.1:9200"] #老 ES 集群访问地址
index => "book_2019-10" #需要同步的索引名称
size => 10000
scroll => "1m"
codec => "json"
docinfo => true
}
}
output {
elasticsearch {
hosts => ["2.2.2.2:9200"] #阿里云 ES 访问地址
user => "elastic" #默认为 elastic
password => "123456789" #购买阿里云 ES 界面中指定的密码,或初始化 Kibana 时指定的密码
index => "book_2019-10" #在新 ES 集群中的索引名
document_type => "%{[@metadata][_type]}"
document_id => "%{[@metadata][_id]}"
template => "/logstash/template/book.json"
template_name => "book*"
template_overwrite => true
doc_as_upsert => true
}
stdout { codec => rubydebug { metadata => true } }
}
4 条回复 • 2019-10-25 11:14:58 +08:00
|
|
1
Ehco1996 2019-10-24 13:29:58 +08:00
阿里云版的 es 有个 oss 快照备份还原功能
先在本地把数据存进 oss
|
|
|
2
aaronchou0 2019-10-24 13:36:56 +08:00
这么点数据 reindex 都可以了。你要嫌慢可以用 elasticdump
|
|
|
3
foxyier 2019-10-24 14:04:06 +08:00
@ aaronchou0 用 elasticdump 试了一下。。特别特别慢..有没有什么办法能快一点呢
|