elasticdump arm离线安装(yum安装elasticsearch)
nanshan 2025-06-13 15:37 4 浏览 0 评论
介绍
elasticdump主要用于elasticsearch数据备份,可以直接esA同步到ESB,也可以同步到文件。源数据可以是整个索引也可以是部分过滤后的数据。
由于elasticdump使用node开发,其原理还是使用elasticsearch提供的scroll API(类似于SQL中的游标)技术。
需求
A公司提供了一个elasticsearch 连接信息,https://ip1:port1 用户elastic,密码test1。需要直接导入B公司的elasticsearch,https://ip2:port2 无密码。
步骤总结
1 安装elasticdump和打包工具npm-pack-all
2 打包elasticdump
3 下载目标arm服务器合适的node 版本
4 上传node软件包和elasticdump 压缩包到目标服务器上
5 在arm服务器上安装node以及elasticdump
验证源elasticsearch是否可用
curl -XGET -k --insecure 'https://32.10.10.10:9300 --user elastic:test1'
结果:
{
"name" : "test1",
"cluster_name" : "elastic-test",
"cluster_uuid" : "pBekANsjQyeCMoghretr",
"version" : {
"number" : "7.4.2",
"build_flavor" : "default",
"build_type" : "docker",
"build_hash" : "2f90bbf7b93631e52bafb5sedwerdsdfs",
"build_date" : "2019-10-28T20:40:44.881551Z",
"build_snapshot" : false,
"lucene_version" : "8.2.0",
"minimum_wire_compatibility_version" : "6.8.0",
"minimum_index_compatibility_version" : "6.0.0-beta1"
},
"tagline" : "You Know, for Search"
}
开始在window安装并打包
由于我的电脑是window,已经安装过node,node和npm具体如下(npm是node自带包管理工具)。
C:\Users\13900>node -v
v20.15.1
C:\Users\13900>npm -v
10.8.2
开始安装,安装命令 npm install -g elasticdump
C:\Users\13900>npm install -g elasticdump
npm warn ERESOLVE overriding peer dependency
npm warn While resolving: requestretry@7.1.0
npm warn Found: request@3.0.5
npm warn node_modules/elasticdump/node_modules/request
npm warn request@"npm:@cypress/request@>=3.0.1 <3.0.6" from elasticdump@6.120.2
npm warn node_modules/elasticdump
npm warn elasticdump@"*" from the root project
npm warn
npm warn Could not resolve dependency:
npm warn peer request@"2.*.*" from requestretry@7.1.0
npm warn node_modules/elasticdump/node_modules/requestretry
npm warn requestretry@"^7.1.0" from elasticdump@6.120.2
npm warn node_modules/elasticdump
npm warn
npm warn Conflicting peer dependency: request@2.88.2
npm warn node_modules/request
npm warn peer request@"2.*.*" from requestretry@7.1.0
npm warn node_modules/elasticdump/node_modules/requestretry
npm warn requestretry@"^7.1.0" from elasticdump@6.120.2
npm warn node_modules/elasticdump
npm warn deprecated s3signed@0.1.0: This module is no longer maintained. It is provided as is.
npm warn deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
added 146 packages in 6m
29 packages are looking for funding
run `npm fund` for details
查看安装的位置命令 npm config get prefix
C:\Users\13900>npm config get prefix
C:\Users\13900\AppData\Roaming\npm
还需要安装一个打包工具,用于将elasticsump打包成压缩包,然后拷贝到离线服务器上。安装命令:npm install -g npm-pack-all
C:\Users\13900>npm install -g npm-pack-all 安装打包工具
added 1 package in 9s
2 packages are looking for funding
run `npm fund` for details
安装完成后,就可以打包了,切换到elasticdump安装路径C:\Users\13900\AppData\Roaming\npm\node_modules\elasticdump,然后执行打包命令npm-pack-all,在当前目录下会生成一个tgz文件。
C:\Users\13900\AppData\Roaming\npm\node_modules\elasticdump>npm-pack-all 在再装目录下打包会自动生成一个tgz文件
npm notice name: elasticdump
npm notice version: 6.120.2
npm notice filename: elasticdump-6.120.2.tgz
npm notice package size: 13.0 MB
npm notice unpacked size: 98.2 MB
npm notice shasum: 3041e91636dc1ac5338a2971e8117e4af6012cac
npm notice integrity: sha512-8kfJgPeQGag9P[...]1tDxGR0auk1EQ==
npm notice bundled deps: 138
npm notice bundled files: 0
npm notice own files: 5076
npm notice total files: 5076
npm notice
elasticdump-6.120.2.tgz
Restoring original package.json and lock files
下载node包并安装node
查看目标服务器cpu架构,目前信创容易出现arm版本的。
[root@localhost ~]# lscpu 命令查看
Architecture: aarch64
Byte Order: Little Endian
根据结果架构是aarch64,所以需要下载node arm版本,官网没有20.15.1版本,先下载
node-v20.19.2-linux-arm64.tar.xz,看看能不能使用。
[root@localhost node]# pwd 上传的路径
/software/node
[root@localhost node]# ll
总用量 37272
-rw-r--r--. 1 root root 13047792 5月 20 10:34 elasticdump-6.120.2.tgz
-rw-r--r--. 1 root root 25114376 5月 20 10:34 node-v20.19.2-linux-arm64.tar.xz
[root@localhost node]#
开始解压tar xvf node-v20.19.2-linux-arm64.tar.xz
[root@localhost node]# tar xvf node-v20.19.2-linux-arm64.tar.xz
[root@localhost node]# cd node-v20.19.2-linux-arm64
[root@localhost node-v20.19.2-linux-arm64]# ll
总用量 908
drwxr-xr-x. 2 1001 1001 56 5月 14 20:12 bin
-rw-r--r--. 1 1001 1001 769693 5月 14 20:12 CHANGELOG.md
drwxr-xr-x. 3 1001 1001 18 5月 14 20:12 include
drwxr-xr-x. 3 1001 1001 26 5月 14 20:12 lib
-rw-r--r--. 1 1001 1001 115480 5月 14 20:12 LICENSE
-rw-r--r--. 1 1001 1001 39868 5月 14 20:12 README.md
drwxr-xr-x. 4 1001 1001 28 5月 14 20:12 share
[root@localhost node-v20.19.2-linux-arm64]# cd bin
[root@localhost bin]# ll
总用量 95624
lrwxrwxrwx. 1 1001 1001 45 5月 14 20:12 corepack -> ../lib/node_modules/corepack/dist/corepack.js
-rwxr-xr-x. 1 1001 1001 97917536 5月 14 20:12 node
lrwxrwxrwx. 1 1001 1001 38 5月 14 20:12 npm -> ../lib/node_modules/npm/bin/npm-cli.js
lrwxrwxrwx. 1 1001 1001 38 5月 14 20:12 npx -> ../lib/node_modules/npm/bin/npx-cli.js
查看版本
[root@localhost bin]# ./node -v
./node: /lib64/libm.so.6: version `GLIBC_2.27' not found (required by ./node)
./node: /lib64/libc.so.6: version `GLIBC_2.28' not found (required by ./node)
./node: /lib64/libc.so.6: version `GLIBC_2.25' not found (required by ./node)
./node: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by ./node)
./node: /lib64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by ./node)
./node: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by ./node)
报错,需要更高库,使用yum查看当前已安装的(没有配置本地yum源可以去搜索如何配置)。
[root@localhost bin]# yum -y install glibc
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile
软件包 glibc-2.17-317.el7.aarch64 已安装并且是最新版本
无须任何处理
[root@localhost bin]# yum -y install glibc-devel
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile
软件包 glibc-devel-2.17-317.el7.aarch64 已安装并且是最新版本
无须任何处理
发现当前已安装的库比需要的库版本低,如果升级库的化是比较麻烦的,那么可不可以降低node包来尝试呢。
尝试下载v18.20.8还是不行
尝试下载v17.9.1可以
下载node-v17.9.1-linux-arm64.tar.xz并解压
[root@localhost node]# cd node-v17.9.1-linux-arm64
[root@localhost node-v17.9.1-linux-arm64]# cd bin/
[root@localhost bin]# ./node -v
v17.9.1
[root@localhost bin]# ./npm -v
/usr/bin/env: node: 没有那个文件或目录
报错是因为需要调用node命令,node命令采用默认路径/usr/bin/node,所以需要提前创建好软连接
创建node软链接:
[root@localhost node-v17.9.1-linux-arm64]# ln -s /software/node/node-v17.9.1-linux-arm64/bin/node /usr/bin/node
创建完成后在执行测试:
[root@localhost node-v17.9.1-linux-arm64]# bin/npm -v
8.11.0
创建npm软连接方便直接执行npm命令
[root@localhost node-v17.9.1-linux-arm64]# ln -s /software/node/node-v17.9.1-linux-arm64/bin/npm /usr/bin/npm
[root@localhost ~]# npm -v
8.11.0
[root@localhost ~]# node -v
v17.9.1
安装elasticdump
[root@localhost ~]# npm install -g /software/node/elasticdump-6.120.2.tgz
npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
added 1 package in 7s
29 packages are looking for funding
run `npm fund` for details
查看安装路径
[root@localhost ~]# npm config get prefix
/software/node/node-v17.9.1-linux-arm64
切换到/software/node/node-v17.9.1-linux-arm64/lib/node_modules 查看
[root@localhost node_modules]# pwd
/software/node/node-v17.9.1-linux-arm64/lib/node_modules
[root@localhost node_modules]# ll
总用量 0
drwxr-xr-x. 4 1000 elasticsearch 86 6月 1 2022 corepack
drwxr-xr-x. 8 1000 elasticsearch 206 5月 20 11:03 elasticdump
drwxr-xr-x. 7 1000 elasticsearch 153 6月 1 2022 npm
[root@localhost node_modules]# cd elasticdump/
[root@localhost elasticdump]# ll
总用量 80
drwxr-xr-x. 2 1000 elasticsearch 49 5月 20 11:03 bin
drwxr-xr-x. 2 1000 elasticsearch 23 5月 20 11:03 customMatcher
-rw-r--r--. 1 1000 elasticsearch 457 5月 20 11:03 Dockerfile_local
-rw-r--r--. 1 1000 elasticsearch 2768 5月 20 11:03 elasticdump.js
drwxr-xr-x. 4 1000 elasticsearch 4096 5月 20 11:03 lib
-rw-r--r--. 1 1000 elasticsearch 11356 5月 20 11:03 LICENSE.txt
drwxr-xr-x. 140 1000 elasticsearch 4096 5月 20 11:03 node_modules
-rw-r--r--. 1 1000 elasticsearch 2567 5月 20 11:03 package.json
-rw-r--r--. 1 1000 elasticsearch 42350 5月 20 11:03 README.md
drwxr-xr-x. 2 1000 elasticsearch 22 5月 20 11:03 templates
drwxr-xr-x. 2 1000 elasticsearch 26 5月 20 11:03 transforms
验证是否安装成功
[root@localhost elasticdump]# bin/elasticdump --help
elasticdump: Import and export tools for elasticsearch
version: 6.120.2
Usage: elasticdump --input SOURCE --output DESTINATION [OPTIONS]
如果需要直接使用elasticdump,需要创建软链接
ln -s /software/node/node-v17.9.1-linux-arm64/lib/node_modules/elasticdump/bin/elasticdump /usr/bin/elasticdump
软连接创建完之后,直接执行命令即可,不需要切换到安装目录
elasticdump --help
# Copy an index from production to staging with mappings:
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
# Backup index data to a file:
elasticdump \
--input=http://production.es.com:9200/my_index \
--output=/data/my_index_mapping.json \
--type=mapping
elasticdump \
--input=http://production.es.com:9200/my_index \
--output=/data/my_index.json \
--type=data
# Backup and index to a gzip using stdout:
elasticdump \
--input=http://production.es.com:9200/my_index \
--output=$ \
| gzip > /data/my_index.json.gz
# Backup the results of a query to a file
elasticdump \
--input=http://production.es.com:9200/my_index \
--output=query.json \
--searchBody "{\"query\":{\"term\":{\"username\": \"admin\"}}}"
------------------------------------------------------------------------------
Learn more @ https://github.com/taskrabbit/elasticsearch-dump
使用
[root@localhost elasticdump]# elasticdump --input=https://elastic:test1@32.10.10.10:9300/faces-000255 --output=http://20.10.10.10:9200/faces-000255 --all=true
Tue, 20 May 2025 03:21:07 GMT | starting dump
Tue, 20 May 2025 03:21:07 GMT | Error Emitted => unable to verify the first certificate
Tue, 20 May 2025 03:21:07 GMT | Total Writes: 0
Tue, 20 May 2025 03:21:07 GMT | dump ended with error (get phase) => Error: unable to verify the first certificate
[root@localhost elasticdump]#
测试发现elasticdump无法提过https 安全认证,根据help 也没有以下参数
--noVerifyCert 没有这个参数
--no-check-certificate 没有这个参数
最总只能自己开发一个导入工具,从elasticsearch抽取数据到kafka。开发完成后测试,1000万数据耗时10分钟,也不影响源elasticsearch集群工作。
相关推荐
- MongoDB 从入门到实战:.NET 平台完整指南
-
一、什么是MongoDBMongoDB是一种功能强大且灵活的NoSQL数据库,适用于处理大规模的半结构化数据和高并发场景。它不依赖于固定的表结构和关系模型,而是以文档的形式存储数据,每个文档可...
- NET Framework安装失败的原因及解决方法
-
大家好我是艾西,一个做服务器租用的游戏爱好者兼网络架构系统环境问题网络工具人。在我们平时使用PC安装某些程序会出现.NETFramework缺失的提示,那么也会有很多的小伙伴搞不懂什么原因导致的,这...
- 这可是全网eNSP安装最完整,最详细的图解,没有之一(常见问题)
-
eNSP安装大纲eNSP安装详细图解篇幅较长,会分三篇更完。急需安装的朋友可以在文末获取图解文档和所需软件工具。ENSP安装常见问题和解决方案Vbox安装错误eNSP在安装的过程当中,经常会出现一...
- 如何在windows 2012安装.NET Framework3.5
-
Windowsserver2012R2,自带的是.NETFramework4.5,如果想装SQLserver2008或者SQLserver2012需要安装.ENTFramework...
- 3款国内可用的「Chrome」扩展下载网站
-
身为程序员,有几个不使用Chrome浏览器提升下编码效率呢?Chrome拥有众多丰富强大的扩展程序,今天给大家分享三个国内可用的Chrome扩展下载网站,收藏一下吧,不然下次就找不到我咯!C...
- 下载 Windows 10 应用商店程序离线包方法
-
有厂商为了图方便,会把Windows10应用商店里面的UMP应用改成EXE程序版本。例如之前「网易云音乐」UMP版本简洁清爽,获得不少用户推荐,后来官方懒得更新了,直接把UMP版本...
- 极速安装!NET Framework 3.5零距离指南!
-
.NETFramework3.5是一款由微软开发的应用程序框架,它为许多Windows应用程序提供了基础支持。它的新版本带来了许多令人兴奋的功能和改进,比如增强的XML和JSON处理能力以及强大的...
- Microsoft.NET离线运行库合集发布 2021
-
软件介绍.NET是微软具有战略意义的框架,也是装机必不可少的框架,想要一个一个安装略显繁琐,再加上很多电脑小白不知道怎么下载,不小心就下载到某某高速加载器,这个运行库极大解决了这个问题,采用微软官方....
- 缺少.net framework 3.5怎么办?(缺少.net4.5.1或以上环境)
-
很多电脑用户在玩某些程序游戏时都会遇到一个头痛的问题,弹出缺少“NETFramework3.5”的提示。微软从Windows8开始默认屏蔽了“.NET3.5”,如果用户有需要就必须选择在线安装...
- Windows11无法正常安装.net 3.5组件的解决方法
-
最近因公司部分电脑升级至Windows11之后,重新安装某些需要加载.net3.5组件的应用软件时,都提示无法完成加载或安装.net3.5而导致无法完成安装。使用离线安装包亦一样无法完成安装。一...
- 离线安装.Net Framework 3.5(离线安装.net framework 4.0)
-
前言.Net3.5已经越来越少用到了,但是偶尔还是会遇到一些老软件需要。而Win10、Win11的系统,直接在控制面板的里添加,经常会添加失败!解决方法首先需要一个系统的ISO镜像来提取sxs文件夹:...
- Jenkins 11个使用技巧,90%以上的人没用过
-
一、Performance插件兼容性问题自由风格项目中,有使用Performance插件收集构建产物,但是截至到目前最新版本(Jenkinsv2.298,Performance:v3.19),此...
- 6款Linux常用远程连接工具,你最中意哪一款?
-
点击上方头像关注我,每周上午09:00准时推送,每月不定期赠送技术书籍。本文2106字,阅读约需6分钟Hi,大家好。远程连接的实现方法有很多,概括地说有两种,一种是用系统自带的远程连接,另外一种是用...
- Linux常用远程连接工具介绍,总有一款适合你
-
作为运维或者网工最常用就是ssh远程和远程桌面工具,本文就介绍几个常用的远程连接工具,你在用哪一款呢SecureCRT介绍:我觉得这个是最好的SSH工具,没有之一。SecureCRT支持SSH,同时支...
- 终极软路由网络设置,ESXi虚拟机安装iKuai+openWrt双路由系统
-
本内容来源于@什么值得买APP,观点仅代表作者本人|作者:BigBubbleGum本文是软路由系列的第五篇,也是折腾时间最长的一篇,在ESXi下分别独立安装和使用iKuai和openWrt...
你 发表评论:
欢迎- 一周热门
-
-
如何在安装前及安装后修改黑群晖的Mac地址和Sn系列号
-
爱折腾的特斯拉车主必看!手把手教你TESLAMATE的备份和恢复
-
极空间如何无损移机,新Z4 Pro又有哪些升级?极空间Z4 Pro深度体验
-
[常用工具] OpenCV_contrib库在windows下编译使用指南
-
Ubuntu系统Daphne + Nginx + supervisor部署Django项目
-
WindowsServer2022|配置NTP服务器的命令
-
WIN11 安装配置 linux 子系统 Ubuntu 图形界面 桌面系统
-
UOS服务器操作系统防火墙设置(uos20关闭防火墙)
-
10个免费文件中转服务站,分享文件简单方便,你知道几个?
-
解决Linux终端中“-bash: nano: command not found”问题
-
- 最近发表
- 标签列表
-
- linux 查询端口号 (58)
- docker映射容器目录到宿主机 (66)
- 杀端口 (60)
- yum更换阿里源 (62)
- internet explorer 增强的安全配置已启用 (65)
- linux自动挂载 (56)
- 禁用selinux (55)
- sysv-rc-conf (69)
- ubuntu防火墙状态查看 (64)
- windows server 2022激活密钥 (56)
- 无法与服务器建立安全连接是什么意思 (74)
- 443/80端口被占用怎么解决 (56)
- ping无法访问目标主机怎么解决 (58)
- fdatasync (59)
- 405 not allowed (56)
- 免备案虚拟主机zxhost (55)
- linux根据pid查看进程 (60)
- dhcp工具 (62)
- mysql 1045 (57)
- 宝塔远程工具 (56)
- ssh服务器拒绝了密码 请再试一次 (56)
- ubuntu卸载docker (56)
- linux查看nginx状态 (63)
- tomcat 乱码 (76)
- 2008r2激活序列号 (65)