快照API无效

时间:2017-07-06 17:13:50

标签: elasticsearch

我正在运行ES 2.4.4并尝试使用快照API但是我收到以下错误:

{"error":{"root_cause":[{"type":"exception","reason":"failed to create blob container"}],"type":"exception","reason":"failed to create blob container","caused_by":{"type":"access_denied_exception","reason":"/var/lib/elasticsearch/data/es_snapshots/tests-JyPFj3wmSCq3UaxKnZcSAA"}},"status":500}

我用来运行快照API的命令是:

curl -XPUT -u user:passwd -k 'https://localhost:9200/_snapshot/my_backup' -d '{ "type": "fs", "settings": { "location": "/var/lib/es_snapshots", "compress": true } }'

我也使用了不同位置的相同命令:

curl -XPUT -u user:passwd -k 'https://localhost:9200/_snapshot/my_backup' -d '{ "type": "fs", "settings": { "location": "/var/lib/elasticsearch/data/es_snapshots", "compress": true } }'

我的ES的路径配置如下所示:

"path" : {
      "conf" : "/etc/elasticsearch",
      "data" : "/var/lib/elasticsearch/data",
      "logs" : "/var/log/elasticsearch",
      "home" : "/usr/share/elasticsearch",
      "repo" : [ "/var/lib/es_snapshots", "/var/lib/elasticsearch/data/es_snapshots" ]
    }

1 个答案:

答案 0 :(得分:1)

  1. 检查你的路径.repo:

    sudo vim /etc/elasticsearch/elasticsearch.yml

  2. 必须是类似于path.repo:[" / home / xxxx / backups"]

  3. 您应该检查用户elasticsearch是否具有写入权限/ home / xxxx / backups,使用:

    sudo -u elasticsearch touch /home/xxxx/backups/TEST.TXT

  4. 如果没有,请使用

    sudo chmod -R ugo + rw / home / xxxx / backups

  5. 再试一次