Allocating shards and replicas


(BARNEY) #1

Hi,

When I create index with two shards and one replica,we have two
primary shards(assigned) and two unassigned replicas.
If I add the another node to the cluster,How can I distribute one
primary shard of first node to primary shard of second node and both
have replicas of other node's primary shards?
(With default settings it is assigning two replicas two second node)

Thanks,
Kalyan


(Shay Banon) #2

There isn't really a meaning to have primary shards evenly distributed.
Indexing goes to the primary shard and the replica, and searches can
execute on both.

On Wed, Nov 16, 2011 at 3:01 PM, kalyan kalyanc007@gmail.com wrote:

Hi,

When I create index with two shards and one replica,we have two
primary shards(assigned) and two unassigned replicas.
If I add the another node to the cluster,How can I distribute one
primary shard of first node to primary shard of second node and both
have replicas of other node's primary shards?
(With default settings it is assigning two replicas two second node)

Thanks,
Kalyan


(avinash.nalluri) #3

When I have two nodes running,created index with two shards and one replica
then node one has one primary shard and replica of second node's primary
shard.The second node also has one primary shard and replica of the first
node's primary shard.
If I restart one node then primary shards are allocating on the single node
only and both replicas are creating on another node.But even after
restarting also it has to distribute like what happened previously.
How to achieve this?

On Wed, Nov 16, 2011 at 8:01 PM, Shay Banon kimchy@gmail.com wrote:

There isn't really a meaning to have primary shards evenly distributed.
Indexing goes to the primary shard and the replica, and searches can
execute on both.

On Wed, Nov 16, 2011 at 3:01 PM, kalyan kalyanc007@gmail.com wrote:

Hi,

When I create index with two shards and one replica,we have two
primary shards(assigned) and two unassigned replicas.
If I add the another node to the cluster,How can I distribute one
primary shard of first node to primary shard of second node and both
have replicas of other node's primary shards?
(With default settings it is assigning two replicas two second node)

Thanks,
Kalyan


(system) #4