If I set index.number_of_replica:1, then the minimum number of nodes should be 3 to assure that the status of the cluster is gree?

I have a cluster of two nodes, and set the configs for shard number and
replica number as following:

index.number_of_shards: 10

index.number_of_replicas: 1

The master node is elected automatically.

Before I index data, the state of the cluster is green. After I index data,
the state of the cluster becomes yellow. Some replica shards are not
allocated.

But if I add another node and now the cluster consists of three nodes, then
I index data and the state of the cluster becomes green.

The version of ES that I use is 1.1.

Question 1:
If the replica number is 1, do I have to have at least 3 nodes to
assure the state of the cluster is green?

Question 2:
I have observed that one (not the master node) of the three nodes just
has primary nodes. What's the mechanism ES uses to allocate primary/replia
shards?

Thanks anyway.

--
宠辱不惊,闲看庭前花开花落;去留无意,漫随天边云卷云舒。

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAKLbBG-o6JmkbPAAvGBP8t8Bdp-ONEWEFK5kGW%3Dcyn-h-O6dsg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

  1. No. Did you change the configuration? You have two data nodes connected?

  2. You do not need to be concerned where primary shards are allocated,
    secondary shards play the same role (except primaries receive writes first
    a few milliseconds earlier than secondaries). Elasticsearch randomly
    allocates shards on all the available nodes. If nodes go away, shards on
    remaining nodes are promoted to primaries automatically.

Jörg

On Fri, Jun 6, 2014 at 5:41 AM, flyer flyer103@gmail.com wrote:

I have a cluster of two nodes, and set the configs for shard number and
replica number as following:

index.number_of_shards: 10

index.number_of_replicas: 1

The master node is elected automatically.

Before I index data, the state of the cluster is green. After I index
data, the state of the cluster becomes yellow. Some replica shards are not
allocated.

But if I add another node and now the cluster consists of three nodes,
then I index data and the state of the cluster becomes green.

The version of ES that I use is 1.1.

Question 1:
If the replica number is 1, do I have to have at least 3 nodes to
assure the state of the cluster is green?

Question 2:
I have observed that one (not the master node) of the three nodes just
has primary nodes. What's the mechanism ES uses to allocate primary/replia
shards?

Thanks anyway.

--
宠辱不惊,闲看庭前花开花落;去留无意,漫随天边云卷云舒。

--
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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAKLbBG-o6JmkbPAAvGBP8t8Bdp-ONEWEFK5kGW%3Dcyn-h-O6dsg%40mail.gmail.com
https://groups.google.com/d/msgid/elasticsearch/CAKLbBG-o6JmkbPAAvGBP8t8Bdp-ONEWEFK5kGW%3Dcyn-h-O6dsg%40mail.gmail.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAKdsXoES%2Bd5gmo_OS-Si2dXLPGbk_q-B554WeL13HC0DfFY1vw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

The configurations on the two nodes are almost the same except the **
node.name**.

The first question is very strange.
I I run the same config on another cluster of two nodes and after I index
data, the state of the cluster is green. I have no idea why this
happened......Is there something I ignore?

I want to know how ES allocates nodes. Is there some reference? I googled
but couldn't find it.

Thank you :smiley:

On Fri, Jun 6, 2014 at 3:05 PM, joergprante@gmail.com <joergprante@gmail.com

wrote:

  1. No. Did you change the configuration? You have two data nodes connected?

  2. You do not need to be concerned where primary shards are allocated,
    secondary shards play the same role (except primaries receive writes first
    a few milliseconds earlier than secondaries). Elasticsearch randomly
    allocates shards on all the available nodes. If nodes go away, shards on
    remaining nodes are promoted to primaries automatically.

Jörg

On Fri, Jun 6, 2014 at 5:41 AM, flyer flyer103@gmail.com wrote:

I have a cluster of two nodes, and set the configs for shard number and
replica number as following:

index.number_of_shards: 10

index.number_of_replicas: 1

The master node is elected automatically.

Before I index data, the state of the cluster is green. After I index
data, the state of the cluster becomes yellow. Some replica shards are not
allocated.

But if I add another node and now the cluster consists of three nodes,
then I index data and the state of the cluster becomes green.

The version of ES that I use is 1.1.

Question 1:
If the replica number is 1, do I have to have at least 3 nodes to
assure the state of the cluster is green?

Question 2:
I have observed that one (not the master node) of the three nodes
just has primary nodes. What's the mechanism ES uses to allocate
primary/replia shards?

Thanks anyway.

--
宠辱不惊,闲看庭前花开花落;去留无意,漫随天边云卷云舒。

--
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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAKLbBG-o6JmkbPAAvGBP8t8Bdp-ONEWEFK5kGW%3Dcyn-h-O6dsg%40mail.gmail.com
https://groups.google.com/d/msgid/elasticsearch/CAKLbBG-o6JmkbPAAvGBP8t8Bdp-ONEWEFK5kGW%3Dcyn-h-O6dsg%40mail.gmail.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAKdsXoES%2Bd5gmo_OS-Si2dXLPGbk_q-B554WeL13HC0DfFY1vw%40mail.gmail.com
https://groups.google.com/d/msgid/elasticsearch/CAKdsXoES%2Bd5gmo_OS-Si2dXLPGbk_q-B554WeL13HC0DfFY1vw%40mail.gmail.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
宠辱不惊,闲看庭前花开花落;去留无意,漫随天边云卷云舒。

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAKLbBG-V0xGEe%3D0gL51-bAcsWMcy-sE8bHwHg_1z7NdEiHt_7w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

It's the ES version that causes the first problem.

In my previous test, one node use ES-1.1.1 and the other node use ES-1.1.2.
After I indexed data, the state of the cluster was yellow other than green.
I think there're some compatibility problems between the two versions.

Thank you very much :smiley:

On Fri, Jun 6, 2014 at 4:49 PM, flyer flyer103@gmail.com wrote:

The configurations on the two nodes are almost the same except the **
node.name**.

The first question is very strange.
I I run the same config on another cluster of two nodes and after I index
data, the state of the cluster is green. I have no idea why this
happened......Is there something I ignore?

I want to know how ES allocates nodes. Is there some reference? I googled
but couldn't find it.

Thank you :smiley:

On Fri, Jun 6, 2014 at 3:05 PM, joergprante@gmail.com <
joergprante@gmail.com> wrote:

  1. No. Did you change the configuration? You have two data nodes
    connected?

  2. You do not need to be concerned where primary shards are allocated,
    secondary shards play the same role (except primaries receive writes first
    a few milliseconds earlier than secondaries). Elasticsearch randomly
    allocates shards on all the available nodes. If nodes go away, shards on
    remaining nodes are promoted to primaries automatically.

Jörg

On Fri, Jun 6, 2014 at 5:41 AM, flyer flyer103@gmail.com wrote:

I have a cluster of two nodes, and set the configs for shard number and
replica number as following:

index.number_of_shards: 10

index.number_of_replicas: 1

The master node is elected automatically.

Before I index data, the state of the cluster is green. After I index
data, the state of the cluster becomes yellow. Some replica shards are not
allocated.

But if I add another node and now the cluster consists of three nodes,
then I index data and the state of the cluster becomes green.

The version of ES that I use is 1.1.

Question 1:
If the replica number is 1, do I have to have at least 3 nodes to
assure the state of the cluster is green?

Question 2:
I have observed that one (not the master node) of the three nodes
just has primary nodes. What's the mechanism ES uses to allocate
primary/replia shards?

Thanks anyway.

--
宠辱不惊,闲看庭前花开花落;去留无意,漫随天边云卷云舒。

--
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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAKLbBG-o6JmkbPAAvGBP8t8Bdp-ONEWEFK5kGW%3Dcyn-h-O6dsg%40mail.gmail.com
https://groups.google.com/d/msgid/elasticsearch/CAKLbBG-o6JmkbPAAvGBP8t8Bdp-ONEWEFK5kGW%3Dcyn-h-O6dsg%40mail.gmail.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAKdsXoES%2Bd5gmo_OS-Si2dXLPGbk_q-B554WeL13HC0DfFY1vw%40mail.gmail.com
https://groups.google.com/d/msgid/elasticsearch/CAKdsXoES%2Bd5gmo_OS-Si2dXLPGbk_q-B554WeL13HC0DfFY1vw%40mail.gmail.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
宠辱不惊,闲看庭前花开花落;去留无意,漫随天边云卷云舒。

--
宠辱不惊,闲看庭前花开花落;去留无意,漫随天边云卷云舒。

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAKLbBG8o%2BOvM8zOWh58bAmeH1iisq8xERTucw%2BJNktPDNkuuRw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

You must use same version throughout the cluster. Combination of different
versions is not always recognized and not warned, it will result in
unexpected behavior or strange error messages.

Jörg

On Fri, Jun 6, 2014 at 11:27 AM, flyer flyer103@gmail.com wrote:

It's the ES version that causes the first problem.

In my previous test, one node use ES-1.1.1 and the other node use
ES-1.1.2. After I indexed data, the state of the cluster was yellow other
than green. I think there're some compatibility problems between the two
versions.

Thank you very much :smiley:

On Fri, Jun 6, 2014 at 4:49 PM, flyer flyer103@gmail.com wrote:

The configurations on the two nodes are almost the same except the **
node.name**.

The first question is very strange.
I I run the same config on another cluster of two nodes and after I index
data, the state of the cluster is green. I have no idea why this
happened......Is there something I ignore?

I want to know how ES allocates nodes. Is there some reference? I googled
but couldn't find it.

Thank you :smiley:

On Fri, Jun 6, 2014 at 3:05 PM, joergprante@gmail.com <
joergprante@gmail.com> wrote:

  1. No. Did you change the configuration? You have two data nodes
    connected?

  2. You do not need to be concerned where primary shards are allocated,
    secondary shards play the same role (except primaries receive writes first
    a few milliseconds earlier than secondaries). Elasticsearch randomly
    allocates shards on all the available nodes. If nodes go away, shards on
    remaining nodes are promoted to primaries automatically.

Jörg

On Fri, Jun 6, 2014 at 5:41 AM, flyer flyer103@gmail.com wrote:

I have a cluster of two nodes, and set the configs for shard number and
replica number as following:

index.number_of_shards: 10

index.number_of_replicas: 1

The master node is elected automatically.

Before I index data, the state of the cluster is green. After I index
data, the state of the cluster becomes yellow. Some replica shards are not
allocated.

But if I add another node and now the cluster consists of three nodes,
then I index data and the state of the cluster becomes green.

The version of ES that I use is 1.1.

Question 1:
If the replica number is 1, do I have to have at least 3 nodes to
assure the state of the cluster is green?

Question 2:
I have observed that one (not the master node) of the three nodes
just has primary nodes. What's the mechanism ES uses to allocate
primary/replia shards?

Thanks anyway.

--
宠辱不惊,闲看庭前花开花落;去留无意,漫随天边云卷云舒。

--
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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAKLbBG-o6JmkbPAAvGBP8t8Bdp-ONEWEFK5kGW%3Dcyn-h-O6dsg%40mail.gmail.com
https://groups.google.com/d/msgid/elasticsearch/CAKLbBG-o6JmkbPAAvGBP8t8Bdp-ONEWEFK5kGW%3Dcyn-h-O6dsg%40mail.gmail.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAKdsXoES%2Bd5gmo_OS-Si2dXLPGbk_q-B554WeL13HC0DfFY1vw%40mail.gmail.com
https://groups.google.com/d/msgid/elasticsearch/CAKdsXoES%2Bd5gmo_OS-Si2dXLPGbk_q-B554WeL13HC0DfFY1vw%40mail.gmail.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
宠辱不惊,闲看庭前花开花落;去留无意,漫随天边云卷云舒。

--
宠辱不惊,闲看庭前花开花落;去留无意,漫随天边云卷云舒。

--
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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAKLbBG8o%2BOvM8zOWh58bAmeH1iisq8xERTucw%2BJNktPDNkuuRw%40mail.gmail.com
https://groups.google.com/d/msgid/elasticsearch/CAKLbBG8o%2BOvM8zOWh58bAmeH1iisq8xERTucw%2BJNktPDNkuuRw%40mail.gmail.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAKdsXoHu1fTJd9AmmU3Zh6%3DRkWcCvdnBx6CeNdFDCOmMoND6%2Bg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.