initMemoryES(esSettings);
}
- initRestConsole(esSettings);
initNetwork(esSettings);
node = NodeBuilder.nodeBuilder()
.put("path.logs", esLogDir().getAbsolutePath());
-
+ int httpPort = settings.getInt(IndexProperties.HTTP_PORT);
+ if (httpPort > 0) {
+ LOG.warn("Elasticsearch HTTP console enabled on port {}. Only for debugging purpose.", httpPort);
+ builder.put(HTTP_ENABLED, true);
+ builder.put("http.host", "127.0.0.1");
+ builder.put("http.port", httpPort);
+ } else {
+ builder.put(HTTP_ENABLED, false);
+ }
}
private void addIndexTemplates() {
esSettings.put("network.bind_host", "127.0.0.1");
}
- private void initRestConsole(ImmutableSettings.Builder esSettings) {
- int httpPort = settings.getInt(IndexProperties.HTTP_PORT);
- if (httpPort > 0) {
- LOG.warn("Elasticsearch HTTP console enabled on port {}. Only for debugging purpose.", httpPort);
- esSettings.put(HTTP_ENABLED, true);
- esSettings.put("http.host", "127.0.0.1");
- esSettings.put("http.port", httpPort);
- } else {
- esSettings.put(HTTP_ENABLED, false);
- }
- }
-
private File esHomeDir() {
if (!settings.hasKey("sonar.path.home")) {
throw new IllegalStateException("property 'sonar.path.home' is required");