Skip to content

Commit

Permalink
Merge pull request #2 from mguillermin/clustername
Browse files Browse the repository at this point in the history
Make elasticsearch cluster name configurable
  • Loading branch information
mguillermin committed Jun 28, 2012
2 parents 08612fc + 4a0e337 commit f75e584
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Expand Up @@ -65,6 +65,9 @@ public void start() throws Exception {
else
{
settings.put("client.transport.sniff", true);
if (IndexConfig.clusterName != null) {
settings.put("cluster.name", IndexConfig.clusterName);
}
settings.build();

Logger.info("ElasticSearch : Starting in Client Mode");
Expand Down
Expand Up @@ -16,6 +16,7 @@
* example :
* elasticsearch.local=false
* elasticsearch.client="192.168.0.46:9300"
* elasticsearch.cluster.name=myCluster
* elasticsearch.index.name=play2-elasticsearch
* elasticsearch.index.clazzs="indexing.*"
* elasticsearch.index.show_request=true
Expand All @@ -33,6 +34,11 @@ public class IndexConfig {
*/
public static String client = null;

/**
* elasticsearch.cluster.name = name of the elasticsearch cluster
*/
public static String clusterName = null;

/**
* Debug mode for log search request and response
*/
Expand Down Expand Up @@ -62,6 +68,7 @@ public IndexConfig(Application app) {
this.application = app;
this.client = app.configuration().getString("elasticsearch.client");
this.local = app.configuration().getBoolean("elasticsearch.local");
this.clusterName = app.configuration().getString("elasticsearch.cluster.name");

this.indexName = app.configuration().getString("elasticsearch.index.name");
this.indexClazzs = app.configuration().getString("elasticsearch.index.clazzs");
Expand Down

0 comments on commit f75e584

Please sign in to comment.