Elasticsearch indexing not working and error message: node null not part of the cluster Cluster [elasticsearch], ignoring -


i downloaded elastic search distribution , ran it.

curl 'localhost:9200'  {    "status" : 200,    "name" : "cbs",    "cluster_name" : "elasticsearch",    "version" : {    "number" : "1.4.1",    "build_hash" : "89d3241d670db65f994242c8e8383b169779e2d4",    "build_timestamp" : "2014-11-26t15:49:29z",    "build_snapshot" : false,    "lucene_version" : "4.10.2"     },   "tagline" : "you know, search" } 

and trying access using spring-data. added following lines in application-context (as per spring data documentation) xml namespace:

<elasticsearch:repositories base-package="com.cbs" /> <elasticsearch:transport-client id="client" cluster-nodes="127.0.0.1:9300" cluster-name="elasticsearch" /> <bean name="elasticsearchtemplate" class="org.springframework.data.elasticsearch.core.elasticsearchtemplate">     <constructor-arg name="client" ref="client" /> </bean> 

here entity , repository code:

@org.springframework.data.elasticsearch.annotations.document(indexname = "product", type = "product", shards = 1, replicas = 0, indexstoretype = "memory", refreshinterval = "-1") public class product {     @id     private string id;         private string name; }   @repository public class productsearchdaoimpl implements iproductsearchdao { @autowired private elasticsearchoperations elasticsearchoperations;  @override public void index(product product) {     elasticsearchoperations.createindex(product.class);     elasticsearchoperations.putmapping(product.class);     indexquery indexquery = new indexquerybuilder().withid(product.getid()).withobject(product).build();     elasticsearchoperations.index(indexquery);     elasticsearchoperations.refresh(product.class, true); } } 

now when run test case index product, getting consistent warning message (every 2 seconds or so)

[neuronne] node null not part of cluster cluster [elasticsearch], ignoring... [neuronne] node null not part of cluster cluster [elasticsearch], ignoring... 

and product not getting indexed (even index not created)

curl 'localhost:9200/_cat/indices?v' health status index    pri rep docs.count docs.deleted store.size pri.store.size  

can me out this?

for met same error , came here search engines, make sure transportclient using same cluster name cluster itself.

  1. verify cluster name.

visit http://localhost:9200 check cluster name. default name elasticsearch. if customised cluster name using elasticsearch.yml file, make sure config file picked up.

  1. set culster.name when creating transportclient.

    settings settings = immutablesettings.settingsbuilder()         .put("cluster.name", clustername)         .put("client.transport.ignore_cluster_name", false)         .put("node.client", true)         .put("client.transport.sniff", true)         .build(); client = new transportclient(settings).addtransportaddress(new  inetsockettransportaddress(host, port));  
  2. ignore cluster name check

you can ignore check of cluster name setting client.transport.ignore_cluster_name true.

  1. debug if error still exists

if error still exists, launch application in debug mode, , debug transportclientnodesservice.


Comments

Popular posts from this blog

matlab - "Contour not rendered for non-finite ZData" -

delphi - Indy UDP Read Contents of Adata -

qt - How to embed QML toolbar and menubar into QMainWindow -