I've just started trying out Elastic Search 0.11.0. I start a node with 'bin/elasticsearch -f' (and all the defaults in bin/elasticsearch.in.sh') and it comes up fine. Then when I start up my java application which tries to connect, the first node I started from the command line trows out a 'java.lang.OutOfMemoryError: Java heap space' as soon as my application tries to joing the cluster.
I can start a second node and have it join the first successfully if the second node is also just an unzipped 0.11.0 distribution that I start with 'bin/elasticsearch -f,' but the node inside my java application just can't join without causing problems to the node its trying to join. I am using 0.11.0 on both the first node and in the java application.
Below is how I try to start up my node in java. All the config settings reflect those in the elasticsearch.yml of the node that starts from the command line.
private void initClient() {
NodeBuilder nb = NodeBuilder.nodeBuilder().client(true);
nb.settings().put("gateway.type", "fs");
nb.settings().put("gateway.fs.location", "/tmp/elasticsearch/gateway");
nb.settings().put("index.store.type", "mmapfs");
nb.settings().put("index.store.fs.mmapfs.enabled", "true");
nb.settings().put("index.merge.policy.merge_factor", "20");
nb.settings().put("path.work", "/tmp/elasticsearch2/work");
nb.settings().put("path.logs", "/tmp/elasticsearch2/logs");
nb.settings().put("discovery.zen.ping.unicast.hosts", "localhost:9300");
nb.settings().put("discovery.zen.ping.unicast.hosts", elasticSearchHostsList);
this.indexClient = nb.node().client(); //when this line executes, I get the error in the other node
}
This is really strange... . First, just a note regarding the configuration,
you don't need to configure index level configuration on the client side,
since you set it to client(true), no shards will be allocated to it, so it
won't need the configuration (like the store type, or merge factor).
If there are no indices, my best guess is different versions, just to be on
the safe side, can you add right at the start in your client:
Looks like your suspicion is right. Even though I have changed my mvn dependencies to the elastic search 0.11.0 jar, for some reason the old version must be sneaking in there. The line you suggested prints out:
elasticsearch/0.9.0
Thanks. I'l try to figure out where the 0.9 jar is sneaking into my project.
Looks like your suspicion is right. Even though I have changed my mvn
dependencies to the Elasticsearch 0.11.0 jar, for some reason the old
version must be sneaking in there. The line you suggested prints out:
elasticsearch/0.9.0
Thanks. I'l try to figure out where the 0.9 jar is sneaking into my
project.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.