Plugin [sample] is incompatible with Elasticsearch [2.4.1]. Was designed for version [2.3.3]


(Sandeep Verma) #1

I m new in elasticsearch.Trying to create a plugin for elasticsearch.
Got a sample code from
https://codeload.github.com/codelibs/elasticsearch-plugin-sample/zip/master
after build with maven got error
ERROR: Plugin [sample] is incompatible with Elasticsearch [2.4.1]. Was designed for version [2.3.3].
Please help to solve this issue.


(David Pilato) #2

You want to read: https://www.elastic.co/guide/en/elasticsearch/plugins/current/plugin-authors.html


(Sandeep Verma) #3

thanks for suggestion now my plugin is working.
But i have a problem when start elasticsearch after installed my plugin it give a exception Exception in thread "main" ElasticsearchException[failed to load custom hash function [org.elasticsearch.plugin.direct.DirectRoutingHash]
Please suggest what i m doing wrong.
some change in my elasticsearch.yml
cluster.routing.operation.hash.type: org.elasticsearch.plugin.direct.DirectRoutingHash


(David Pilato) #4

I gave a quick look at your code here: https://github.com/codelibs/elasticsearch-plugin-sample/

Note that it has not been updated for 2.4.

I don't know what is wrong.

But what is this org.elasticsearch.plugin.direct.DirectRoutingHash class? It's not in your code, right?


(Sandeep Verma) #5

Actually i m facing a problem with routing and shard. i have 20 shard but when my code send routing value 0- 20 ,there are lots of shard empty on elasticsearch .so i am trying to create a plugin with the help of sample plugin code which send routing value to the particular shard.
please suggest if you have any other solution.
thanks


(Jörg Prante) #6

If you want to send data to a specific shard, and you want to address 20 shards, why don't you simply use 20 indices with one shard each?


(Sandeep Verma) #7

Hi jorg
Thanks for suggestion, but my use case is different where I can't apply this methodology to create number of indices.please suggest me ,is there any way to create one indices and one type but my docs are distributed equally along all shards using routing key.


(David Pilato) #8

What is your use case?


(Sandeep Verma) #9

Actually this is not for development it is for production.i wanted to upgrade elasticsearch to 1.7 to 2.4.our data is equally distributed over production with the help of direct routing plugin but when I upgrade it to 2.4 there are lots of shard are empty and we are not able to change any method on production.so we have only choice to upgrade our plugin and move all data.


(David Pilato) #10

Why do you use routing in the first place?


(Jörg Prante) #11

From what I understand, @Sandeep_Verma wants to use a numbering scheme trying to map the routing parameter of a document https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-routing-field.html to a shard ID, which is not possible because of hashing.


(Jörg Prante) #12

Can you show the source code of the plugin?

Note that Elasticsearch by default maps documents equally distributed to shards, so I wonder what the purpose of your so-called "direct routing" is. Fact is, Elasticsearch does direct routing by hashing doc IDs to shard IDs.

In Elasticsearch philosophy, clients must not have intimate knowledge how the cluster routes documents by hashing internally. The only method is giving a "routing key" as input, which is hashed. This is important, because shard count is internal, and also, internal hashing algorithm may change from major version to version.


(David Pilato) #13

Sure. But what for? What problem is he trying to solve by doing so?
I probably misunderstand the problem.


(Sandeep Verma) #14

You can see plugin code here


(system) #15