简体   繁体   English

从2.x升级到5.x后,Elasticsearch存储库不显示快照

[英]Elasticsearch respository shows no snapshots after upgrade from 2.x to 5.x

On a RHEL6 system, I followed the steps laid out here to create a repository and capture a snapshot prior to my upgrade. 在RHEL6系统上,我按照此处列出的步骤创建存储库并在升级之前捕获快照。 I verified the existence of the snap shot: 我验证了快照的存在:

curl 'localhost:9200/_snapshot/_all?pretty=true'

Which gave me the following result: 这给了我以下结果:

{ "upgrade_backup" : { {“upgrade_backup”:{
"type" : "fs", “type”:“fs”,
"settings" : { “设置”:{
"compress" : "true", “压缩”:“真实”,
"location" : "/tmp/elasticsearch-backup" “location”:“/ tmp / elasticsearch-backup”
} } } }}}

After upgrading Elasticsearch via yum, I went to restore my snapshot but none are showing up: 通过yum升级Elasticsearch之后,我去恢复了我的快照但没有出现:

curl 'localhost:9200/_snapshot/_all?pretty=true'

{ } {}

I checked on the file system and see the repository files: 我检查了文件系统并查看了存储库文件:

ls -lrt /tmp/elasticsearch-backup

total 24 总共24
-rw-r--r--. -rw-R - R--。 1 elasticsearch elasticsearch 121 Apr 7 14:42 meta-snapshot-number-one.dat 1 elasticsearch elasticsearch 121 Apr 7 14:42 meta-snapshot-number-one.dat
drwxr-xr-x. drwxr-XR-X。 3 elasticsearch elasticsearch 21 Apr 7 14:42 indices 3 elasticsearch elasticsearch 21 Apr 7 14:42指数
-rw-r--r--. -rw-R - R--。 1 elasticsearch elasticsearch 191 Apr 7 14:42 snap-snapshot-number-one.dat 1 elasticsearch elasticsearch 191 Apr 7 14:42 snap-snapshot-number-one.dat
-rw-r--r--. -rw-R - R--。 1 elasticsearch elasticsearch 37 Apr 7 14:42 index 1 elasticsearch elasticsearch 37 Apr 7 14:42 index
-rw-r--r--. -rw-R - R--。 1 elasticsearch elasticsearch 188 Apr 7 14:51 index-0 1 elasticsearch elasticsearch 188 Apr 7 14:51 index-0
-rw-r--r--. -rw-R - R--。 1 elasticsearch elasticsearch 8 Apr 7 14:51 index.latest 1 elasticsearch elasticsearch 8 Apr 7 14:51 index.latest
-rw-r--r--. -rw-R - R--。 1 elasticsearch elasticsearch 29 Apr 7 14:51 incompatible-snapshots 1 elasticsearch elasticsearch 29 Apr 7 14:51不兼容的快照

I made sure elasticsearch.yml still has the "data.repo" tag, so I'm not sure where to look or what to do to determine what happened, but somehow my snapshots vanished! 我确保elasticsearch.yml仍然有“data.repo”标签,所以我不知道在哪里查看或做什么来确定发生了什么,但不知怎的,我的快照消失了!

You need to add following line to elasticsearch.yml : 您需要在elasticsearch.yml添加以下行:

path.repo: ["/tmp/elasticsearch-backup"]

Then restart Elastic service and create a new snapshots repository: 然后重新启动Elastic服务并创建一个新的快照存储库:

curl -XPUT "http://localhost:92000/_snapshot/backup" -H 'Content-Type: application/json' -d '{
    "type": "fs",
    "settings": {
        "location": "/tmp/elasticsearch-backup",
        "compress": true
    }
}'

Now you should be able to list all snapshots in your repository and eventually restore them: 现在,您应该能够列出存储库中的所有快照并最终还原它们:

curl -s -XGET "localhost:9200/_snapshot/backup/_all" | jq .

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM