Elasticserach health

(Sandy) #1

Hi all,
I have ELK stack that installed on one server. And my elastic health is yellow.
From many post that i saw, i need to make a new elastic to be a new node, so the shard can be allocated which i had problem to found the solution as how to connect two node, and how to allocated the shard.

If i want to make the elastic stand alone, can we make the health status green? What i had learnt that just declare the elastic shard into 0. is it true? and may i know how?
Any help would be greatly appreciated. Thanks in advanced

(Tek Chand) #2


Yes..its one primary solution for your issue.

When you create new node you need to define your cluster name in elasticserach.yml file. Your node will join the cluster automatically to the cluster. Port 9200 and 9300 should be open at your all elasticsearch node.

Yes...You need to set replica value to 0 (zero) for your indexes.


(Sandy) #3

Thanks for replying

i already did what you said, defining transport.tcp.port and to make the two nodes communicating each other i also need to edit zen.ping (correct me if im wrong) but in my cluster i only see one node.

transport.tcp.port: 9300
discovery.zen.ping.unicast.hosts: ["hostA:9200", "hostB:9200"]

is this the correct one to define the shard (i added it at elasticsearch.yml)? because my elastic got error after i restart it. and if i only had 2 node, is it possible to have 5 shard? or should i had 5 node to had 5 shard?

index.number_of_shards: 0
index.number_of_replicas: 1

Thank you.

(Tek Chand) #4

This feature support only up ES2.0. In ES>=5.0 you can't use it. If you do it your service will be not start.

Yes, in 2 node cluster also you can have 5 shards. But it will be too large. You should go with 3 shards and use 3 node for cluster to avoid split brain problem. You need to make changes in template to set the value of shards and replica.

You can refer below link to understand what is split brain problem:


Can you please open the port 9200 and 9300 using UFW command instead of using configuration file on both the elasticsearch nodes?

No need to define port number in discovery.zen.ping.unicast. Only IP or Hostname are enough.


(Sandy) #5

i have problem how to configure the the shard. should i changed it via Dev Tools?
and what kind of code should i execute, only for defining the shard? i'm not good at it.

And i already get the point for all the solution you gave above.

(Tek Chand) #6

Yes..you can use Dev Tool. You can create separate template for each index. Use the below format:

PUT _template/csv
  "index_patterns": "csv-*",
  "settings": {
    "number_of_shards": 2,
    "number_of_replicas": 1


(Sandy) #7

That's a huge help.
What i found later was its not possible to set shards into 0. Is it not possible to make the elastic stand alone now?


(Tek Chand) #8

@Sandy, You can't set shards value to zero. You need at least one shard. You can set replica to zero. If you are using only for testing and learning purpose you can set replica value to zero. But in production you should use 3 node with replica 1.

(Sandy) #9

Ah... so thats the reason.
Thanks for the info and helping me :slightly_smiling_face:

(system) #11

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.