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?
No. Did you change the configuration? You have two data nodes connected?
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.
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?
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.
No. Did you change the configuration? You have two data nodes connected?
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.
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?
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.
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.
No. Did you change the configuration? You have two data nodes
connected?
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.
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?
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.
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.
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.
No. Did you change the configuration? You have two data nodes
connected?
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.
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?
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.