先安装好nodejs和nodejs的包管理工具npm。然后安装elasticsearch-dump:

npm install elasticdump

 

下面迁移数据:

先在目的地址创建一个index来储存数据:

curl -X PUT 'localhost:9200/customer?pretty'

执行迁移命令:--input设置导出的源地址,--output设置导出的目的地址

'#拷贝analyzer如分词
elasticdump \
  --input=http://production.es.com:9200/my_index \
  --output=http://staging.es.com:9200/my_index \
  --type=analyzer
'#拷贝映射
elasticdump \
  --input=http://production.es.com:9200/my_index \
  --output=http://staging.es.com:9200/my_index \
  --type=mapping
'#拷贝数据
elasticdump \
  --input=http://production.es.com:9200/my_index \
  --output=http://staging.es.com:9200/my_index \
  --type=data

 

这里我们指定--type=data来导出数据,成功:

elasticsearch数据迁移——elasticsearch-dump使用

 

相关文章:

  • 2022-01-19
  • 2021-07-12
  • 2022-12-23
  • 2021-11-02
  • 2021-06-21
  • 2022-01-08
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-06-17
  • 2022-03-04
  • 2021-06-02
  • 2022-12-23
  • 2021-11-27
  • 2022-12-23
  • 2022-01-17
相关资源
相似解决方案