首页 > 其他分享 >自建elasticsearch迁移到阿里云

自建elasticsearch迁移到阿里云

时间:2024-07-19 14:40:36浏览次数:8  
标签:node http 自建 -- 索引 阿里 elasticsearch elasticdump

迁移工具:

elasticsearch-dump

 

前提:

阿里云elasticsearch开启“自动创建索引

 

一、安装elasticdump

  1. 安装node.js。

    1. 下载安装包。

       
      wget https://nodejs.org/dist/v16.18.0/node-v16.18.0-linux-x64.tar.xz
    2. 解压。

       
      tar -xf node-v16.18.0-linux-x64.tar.xz
    3. 设置环境变量。

      • 临时生效

         
        export PATH=$PATH:/root/node-v16.18.0-linux-x64/bin/
      • 永久生效

         
        vim ~/.bash_profile
        export PATH=$PATH:/root/node-v16.18.0-linux-x64/bin/
        source ~/.bash_profile

安装elasticsearch-dump。

 
npm install elasticdump -g
查看安装目录
npm root -g
ln -s /usr/local/node/lib/node_modules/elasticdump/bin/elasticdump /usr/local/bin

 

二、迁移指定索引
迁移指定索引的settings

elasticdump --input=http://"<UserName>:<YourPassword>"@<YourEsHost>/<YourEsIndex> --output=http://"<OtherName>:<OtherPassword>"@<OtherEsHost>/<OtherEsIndex> --type=settings --limit 10000

迁移指定索引的mapping


elasticdump --input=http://"<UserName>:<YourPassword>"@<YourEsHost>/<YourEsIndex> --output=http://"<OtherName>:<OtherPassword>"@<OtherEsHost>/<OtherEsIndex> --type=mapping --limit 10000


迁移指定索引的data


elasticdump --input=http://"<UserName>:<YourPassword>"@<YourEsHost>/<YourEsIndex> --output=http://"<OtherName>:<OtherPassword>"@<OtherEsHost>/<OtherEsIndex> --type=data --limit 10000


 

type是ES数据导出导入类型,Elasticdum工具支持以下数据类型的导入导出——
mapping ES的索引映射结构数据
data ES的数据
settings ES的索引库默认配置
limit 从SOURCE备份到DESTINATION的对象数量,默认是100,可自定义设置

 

参考:

https://help.aliyun.com/zh/es/use-cases/use-elasticsearch-dump-to-migrate-data?spm=a2c4g.11186623.0.0.317b7c67NLpasX

https://www.cnblogs.com/zhujiqian/p/14641972.html








标签:node,http,自建,--,索引,阿里,elasticsearch,elasticdump
From: https://www.cnblogs.com/xiaoyou2018/p/18311429

相关文章

  • AWS 高防和阿里云高防深度对比
    随着网络攻击的不断增加,企业对于网络安全的需求也越来越高。在这种情况下,高防护服务成为了企业网络安全的重要组成部分。AWS和阿里云作为全球领先的云计算服务提供商,都提供了高防护服务,但它们之间存在着一些差异。我们九河云一直在云上深耕多年,以下将是对AWS高防和阿里云高防进......
  • 阿里云网站备案流程
    域名icp备案按步骤依次进行 公安联网备案申请地址:https://beian.mps.gov.cn填写网站信息需要域名证书阿里云注册信息详见文档https://help.aliyun.com/zh/icp-filing/basic-icp-service/user-guide/the-public-security-network-for-the-record-information-fill-in-t......
  • 【单片机毕业设计选题24064】-基于阿里云的鱼塘水质检测系统
    系统功能:主控为STM32F103C8T6,通过PH值传感器、浑浊度传感器、温度传感器采集各项水质数据,系统可设定各参数的阈值,超过设定的阈值将通过蜂鸣器响来提醒用户做出措施,同时通过ESP-12FWIFI模块将设备连接阿里云物联网平台,实现在pc与手机端进行远程实时数据实时交互。系统需要......
  • uniapp对接人脸识别,人脸核身,双录 ,阿里云,以及腾讯云对接方法。
    腾讯云uniapp接入】第一步,申请人脸核身服务:https://cloud.tencent.com/apply/p/shcgszvmppc第二步,申请业务流程WBAppid:-获取WBappid方法指引:https://cloud.tencent.com/document/product/1007/49634-申请链接:https://console.cloud.tencent.com/faceid/access第三步,uni插件接入......
  • ES快速开发,ElasticsearchRestTemplate基本使用以及ELK快速部署
    最近博主有一些elasticsearch的工作,所以更新的慢了些,现在就教大家快速入门,并对一些基本的查询、更新需求做一下示例,废话不多说开始:1. ES快速上手es下载:[https://elasticsearch.cn/download/]()这里关于es所需要的链接基本都有,可以快速下载使用当你解压好了归档文件之后,Elas......
  • Gradle更换阿里云镜像源
    1、下载Gradle官网:https://gradle.org/releases/2、配置Gradle环境变量3、更换镜像源gradle安装目录下找到init.d文件夹 再该文件夹中创建init.gradle文件,编写一下脚本替换阿里云镜像//阿里云仓库和源仓库地址对比:https://developer.aliyun.com/mvn/guidegradle.proje......
  • Elasticsearch8.9.0安装配置集群
    下载安装包从官网下载8.9.0安装包#elasticsearch-8.9.0-x86_64.rpmfilebeat-8.9.0-x86_64.rpmkibana-8.9.0-x86_64.rpm安装系统环境查看#cat/etc/redhat-releaseRockyLinuxrelease9.3(BlueOnyx)#uname-aLinuxRocky9Es010030895.14.0-362.18.1.el9_3......
  • Springboot定义阿里云oss工具类
    Springboot定义阿里云oss工具类文章目录Springboot定义阿里云oss工具类1、定义OSS相关配置2、读取OSS配置3、生成OSS工具类对象4、定义使用工具类1、定义OSS相关配置首先,在application.yml文件中定义阿里云OSS的相关配置信息。这些配置包括endpoint、acces......
  • 通过chrony实现内网自建时间同步服务器
    服务端安装chrony服务端yuminstall-ychrony配置chrony服务端#chrony默认配置文件路径#yum:一般为/etc/chrony.conf#apt:一般为/etc/chrony/chrony.conf#在chrony.conf中加入以下行serverntp.aliyun.comiburstmanualallow0.0.0.0/0localstratum8......
  • 本地和网络yum源的配置,以及自建yum仓库
    本地和网络yum源的配置rpm-ivhxxx手动添加依赖,yum不执行安装,自动处理依赖管理yum优点rpm安装(下载软件,单独安装,需要解决依赖关系)源码安装configuremakemakeinstallyum基于rpm,相当于rpm升级版,自动解决依赖关系1.使用光盘作为yum源仓库1)在vmware中装载centos7光盘......