# Is this the correct approach of taking a snapshop of an indice which is in production?

**URL:** <https://discuss.elastic.co/t/is-this-the-correct-approach-of-taking-a-snapshop-of-an-indice-which-is-in-production/267526>\
**Category:** Elasticsearch\
**Created:** [March 17, 2021, 1:55pm UTC](https://discuss.elastic.co/t/is-this-the-correct-approach-of-taking-a-snapshop-of-an-indice-which-is-in-production/267526 "2021-03-17T13:55:24Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jax\_dev](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jax_dev/32/79117_2.png) [@Jax\_dev](https://discuss.elastic.co/u/Jax_dev)\
**Post date:** [March 17, 2021, 1:55pm UTC](https://discuss.elastic.co/t/is-this-the-correct-approach-of-taking-a-snapshop-of-an-indice-which-is-in-production/267526/1 "2021-03-17T13:55:25Z")

</div>

I have 4 different elastic nodes in a cluster.

Want to take a snapshot from one of the server which is having primary shard.

**Step 1:** sudo systemctl stop elasticsearch

**Step 2:** add `path.repo: ["/data/elasticbackup"]` in elasticsearch.yaml file.

**Step 3:** Give permission to the folder path sudo chmod 777 -R /data/elasticbackup

**Step 4:** sudo systemctl start elasticsearch

**`Will it join in the cluster automatically after starting the node ? What is the immediate activity we have to perform if node join fails?`**

**Step 5:** PUT request from postman to register snapshot

```
http://xx.xx.xx.xx:4200/_snapshot/elasticbackup

{
	"type":"fs",
	"settings": {
		"compress" : true,
		"location" : "/data/elasticbackup"
	}
	
}

```

**Step 6:** Validate weather snapshot has been registered or not.  
GET request from postman:  
[http://xx.xx.xx:4200/\_snapshot/\_all](http://xx.xx.xx:4200/_snapshot/_all)

```
output: 

{
    "elasticbackup": {
        "type": "fs",
        "settings": {
            "compress": "true",
            "location": "/data/elasticbackup"
        }
    }
}

```

**Step 7:** Take snapshop ( around 300 GB productioncustomerdata indices )

```
http://xx.xx.xx.xx:4200/_snapshot/elasticbackup/snapshot_1?wait_for_completion=true

input :
{
	
	 "indices": "productioncustomerdata"
}

```

Step 8: Delete existing primary indices - productioncustomerdata

`DELETE request - indices - http://xx.xx.xx.xx:4200/productioncustomerdata`

Are the above steps are correct? Or do we need to perform any other activity ?

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [March 17, 2021, 2:33pm UTC](https://discuss.elastic.co/t/is-this-the-correct-approach-of-taking-a-snapshop-of-an-indice-which-is-in-production/267526/2 "2021-03-17T14:33:41Z")

</div>

Snapshots are cluster wide so the repository need to be made available on all nodes at the same path.

---

<div class="post-metadata">

**Author:** ![Jax\_dev](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jax_dev/32/79117_2.png) [@Jax\_dev](https://discuss.elastic.co/u/Jax_dev)\
**Post date:** [March 17, 2021, 2:58pm UTC](https://discuss.elastic.co/t/is-this-the-correct-approach-of-taking-a-snapshop-of-an-indice-which-is-in-production/267526/3 "2021-03-17T14:58:55Z")

</div>

> [@Christian\_Dahlqvist](#):
>
> Snapshots are cluster wide so the repository need to be made available on all nodes at the same path.

Can we not take only particular indices eg: productioncustomerdata ? In my case indices ( productioncustomerdata ) primary shard is available in server4 and replica shard is available in server3.

I thought of updating path.repo only for server2 as primary is available there.

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [March 17, 2021, 3:16pm UTC](https://discuss.elastic.co/t/is-this-the-correct-approach-of-taking-a-snapshop-of-an-indice-which-is-in-production/267526/4 "2021-03-17T15:16:04Z")

</div>

You can take only individual indices but the repository still need to be configured on all master and data nodes.

---

<div class="post-metadata">

**Author:** ![Jax\_dev](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jax_dev/32/79117_2.png) [@Jax\_dev](https://discuss.elastic.co/u/Jax_dev)\
**Post date:** [March 17, 2021, 6:03pm UTC](https://discuss.elastic.co/t/is-this-the-correct-approach-of-taking-a-snapshop-of-an-indice-which-is-in-production/267526/5 "2021-03-17T18:03:18Z")

</div>

> [@Jax\_dev](#):
>
> **Step 2:** add `path.repo: ["/data/elasticbackup"]` in elasticsearch.yaml file.

ok understood. We have traffic 24/7, is there any possibility that we can do the above steps without downtime ?

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [March 17, 2021, 6:34pm UTC](https://discuss.elastic.co/t/is-this-the-correct-approach-of-taking-a-snapshop-of-an-indice-which-is-in-production/267526/6 "2021-03-17T18:34:19Z")

</div>

No, that change requires a restart but you can perform a rolling one. Note that shared storage is required and need to be mounted the same across all nodes.

---

<div class="post-metadata">

**Author:** ![Jax\_dev](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jax_dev/32/79117_2.png) [@Jax\_dev](https://discuss.elastic.co/u/Jax_dev)\
**Post date:** [March 18, 2021, 6:56am UTC](https://discuss.elastic.co/t/is-this-the-correct-approach-of-taking-a-snapshop-of-an-indice-which-is-in-production/267526/7 "2021-03-18T06:56:09Z")

</div>

currently shared storage is not mounted. Every node had their own storage. Is it recommended to have a shared storage for all the nodes in ES ? Any specific reason for this ?

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [March 18, 2021, 7:21am UTC](https://discuss.elastic.co/t/is-this-the-correct-approach-of-taking-a-snapshop-of-an-indice-which-is-in-production/267526/8 "2021-03-18T07:21:05Z")

</div>

Shared storage is a requirement for snapshot repositories. Nodes should however store their own data on local storage.

---

<div class="post-metadata">

**Author:** ![Jax\_dev](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jax_dev/32/79117_2.png) [@Jax\_dev](https://discuss.elastic.co/u/Jax_dev)\
**Post date:** [March 18, 2021, 3:20pm UTC](https://discuss.elastic.co/t/is-this-the-correct-approach-of-taking-a-snapshop-of-an-indice-which-is-in-production/267526/9 "2021-03-18T15:20:31Z")

</div>

Can we provide azure blob ? Our servers are hosted in azure vm’s.

Any documentation available if we want to provide azure blob storage ?

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [March 18, 2021, 3:25pm UTC](https://discuss.elastic.co/t/is-this-the-correct-approach-of-taking-a-snapshop-of-an-indice-which-is-in-production/267526/10 "2021-03-18T15:25:06Z")

</div>

There is an [Azure repository plugin](https://www.elastic.co/guide/en/elasticsearch/plugins/current/repository-azure.html) that you can install to take snapshots to Azure blob storage.

---

<div class="post-metadata">

**Author:** ![Jax\_dev](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jax_dev/32/79117_2.png) [@Jax\_dev](https://discuss.elastic.co/u/Jax_dev)\
**Post date:** [March 18, 2021, 10:06pm UTC](https://discuss.elastic.co/t/is-this-the-correct-approach-of-taking-a-snapshop-of-an-indice-which-is-in-production/267526/11 "2021-03-18T22:06:18Z")

</div>

I have tested it with azure blob storage as repo and working fine in the development env. I will perform the same in production. But before that,

We are making below api call to take the snapshot,  
`http://xx.xx.xx.x:4200/_snapshot/elasticbackupazure/e?wait_for_completion=true`

Provided query string `wait_for_completion=true` in the postman, We are taking the snapshot of indice which is having 350GB, will it really wait for the response in postman or will it request timeout? If request is timedout will the background job of taking snapshot continues ?

---

<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:** [April 15, 2021, 10:06pm UTC](https://discuss.elastic.co/t/is-this-the-correct-approach-of-taking-a-snapshop-of-an-indice-which-is-in-production/267526/12 "2021-04-15T22:06:26Z")

</div>

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