# Clarifications regarding # of shards / shard replication

**URL:** <https://discuss.elastic.co/t/clarifications-regarding-of-shards-shard-replication/11495>\
**Category:** Elasticsearch\
**Created:** [April 9, 2013, 7:19am UTC](https://discuss.elastic.co/t/clarifications-regarding-of-shards-shard-replication/11495 "2013-04-09T07:19:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rakesh\_usenet](https://avatars.discourse-cdn.com/v4/letter/r/e0b2c6/32.png) [@rakesh\_usenet](https://discuss.elastic.co/u/rakesh_usenet)\
**Post date:** [April 9, 2013, 7:19am UTC](https://discuss.elastic.co/t/clarifications-regarding-of-shards-shard-replication/11495/1 "2013-04-09T07:19:35Z")

</div>

I was running an elasticsearch cluster of 1 ( ?? ) that was running out of  
disk space.

node.master: true  
node.data: true

Only 1 node.

Added another one, to the cluster

node.master: false  
node.data: true

Also, disabled multi-cast discovery and set unicast discovery

discovery.zen.ping.multicast.enabled: false  
discovery.zen.ping.unicast.hosts: ["10.138.150.61"]

The discovery happened ( after port 9300 is also opened for data  
communication as well).

Ironically now, the disk usage in both the machines is the same ( ~47 G ) .  
Which I assume is because the replication is completed on the second box .  
But I brought in the second box, to account for future load and not for  
copying the existing index .

Now, how would do I

- How many shards does an index have ? Api call to figure out the same ? (  
I did not set the default. 0.20.6 elasticsearch) - so i assume it is 5 per  
documentation) . But I do want to verify it now the index is in live.

- Between nodes, I do not want the shards' copy to be replicated again.

How would I achieve the same ? ( Which es.yml property keys should I use ?  
) .

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [April 9, 2013, 12:05pm UTC](https://discuss.elastic.co/t/clarifications-regarding-of-shards-shard-replication/11495/2 "2013-04-09T12:05:58Z")

</div>

> Ironically now, the disk usage in both the machines is the same ( ~47  
> G ) . Which I assume is because the replication is completed on the  
> second box .

Correct 🙂

Your index was created with 5 primary shards, each with 1 replica, but  
the replicas weren't assigned because you only had one node.

> But I brought in the second box, to account for future load and not  
> for copying the existing index .

> - How many shards does an index have ? Api call to figure out the  
> same ? ( I did not set the default. 0.20.6 elasticsearch) - so i  
> assume it is 5 per documentation) . But I do want to verify it now the  
> index is in live.

Various ways, but this is probably the simplest:

curl -XGET '[http://127.0.0.1:9200/\_cluster/health?level=indices&pretty=1](http://127.0.0.1:9200/_cluster/health?level=indices&pretty=1)'

> - Between nodes, I do not want the shards' copy to be replicated  
> again.

If you were to add a third node, then your primary and replica shards  
would be redistributed, so you'd have (5 \* 2 = 10 shards) / 3 nodes = 3  
or 4 shards per node.

However, if you don't want replicas (you don't care about data loss if a  
machine dies), then you can just turn them off.

curl -XPUT '[http://127.0.0.1:9200/my\_index/\_settings?pretty=1](http://127.0.0.1:9200/my_index/_settings?pretty=1)' -d '  
{  
"index" : {  
"number\_of\_replicas" : 0  
}  
}  
'

clint

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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:** [July 6, 2017, 2:42am UTC](https://discuss.elastic.co/t/clarifications-regarding-of-shards-shard-replication/11495/3 "2017-07-06T02:42:05Z")

</div>


