0

I am using Storm 1.1.0 and Elasticsearch 5.5. I want to store my tuples from Storm in ES and for this I used the native Storm library for Elastic.

My POM.xml entry:

    <dependency>
        <groupId>org.apache.storm</groupId>
        <artifactId>storm-elasticsearch</artifactId>
        <version>1.1.0</version>
    </dependency>       

I initiate my ElasticBolt as follows:

EsConfig esConfig = new EsConfig("elasticseach", new String[]{"localhost:9200"});
EsTupleMapper tupleMapper = new MyMapper(); //custom mapper
EsIndexBolt indexBolt = new EsIndexBolt(esConfig, tupleMapper);

When I run my topology, the storage bolt throws this error at me:

    20101 [Thread-24-EsPersistence-executor[1 1]] ERROR o.a.s.d.executor - 
org.elasticsearch.client.transport.NoNodeAvailableException: None of the configured nodes are available: []
    at org.elasticsearch.client.transport.TransportClientNodesService.ensureNodesAreAvailable(TransportClientNodesService.java:305) ~[elasticsearch-1.6.0.jar:?]
    at org.elasticsearch.client.transport.TransportClientNodesService.execute(TransportClientNodesService.java:200) ~[elasticsearch-1.6.0.jar:?]
    at org.elasticsearch.client.transport.support.InternalTransportClient.execute(InternalTransportClient.java:106) ~[elasticsearch-1.6.0.jar:?]
    at org.elasticsearch.client.support.AbstractClient.index(AbstractClient.java:102) ~[elasticsearch-1.6.0.jar:?]
    at org.elasticsearch.client.transport.TransportClient.index(TransportClient.java:340) ~[elasticsearch-1.6.0.jar:?]
    at org.elasticsearch.action.index.IndexRequestBuilder.doExecute(IndexRequestBuilder.java:266) ~[elasticsearch-1.6.0.jar:?]
    at org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:91) ~[elasticsearch-1.6.0.jar:?]
    at org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:65) ~[elasticsearch-1.6.0.jar:?]
    at org.apache.storm.elasticsearch.bolt.EsIndexBolt.process(EsIndexBolt.java:65) [storm-elasticsearch-1.1.0.jar:1.1.0]
    at org.apache.storm.topology.base.BaseTickTupleAwareRichBolt.execute(BaseTickTupleAwareRichBolt.java:38) [storm-core-1.1.0.jar:1.1.0]
    at org.apache.storm.daemon.executor$fn__5044$tuple_action_fn__5046.invoke(executor.clj:727) [storm-core-1.1.0.jar:1.1.0]
    at org.apache.storm.daemon.executor$mk_task_receiver$fn__4965.invoke(executor.clj:459) [storm-core-1.1.0.jar:1.1.0]
    at org.apache.storm.disruptor$clojure_handler$reify__4480.onEvent(disruptor.clj:40) [storm-core-1.1.0.jar:1.1.0]
    at org.apache.storm.utils.DisruptorQueue.consumeBatchToCursor(DisruptorQueue.java:472) [storm-core-1.1.0.jar:1.1.0]
    at org.apache.storm.utils.DisruptorQueue.consumeBatchWhenAvailable(DisruptorQueue.java:451) [storm-core-1.1.0.jar:1.1.0]
    at org.apache.storm.disruptor$consume_batch_when_available.invoke(disruptor.clj:73) [storm-core-1.1.0.jar:1.1.0]
    at org.apache.storm.daemon.executor$fn__5044$fn__5057$fn__5110.invoke(executor.clj:846) [storm-core-1.1.0.jar:1.1.0]
    at org.apache.storm.util$async_loop$fn__557.invoke(util.clj:484) [storm-core-1.1.0.jar:1.1.0]
    at clojure.lang.AFn.run(AFn.java:22) [clojure-1.7.0.jar:?]
    at java.lang.Thread.run(Thread.java:748) [?:1.8.0_144]

At first sight it would seem the library does not support Elastic 5.5 and it needs Elastic 1.6 but after looking at the pom.xml of the storm-elasticsearch library, they actually use ES 5.X

<properties>
    <elasticsearch.version>5.2.2</elasticsearch.version>
    <elasticsearch.test.version>2.4.4</elasticsearch.test.version>
</properties>

See https://github.com/apache/storm/blob/master/external/storm-elasticsearch/pom.xml

What am I missing in my setup here? And does storm-elasticsearch really support Elastic 5.5?

Edit:

From ES's own logs I get the following error message:

[2017-08-19T22:21:01,093][WARN ][o.e.t.n.Netty4Transport  ] [node-1] exception caught on transport layer [[id: 0xfe71a901, L:/10.0.4.70:9300 - R:/10.0.200.6:36344]], closing connection
java.lang.IllegalStateException: Received message from unsupported version: [1.0.0] minimal compatible version is: [5.0.0]
        at org.elasticsearch.transport.TcpTransport.messageReceived(TcpTransport.java:1379) ~[elasticsearch-5.5.0.jar:5.5.0]
        at org.elasticsearch.transport.netty4.Netty4MessageChannelHandler.channelRead(Netty4MessageChannelHandler.java:74) ~[transport-netty4-5.5.0.jar:5.5.0]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [netty-transport-4.1.11.Final.jar:4.1.11.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [netty-transport-4.1.11.Final.jar:4.1.11.Final]
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [netty-transport-4.1.11.Final.jar:4.1.11.Final]
        at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:310) [netty-codec-4.1.11.Final.jar:4.1.11.Final]
        at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:297) [netty-codec-4.1.11.Final.jar:4.1.11.Final]
        at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:413) [netty-codec-4.1.11.Final.jar:4.1.11.Final]
        at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:265) [netty-codec-4.1.11.Final.jar:4.1.11.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [netty-transport-4.1.11.Final.jar:4.1.11.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [netty-transport-4.1.11.Final.jar:4.1.11.Final]
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [netty-transport-4.1.11.Final.jar:4.1.11.Final]
        at io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:86) [netty-transport-4.1.11.Final.jar:4.1.11.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [netty-transport-4.1.11.Final.jar:4.1.11.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [netty-transport-4.1.11.Final.jar:4.1.11.Final]
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [netty-transport-4.1.11.Final.jar:4.1.11.Final]
        at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1334) [netty-transport-4.1.11.Final.jar:4.1.11.Final]
Mnemosyne
  • 1,162
  • 4
  • 13
  • 45

1 Answers1

1

Use port 9300 insteed (default controll port). 9200 is default port for REST calls.

Antoniossss
  • 31,590
  • 6
  • 57
  • 99
  • I made the change you suggested but the error persists. Is Storm at all compatible with Elastic 5.X? – Mnemosyne Aug 19 '17 at 20:22
  • This is something I dont know, but error is comming from underlying elasticsearch client so my guess is a missconfiguration. Mb elastic is not running at all. Do you have configured cluster named "elasticsearch" ??(that is default cluster name). – Antoniossss Aug 19 '17 at 20:31
  • Hi, yes, the cluster is running. I have been checking the health continuously. "elasticsearch" is also its name so that is correct too. What surprises me is why it mentions the 1.6 jar. How is that relevant? – Mnemosyne Aug 19 '17 at 20:35
  • hmm in general for ES version X you should use ESClient version X. As it is difference of 5 versions, it is possible that transport layer has changed and is not compatible anymore. Try plain ES client ver 5.x on a side. If it works, with same settings, you are out of luck. If still not - configuration issue. – Antoniossss Aug 19 '17 at 20:37
  • I am not entirely sure by what you mean with "Try plain ES client ver 5.x on a side". I tried to add a record through the command line though, same settings (only port 9200 instead of 9300) and it worked fine, the record was added. – Mnemosyne Aug 19 '17 at 20:45
  • Check the official plain ES client for java and see if you can connect on 9300. https://www.elastic.co/guide/en/elasticsearch/client/java-api/current/index.html – Antoniossss Aug 19 '17 at 20:49
  • I checked at the logs for Elastic and the error log on their end is interesting: ```[2017-08-19T22:21:01,093][WARN ][o.e.t.n.Netty4Transport ] [node-1] exception caught on transport layer [[id: 0xfe71a901, L:/10.0.4.70:9300 - R:/10.0.200.6:36344]], closing connection java.lang.IllegalStateException: Received message from unsupported version: [1.0.0] minimal compatible version is: [5.0.0] ``` Does this point to a library incompatibility? – Mnemosyne Aug 19 '17 at 20:57
  • What is it? You didnt append that anywhere – Antoniossss Aug 19 '17 at 20:58
  • sorry, I hit send by mistake. I pasted the whole error stacktrace in the post. – Mnemosyne Aug 19 '17 at 21:00
  • And you got your answer. Incompatible versions. Try to include ES transport 5.x to your project and exclude it from storm-elasticsearch. It may work, but most likely will not. In that case, if storm is has no dedicated version for ES5, you are out of luck and this will not work. You will have to do everything by hand. REST client is much more backward compatible, maybe storm has some ports for ES that uses REST under the hood insteed of plain transport client. – Antoniossss Aug 19 '17 at 21:02
  • Damn. I will have to look for a workaround or switch to hadoop-elastic. Thanks for your help anyway :) – Mnemosyne Aug 19 '17 at 21:43