elasticsearch数据备份

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
elasticsearchdump安装
 
##### 1、 安装npm环境
 
```
#安装npm(只需要在一个节点安装即可,如果前端还有nginx做反向代理可以每个节点都装) [root@elkstack01 ~]# yum install -y npm
#进入下载head插件代码目录
[root@elkstack01 src]# cd /usr/local/ # 从GitHub上克隆代码到本地
[root@elkstack01 local]# git clone git://github.com/mobz/elasticsearch-head.git
# 克隆完成后,进入elasticsearch插件目录
[root@elkstack01 local]# cd elasticsearch-head/
# 清除缓存
[root@elkstack01 elasticsearch-head]# npm cache clean -f
# 使用npm安装n模块(不同的项目js脚本所需的node版本可能不同,所以就需要node版本管理工具)
```
 
##### 2、安装备份工具
 
```
[root@db01 ~]# npm install elasticdump -g
```
 
##### 3、备份命令
 
###### 1)参数
 
```
--input: 数据来源
--output: 接收数据的目标
--type: 导出的数据类型(settings, analyzer, data, mapping, alias, template)
```
 
###### 2)备份到集群
 
```
elasticdump \
--input=http://user:password@ip/index \
--output=http://user:password@ip/index \
--type=mapping
 
elasticdump \
--input=http://user:password@ip/index \
--output=http://user:password@ip/index \
--type=data
```
 
###### 3)备份到集群
 
```
elasticdump \
--input=http://user:password@ip/index \
--output=/tmp/mapping.json
--type=mapping
 
elasticdump \
--input=http://user:password@ip/index \
--output=/tmp/data.json
--type=data
```

  

posted @   test_yu  阅读(409)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 分享一个免费、快速、无限量使用的满血 DeepSeek R1 模型,支持深度思考和联网搜索!
· 使用C#创建一个MCP客户端
· ollama系列1:轻松3步本地部署deepseek,普通电脑可用
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· 按钮权限的设计及实现
点击右上角即可分享
微信分享提示