gpt4 book ai didi

ElasticSearch 快照/备份不起作用

转载 作者:行者123 更新时间:2023-12-03 21:35:13 30 4
gpt4 key购买 nike

我的 ES 快照不起作用或看起来是空的。

首先,我在我的 Ubuntu 服务器上做了这个:

1.创建备份目录

mkdir /home/admin/dumps/elasticsearch

2. 将此目录设置为 elatissearch.yml 用于快照
path.repo: ["/home/admin/dumps/elasticsearch"]

3.设置快照存储库位置
curl -XPUT 'http://localhost:9200/_snapshot/backup' -d '{
  "type": "fs",
  "settings": {
    "location": "/home/admin/dumps/elasticsearch",
    "compress": true
  }
}'

然后,我可以运行快照:
curl -XPUT localhost:9200/_snapshot/backup/elasticsearch_snapshot?wait_for_completion=true

回复:

{"snapshot":{"snapshot":"elasticsearch_snapshot","version_id":2030099,"version":"2.3.0","indices":["references"],"state":"SUCCESS","start_time":"2016-04-08T08:45:30.525Z","start_time_in_millis":1460105130525,"end_time":"2016-04-08T08:45:30.779Z","end_time_in_millis":1460105130779,"duration_in_millis":254,"failures":[],"shards":{"total":15,"failed":0,"successful":15}}}



我还创建了一个 cronjob 来在每天 5:35 备份 ElasticSearch:
35 5 * * * curl -X PUT "localhost:9200/_snapshot/backup/elasticsearch.$(date +\%Y-\%m-\%d)?wait_for_completion=true"

好吧,当我转到我的 dumps/elasticsearch 文件夹时,我得到了:

-rw-r--r-- 1 elasticsearch elasticsearch 256 Apr 8 10:45 index drwxr-xr-x 5 elasticsearch elasticsearch 4096 Apr 8 05:35 indices -rw-r--r-- 1 elasticsearch elasticsearch 121 Apr 1 05:35 meta-elasticsearch.2016-04-01.dat -rw-r--r-- 1 elasticsearch elasticsearch 121 Apr 2 05:35 meta-elasticsearch.2016-04-02.dat -rw-r--r-- 1 elasticsearch elasticsearch 121 Apr 3 05:35 meta-elasticsearch.2016-04-03.dat -rw-r--r-- 1 elasticsearch elasticsearch 121 Apr 4 05:35 meta-elasticsearch.2016-04-04.dat -rw-r--r-- 1 elasticsearch elasticsearch 121 Apr 5 05:35 meta-elasticsearch.2016-04-05.dat -rw-r--r-- 1 elasticsearch elasticsearch 121 Apr 6 05:35 meta-elasticsearch.2016-04-06.dat -rw-r--r-- 1 elasticsearch elasticsearch 121 Apr 7 05:35 meta-elasticsearch.2016-04-07.dat -rw-r--r-- 1 elasticsearch elasticsearch 121 Apr 8 05:35 meta-elasticsearch.2016-04-08.dat -rw-r--r-- 1 elasticsearch elasticsearch 213 Apr 1 05:35 snap-elasticsearch.2016-04-01.dat -rw-r--r-- 1 elasticsearch elasticsearch 213 Apr 2 05:35 snap-elasticsearch.2016-04-02.dat -rw-r--r-- 1 elasticsearch elasticsearch 213 Apr 3 05:35 snap-elasticsearch.2016-04-03.dat -rw-r--r-- 1 elasticsearch elasticsearch 212 Apr 4 05:35 snap-elasticsearch.2016-04-04.dat -rw-r--r-- 1 elasticsearch elasticsearch 213 Apr 5 05:35 snap-elasticsearch.2016-04-05.dat -rw-r--r-- 1 elasticsearch elasticsearch 213 Apr 6 05:35 snap-elasticsearch.2016-04-06.dat -rw-r--r-- 1 elasticsearch elasticsearch 213 Apr 7 05:35 snap-elasticsearch.2016-04-07.dat -rw-r--r-- 1 elasticsearch elasticsearch 217 Apr 8 05:35 snap-elasticsearch.2016-04-08.dat



Cron 快照在那里,但所有数据似乎都是空的!
我错过了什么 ?

最佳答案

在 elasticsearch 快照中,只有快照的元数据存储在根级路径上。
所有索引备份实际数据存储在/indices下根路径下的文件夹。
如果你看看里面 /indices文件夹,您将看到您的集群数据

关于ElasticSearch 快照/备份不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36495411/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com