V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
foxyier
V2EX  ›  Elasticsearch

[求助]es 数据本地向阿里云 es 迁移问题

  •  
  •   foxyier · 2019-10-24 13:14:41 +08:00 · 3573 次点击
    这是一个创建于 1639 天前的主题,其中的信息可能已经有所发展或是发生改变。
    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
    Ehco1996
        1
    Ehco1996  
       2019-10-24 13:29:58 +08:00
    阿里云版的 es 有个 oss 快照备份还原功能

    先在本地把数据存进 oss
    aaronchou0
        2
    aaronchou0  
       2019-10-24 13:36:56 +08:00
    这么点数据 reindex 都可以了。你要嫌慢可以用 elasticdump
    foxyier
        3
    foxyier  
    OP
       2019-10-24 14:04:06 +08:00
    @aaronchou0 用 elasticdump 试了一下。。特别特别慢..有没有什么办法能快一点呢
    aaronchou0
        4
    aaronchou0  
       2019-10-25 11:14:58 +08:00
    @foxyier 26G esdump 2、30 分钟吧,主要看 es 性能。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5206 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 07:35 · PVG 15:35 · LAX 00:35 · JFK 03:35
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.