You only have a single data node, yet your indexes are configured to have replicas. That creates an impossible situation since ES refuses to allocate the primary shard and replica shards on the same node. Either add a node so that you can have replicas or disable replicas. When the number of unassigned shards drops to zero the cluster will go green.
I was wondering why do i have number of nodes: 2 when i am running it on a single machine. I read up on the net that it's foolhardy to disable replicas. But currently i can run it on a single machine only. Is there a way i can maintain it well on a single machine or disabling replicas is the only way to go about it.
Also i haven't worked on configuration of Elasticsearch, suppose if i do end up running it on two machines. How can i control which one is master and which one is replica. I can use one more machine but i want to put minimal processing on it.
Thanks again.
@colings86 (maybe you have a few pointers on this)
I was wondering why do i have number of nodes: 2 when i am running it on a single machine.
Perhaps Logstash is connecting using the node protocol? That would certainly explain why you have two nodes but only one data node.
I read up on the net that it's foolhardy to disable replicas. But currently i can run it on a single machine only. Is there a way i can maintain it well on a single machine or disabling replicas is the only way to go about it.
You could run multiple ES nodes on the same physical machine, but why would you want to do that? If the machine goes down all your data is unavailable either way. It basically just adds overhead.
Also i haven't worked on configuration of Elasticsearch, suppose if i do end up running it on two machines. How can i control which one is master and which one is replica.
ES dynamically chooses which node is the master node (there are no replica nodes, only replica shards). Apart from being able to configure a node to not want to become a master you can't affect the mastership election. Same thing with primary and replica shards; there are times when you want control over that but it's unusual and for now you should stick to the program and don't worry about it.
As discussed in a recent thread here, you should never have two master-eligible nodes. With two nodes it's wise to disable mastership for one of them, or jump directly to three nodes (where all are master-eligible).
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.