Skip to content

Instantly share code, notes, and snippets.

@dav-rob
Created May 27, 2011 16:54
Show Gist options
  • Save dav-rob/995671 to your computer and use it in GitHub Desktop.
Save dav-rob/995671 to your computer and use it in GitHub Desktop.
Builder fixedSettings = ImmutableSettings.settingsBuilder()
.put("index.number_of_shards", 1)
.put("index.number_of_replicas", 1)
.put("cluster.name", clusterName)
.put("node.client", true )
.put("index.mapper", "dynamic:false")
.put("node.data", false)//script.native.my.lang: native
.put("script.native.my.type","com.cs.cts.crm.elasticsearch.util.CustomColumnSorterFactory")
.put("script.native.my.lang","native");
boolean doMulticast = Boolean.getBoolean(multicast);
if (doMulticast){
fixedSettings.put("discovery.zen.ping.multicast.enabled", true);
} else {
fixedSettings.put("network.host", host)
.put("discovery.zen.ping.unicast.enabled", true)
.put("http.enabled", true)
.put("discovery.zen.ping.unicast.hosts", hosts)
.put("discovery.zen.ping.multicast.enabled", false);
}
Settings settings = fixedSettings.build();
where:
ES_ENV=CMTQA1
ES_MULTICAST=false
ES_HOST=169.49.110.161
ES_HOSTS=166.15.121.116:9300,166.15.121.116:9301,169.49.110.161:9300,169.49.110.161:9301,169.49.110.161:9302,169.49.110.161:9303,169.49.110.161:9304,169.49.110.161:9305,169.49.110.161:9306,169.49.110.161:9307,169.49.110.161:9308,169.49.110.161:9309,169.49.110.161:9310
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment