Tuesday, July 17, 2018

Fluentd error Cannot open connection to elasticsearch cluster

Leave a Comment

I have setup elasticsearch and kibana in my windows laptop and they both are working fine. I can access elasticsearch using 127.0.0.1:9200 and kibana at http://localhost:5601. I have installed fluentd in my ubuntu and below is the configuration file I am using:

<source>   @type tail   path /home/user/log.json   pos_file /home/user/log.json.pos   format json   time_format %Y-%m-%d %H:%M%:%S   tag logger </source>  <match *logger*>   @type elasticsearch   hosts 127.0.0.1:9200   index_name device   type_name randnum   id_key Count </match> 

When I am starting the fluentd which is monitoring a log file, I am getting the below error:

2018-06-16 15:36:56 +0000 [warn]: #0 got unrecoverable error in primary and no secondary error_class=Fluent::Plugin::ElasticsearchOutput::ConnectionFailure error="Can not reach Elasticsearch cluster ({:host=>\"127.0.0.1\", :port=>9200, :scheme=>\"http\"})!" 2018-06-16 15:36:56 +0000 [warn]: #0 bad chunk is moved to /tmp/fluent/backup/worker0/object_1152bdc/56ec41a04c21dcb239184388c1f0c1ec.log

Please can anyone help me with this.

Thanks

0 Answers

If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment