zoukankan      html  css  js  c++  java
  • elasticsearchdump迁移记录

    导出: mapping和data
    docker run --rm -ti -v /data:/tmp taskrabbit/elasticsearch-dump \
      --input=http://10.33.0.20:9200/my-index \
      --output=/tmp/my_index_mapping.json \
      --type=mapping
      
    docker run --rm -ti -v /data:/tmp taskrabbit/elasticsearch-dump \
      --input=http://10.33.0.20:9200/my-index \
      --output=/tmp/my_index_export.json \
      --type=data
      
      
    
    创建索引:
    curl -XPUT http://10.37.2.209:9201/my-index
    
    导入mapping
    docker run --rm -ti -v /data:/tmp taskrabbit/elasticsearch-dump --input=/tmp/my_index_mapping.json --output=http://10.33.0.20:9200/my-index --type=mapping
    导入data
    docker run --rm -ti -v /data:/tmp taskrabbit/elasticsearch-dump --input=/tmp/my_index_export.json --output=http://10.33.0.20:9200/my-index --type=data
    
    查看索引
    curl -X GET 10.37.2.209:9202/my-index/_searchr

    备注:

    # 注意 elasticdump 提供给了--httpAuthFile 参数来做认证
    --httpAuthFile      When using http auth provide credentials in ini file in form
                        `user=<username>
                        password=<password>`
    
    # 只需要写一个ini文件 ,文件中写入用户名和密码就可以了

    # 这里其实还有另外一个好的方法 # 在--input参数和--output参数的的url中添加账号密码 # 例如 elasticdump \ --input=http://prod-username:prod-passowrd@production.es.com:9200/my_index \ --output=http://stage-username:stage-password@staging.es.com:9200/my_index \ --type=data

      

    其他导入方式参考

    elasticsearch导入json数据_大头之家-CSDN博客_es导入json 

     

  • 相关阅读:
    2-5
    2-3
    2-2
    2-1
    1-1
    实验6-1 求数组及其下标
    实验4-2 关于求阶乘的运算
    作业 3-5 switch语句的应用
    作业3-6 查询水果单价
    作业3-4 判断是不是闰年
  • 原文地址:https://www.cnblogs.com/zhaojingyu/p/15702283.html
Copyright © 2011-2022 走看看