Primary and replica set question?

Hi,

I have run three nodes (on one laptop) and expected that by default only
one replica is going to be created (5 shards and one replica right?).

However when I run plugin head GUI I can see two replicas for shard 0 (“*Dragon
Man” as primary, *Frost, Deacon – replica, Stygorr - replica) – why?

Am I missing something?

Regards,

Janusz

--

On Fri, 2013-01-18 at 04:08 -0800, JD wrote:

Hi,

I have run three nodes (on one laptop) and expected that by default
only one replica is going to be created (5 shards and one replica
right?).

However when I run plugin head GUI I can see two replicas for shard 0
(“Dragon Man” as primary, Frost, Deacon – replica, Stygorr - replica)
– why?

Am I missing something?

I think so. If you have number_of_replicas set to 1, then you will have
a max of 1 replica per shard.

Have a look at the output of this request to get a better idea of what
is happening:

curl -XGET 'http://127.0.0.1:9200/_cluster/state?pretty=1'

It may be that it is moving a shard from one node to another, which is
why it appears twice

clint

--

Hi,
That is even more strage

On Friday, January 18, 2013 11:08:41 PM UTC+11, JD wrote:

Hi,

I have run three nodes (on one laptop) and expected that by default only
one replica is going to be created (5 shards and one replica right?).

However when I run plugin head GUI I can see two replicas for shard 0 (“*Dragon
Man” as primary, *Frost, Deacon – replica, Stygorr - replica) – why?

Am I missing something?

Regards,

Janusz

--

OK. I have three nodes and two of them are marked as primary (bold border
under plugin head Web GUI) – is that correct?

Regards,

Janusz

On Friday, January 18, 2013 11:08:41 PM UTC+11, JD wrote:

Hi,

I have run three nodes (on one laptop) and expected that by default only
one replica is going to be created (5 shards and one replica right?).

However when I run plugin head GUI I can see two replicas for shard 0 (“*Dragon
Man” as primary, *Frost, Deacon – replica, Stygorr - replica) – why?

Am I missing something?

Regards,

Janusz

--

Sorry. Just clarification.
Can I have few primary shards on a few nodes?
Regards,
Janusz

On Friday, January 18, 2013 11:08:41 PM UTC+11, JD wrote:

Hi,

I have run three nodes (on one laptop) and expected that by default only
one replica is going to be created (5 shards and one replica right?).

However when I run plugin head GUI I can see two replicas for shard 0 (“*Dragon
Man” as primary, *Frost, Deacon – replica, Stygorr - replica) – why?

Am I missing something?

Regards,

Janusz

--

Sorry. I have been looking across different indexes - my appology.
All good,
Regards,
Janusz

On Friday, January 18, 2013 11:08:41 PM UTC+11, JD wrote:

Hi,

I have run three nodes (on one laptop) and expected that by default only
one replica is going to be created (5 shards and one replica right?).

However when I run plugin head GUI I can see two replicas for shard 0 (“*Dragon
Man” as primary, *Frost, Deacon – replica, Stygorr - replica) – why?

Am I missing something?

Regards,

Janusz

--

JD wrote:

Sorry. I have been looking across different indexes - my appology.

We have a tool called es2unix[1] which has a shards command for quick
visualization of this type of data. Example from my laptop:

% curl -O download.elasticsearch.org/es2unix/es; chmod +x es
% ./es shards
wiki 0 p STARTED 1160290 7.2gb 7776371641 127.0.0.1 Feline
wiki 0 r STARTED 1160290 7.2gb 7776371602 127.0.0.1 Amphibius
wiki 0 r STARTED 1160290 7.2gb 7776371602 127.0.0.1 Jenkins, Abner
wiki 1 r STARTED 1159509 7.5gb 8116295811 127.0.0.1 Feline
wiki 1 p STARTED 1159509 7.5gb 8116295811 127.0.0.1 Amphibius
wiki 1 r STARTED 1159509 7.5gb 8116295811 127.0.0.1 Jenkins, Abner
foo 0 r STARTED 0 79b 79 127.0.0.1 Amphibius
foo 0 p STARTED 0 99b 99 127.0.0.1 Jenkins, Abner
foo 1 p STARTED 0 99b 99 127.0.0.1 Feline
foo 1 r STARTED 0 79b 79 127.0.0.1 Amphibius

You can quickly tell that all the shards belong to the wiki index.
If you just want the primaries that belong to foo:

% ./es shards fo | fgrep ' p '
foo 0 p STARTED 0 99b 99 127.0.0.1 Jenkins, Abner
foo 1 p STARTED 0 99b 99 127.0.0.1 Feline

Sometimes this is nicer than a graphical tool, especially over ssh.

-Drew

Footnotes:
[1] https://github.com/elasticsearch/es2unix

--