I was working to configure logstash and elasticsearch. In my logstash config file output section.
elasticsearch {
codec => json_lines
cluster => "firstEsearch_cluster"
protocol => "http"
host => "192.168.56.3"
port => "9200"
}
If I do this, I'm able to communicate to the elasticsearch instance
But now I have multiple nodes for elasticsearch on various machines where I replicate data to recover from failure and machines are in the same network.
Now when my machine 192.168.56.3
failed and 192.168.56.4
and 192.168.56.5
were running other nodes of elasticsearch, wasn't able to send logs to elasticsearch cluster, since machine 192.168.56.3
was down. So
- What should be the output configuration for logstash, so that I can still send the logs to elasticsearch cluster, when one of the machine goes down
When I tried to do this:
elasticsearch {
codec => json_lines
cluster => "firstEsearch_cluster"
protocol => "http"
#host => "192.168.56.3"
#port => "9200"
}
logstash wasn't able to connect to elasticsearch instance, and wasn't able to send logs.