aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--server/sonar-search/src/main/java/org/sonar/search/ElasticSearch.java14
-rw-r--r--sonar-start/src/main/java/org/sonar/start/StartServer.java21
2 files changed, 18 insertions, 17 deletions
diff --git a/server/sonar-search/src/main/java/org/sonar/search/ElasticSearch.java b/server/sonar-search/src/main/java/org/sonar/search/ElasticSearch.java
index f65655e0314..e07850b285d 100644
--- a/server/sonar-search/src/main/java/org/sonar/search/ElasticSearch.java
+++ b/server/sonar-search/src/main/java/org/sonar/search/ElasticSearch.java
@@ -87,13 +87,13 @@ public class ElasticSearch extends Process {
.put("transport.tcp.port", port)
.put("path.home", home);
-// if (props.booleanOf(ES_DEBUG_PROPERTY, false)) {
- esSettings
- .put("http.enabled", true)
- .put("http.port", 9200);
-// } else {
-// esSettings.put("http.enabled", false);
-// }
+ if (props.booleanOf(ES_DEBUG_PROPERTY, false)) {
+ esSettings
+ .put("http.enabled", true)
+ .put("http.port", 9200);
+ } else {
+ esSettings.put("http.enabled", false);
+ }
node = NodeBuilder.nodeBuilder()
.settings(esSettings)
diff --git a/sonar-start/src/main/java/org/sonar/start/StartServer.java b/sonar-start/src/main/java/org/sonar/start/StartServer.java
index 5f02af508ec..fa8ea9ff658 100644
--- a/sonar-start/src/main/java/org/sonar/start/StartServer.java
+++ b/sonar-start/src/main/java/org/sonar/start/StartServer.java
@@ -70,19 +70,11 @@ public final class StartServer {
public void start() {
// Start ES
- this.startES(NetworkUtils.freePort());
+ //this.startES(NetworkUtils.freePort());
- while (!elasticsearch.isReady()) {
- LOGGER.info("Waiting for ES");
- try {
- Thread.sleep(1000);
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
// Start SQ
- //this.startSQ(NetworkUtils.freePort());
+ this.startSQ(NetworkUtils.freePort());
// // And monitor the activity
// try {
@@ -114,6 +106,15 @@ public final class StartServer {
"esHome", env.rootDir().getAbsolutePath()),
"ES", port,
env.rootDir().getAbsolutePath() + "/lib/search/sonar-search-4.5-SNAPSHOT.jar");
+
+ while (!elasticsearch.isReady()) {
+ LOGGER.info("Waiting for ES");
+ try {
+ Thread.sleep(1000);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
}
public static void main(String... args) throws InterruptedException, IOException, URISyntaxException {