# Taking snapshot in Openshift elasticsearch

**URL:** <https://discuss.elastic.co/t/taking-snapshot-in-openshift-elasticsearch/159460>\
**Category:** Elasticsearch\
**Created:** [December 5, 2018, 5:26am UTC](https://discuss.elastic.co/t/taking-snapshot-in-openshift-elasticsearch/159460 "2018-12-05T05:26:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![afwsl2003](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/afwsl2003/32/38455_2.png) [@afwsl2003](https://discuss.elastic.co/u/afwsl2003)\
**Post date:** [December 5, 2018, 5:26am UTC](https://discuss.elastic.co/t/taking-snapshot-in-openshift-elasticsearch/159460/1 "2018-12-05T05:26:28Z")

</div>

Hi,

I'm trying to create a repository to take snapshot ([https://www.elastic.co/guide/en/elasticsearch/reference/2.4/modules-snapshots.html](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/modules-snapshots.html))

When I execute the curl PUT command to create the repository I'm getting repository\_missing\_exception error. Could anyone please help why I'm getting repository\_missing\_exception when I'm actually trying to create the repository. Thank you.

I have very little knowledge in ES, so please bear with me if I have done something incorrectly.

Following is the command I tried.

```
sh-4.2$ curl --key /etc/elasticsearch/secret/admin-key --cert /etc/elasticsearch/secret/admin-cert --cacert /etc/elasticsearch/secret/admin-ca PUT https://localhost:9200/_snapshot/my_backup{"type":"fs","settings":{"location":"/elasticsearch/persistent/backup_test","compress":true}}
curl: (6) Could not resolve host: PUT; Unknown error
{"error":{"root_cause":[{"type":"repository_missing_exception","reason":"[my_backuptype:fs] missing"}],"type":"repository_missing_exception","reason":"[my_backuptype:fs] missing"},"status":404}No handler found for uri [/_snapshot/my_backupsettings:location:/elasticsearch/persistent/backup_test] and method [GET]{"error":{"root_cause":[{"type":"repository_missing_exception","reason":"[my_backupsettings:compress:true] missing"}],"type":"repository_missing_exception","reason":"[my_backupsettings:compress:true] missing"},"status":404}sh-4.2$
sh-4.2$
sh-4.2$
sh-4.2$
sh-4.2$ curl --key /etc/elasticsearch/secret/admin-key --cert /etc/elasticsearch/secret/admin-cert --cacert /etc/elasticsearch/secret/admin-ca PUT https://localhost:9200/_snapshot/my_backup {"type":"fs","settings":{"location":"/elasticsearch/persistent/backup_test","compress":true}}
curl: (6) Could not resolve host: PUT; Unknown error
{"error":{"root_cause":[{"type":"repository_missing_exception","reason":"[my_backup] missing"}],"type":"repository_missing_exception","reason":"[my_backup] missing"},"status":404}curl: (6) Could not resolve host: type; Unknown error
curl: (6) Could not resolve host: settings:location; Unknown error
curl: (6) Could not resolve host: settings:compress; Unknown error
sh-4.2$
sh-4.2$
sh-4.2$ pwd
/elasticsearch/persistent
sh-4.2$ ls
backup backup_test logging-es
sh-4.2$
sh-4.2$ curl --key /etc/elasticsearch/secret/admin-key --cert /etc/elasticsearch/secret/admin-cert --cacert /etc/elasticsearch/secret/admin-ca GET https://localhost:9200/_cat/nodes?v
curl: (6) Could not resolve host: GET; Unknown error
host ip heap.percent ram.percent load node.role master name
172.20.23.244 172.20.23.244 59 99 0.05 d m logging-es-data-master-5ku70fyl
172.20.13.185 172.20.13.185 42 98 0.25 d m logging-es-data-master-tvohg72r
172.20.21.213 172.20.21.213 18 99 0.18 d * logging-es-data-master-rcvz8y4i
sh-4.2$ curl --key /etc/elasticsearch/secret/admin-key --cert /etc/elasticsearch/secret/admin-cert --cacert /etc/elasticsearch/secret/admin-ca GET https://localhost:9200/_cat/health?v
curl: (6) Could not resolve host: GET; Unknown error
epoch timestamp cluster status node.total node.data shards pri relo init unassign pending_tasks max_task_wait_time active_shards_percent
1543987079 13:17:59 logging-es green 3 3 663 378 0 0 0 0 - 100.0%
sh-4.2$
```

---

<div class="post-metadata">

**Author:** ![jkarasek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jkarasek/32/29033_2.png) [@jkarasek](https://discuss.elastic.co/u/jkarasek)\
**Post date:** [December 5, 2018, 8:36am UTC](https://discuss.elastic.co/t/taking-snapshot-in-openshift-elasticsearch/159460/2 "2018-12-05T08:36:50Z")

</div>

I'm not sure about the curl command syntax.  
curl: (6) Could not resolve host: PUT - that suggests to me that you're not talking to the host localhost but to PUT.

I would try:

```auto
curl --key /etc/elasticsearch/secret/admin-key \
    --cert /etc/elasticsearch/secret/admin-cert \
    --cacert /etc/elasticsearch/secret/admin-ca \
    https://localhost:9200/_cat/health?v

```

Which can be shortened to:

```auto
es_util --query=_cat/health?v

```

If that helps, then the curl you want might be something like this:

```auto
curl --key /etc/elasticsearch/secret/admin-key \
    --cert /etc/elasticsearch/secret/admin-cert \
    --cacert /etc/elasticsearch/secret/admin-ca \
    -XPUT https://localhost:9200/_snapshot/my_backup \
    -d '{"type":"fs","settings":{"location":"/elasticsearch/persistent/backup_test","compress":true}}'

```

Shortened to:

```auto
es_util --query=_snapshot/my_backup -XPUT \
    -d '{"type":"fs","settings":{"location":"/elasticsearch/persistent/backup_test","compress":true}}'

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [January 2, 2019, 8:36am UTC](https://discuss.elastic.co/t/taking-snapshot-in-openshift-elasticsearch/159460/3 "2019-01-02T08:36:52Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
