How to fix this elasticsearch code exception error

I am currently working with elasticsearch, logstash and kibana.

I get an exception that I cannot get through.

first, this is what i get when i put ip: 9200 / _cluster / health in my browser.

{ "cluster_name":"mr-cluster", "status":"yellow", "timed_out":false, "number_of_nodes":1, "number_of_data_nodes":1, "active_primary_shards":5, "active_shards":5, "relocating_shards":0, "initializing_shards":0, "unassigned_shards":5 } 

This is what the kibana gets when trying to request an elastic search

 Remote Address:ip:9200 Request ip:9200/_all/_search Request Method:POST Status Code:200 OK 

Everything seems to be fine so far.

Here is my logstash configuration file:

 input { gelf { port => "5000" } udp { port => "5001" } } output { file { path => "/home/g/stdout.log" } elasticsearch { cluster => "mr-cluster" codec => "json" } } 

Something pretty simple when I use only the file as it works fine, logstash works. The problem is when I want to use elasticsearch as output, nothing else works (the output of the event file), and I get this exception from elasticsearch. I searched Google for many hours and couldn’t find a solution.

Here is the exception:

 [2014-05-21 09:18:35,060][WARN ][http.netty ] [mr-node-elasticsearch] Caught exception while handling client http traffic, closing connection [id: 0x27d0ccce, /0:0:0:0:0:0:0:1:44164 => /0:0:0:0:0:0:0:1:9200] java.lang.IllegalArgumentException: empty text at org.elasticsearch.common.netty.handler.codec.http.HttpVersion.<init>(HttpVersion.java:97) at org.elasticsearch.common.netty.handler.codec.http.HttpVersion.valueOf(HttpVersion.java:62) at org.elasticsearch.common.netty.handler.codec.http.HttpRequestDecoder.createMessage(HttpRequestDecoder.java:75) at org.elasticsearch.common.netty.handler.codec.http.HttpMessageDecoder.decode(HttpMessageDecoder.java:189) at org.elasticsearch.common.netty.handler.codec.http.HttpMessageDecoder.decode(HttpMessageDecoder.java:101) at org.elasticsearch.common.netty.handler.codec.replay.ReplayingDecoder.callDecode(ReplayingDecoder.java:500) at org.elasticsearch.common.netty.handler.codec.replay.ReplayingDecoder.messageReceived(ReplayingDecoder.java:435) at org.elasticsearch.common.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70) at org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564) at org.elasticsearch.common.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791) at org.elasticsearch.common.netty.OpenChannelsHandler.handleUpstream(OpenChannelsHandler.java:74) at org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564) at org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:559) at org.elasticsearch.common.netty.channel.Channels.fireMessageReceived(Channels.java:268) at org.elasticsearch.common.netty.channel.Channels.fireMessageReceived(Channels.java:255) at org.elasticsearch.common.netty.channel.socket.nio.NioWorker.read(NioWorker.java:88) at org.elasticsearch.common.netty.channel.socket.nio.AbstractNioWorker.process(AbstractNioWorker.java:108) at org.elasticsearch.common.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:318) at org.elasticsearch.common.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:89) at org.elasticsearch.common.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178) at org.elasticsearch.common.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108) at org.elasticsearch.common.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:744) 

Thank you for helping the guys!

+7
elasticsearch logstash kibana
source share
4 answers

when I got this error, I changed the port from 9200 to 9300. Hope this works for you.

Note: I'm starting to look for elasticsearch.

maybe this will NOT solve your problem, but it will probably help other beginners who have searched for the same error message and have been led to this page.

+4
source share

The elasticsearch configuration method (using the cluster name only) triggers multicast cluster discovery. You can try setting up in the cluster directly to see if this works:

 elasticsearch { host=>"ip_here" port=>9200 protocol=>http } 

Also, your output in the cluster said that your cluster is in the “yellow” state, so you may need to find out what is happening there, you want it to be “green”.

+2
source share

The error I made was in configuring Elastic instances for unicast detection. I inadvertently added port number 9200 to the configuration of the list of unicast hosts.

Wrong:

 discovery.zen.ping.multicast.enabled: false discovery.zen.ping.unicast.hosts: ["localhost.localdomain:9200"] 

Correctly:

 discovery.zen.ping.multicast.enabled: false discovery.zen.ping.unicast.hosts: ["localhost.localdomain"] 
+1
source share

Changing the port to 9300 works fine. But it’s better to check the search services. It can happen. And indexing will not happen, therefore, this is an exception. I also start up to the ELK stack.

Also, if you do not want to change ports, then go to each elasticsearch node and run /etc/init.d/elasticsearch start

0
source share

All Articles