diff options
author | Simon Brandhof <simon.brandhof@sonarsource.com> | 2014-10-08 12:29:44 +0200 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@sonarsource.com> | 2014-10-08 12:30:07 +0200 |
commit | 4de2100bd331a130b6b790c51dc6226f0c65127a (patch) | |
tree | 93263c64571f73baf8332458e29aa1a351afe0d8 /sonar-application | |
parent | 31a65f34968937d01a7e6c64a117409f150b5c0f (diff) | |
download | sonarqube-4de2100bd331a130b6b790c51dc6226f0c65127a.tar.gz sonarqube-4de2100bd331a130b6b790c51dc6226f0c65127a.zip |
SONAR-5709 Add properties sonar.search.javaAdditionalOpts and sonar.web.javaAdditionalOpts
Diffstat (limited to 'sonar-application')
3 files changed, 13 insertions, 1 deletions
diff --git a/sonar-application/src/main/assembly/conf/sonar.properties b/sonar-application/src/main/assembly/conf/sonar.properties index f14700b3592..ff26347346f 100644 --- a/sonar-application/src/main/assembly/conf/sonar.properties +++ b/sonar-application/src/main/assembly/conf/sonar.properties @@ -69,6 +69,9 @@ sonar.jdbc.timeBetweenEvictionRunsMillis=30000 #sonar.web.javaOpts=-Xmx768m -XX:MaxPermSize=160m -XX:+HeapDumpOnOutOfMemoryError \ # -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djruby.management.enabled=false +# Same as previous property, but allows to not repeat all settings like -Djava.awt.headless=true +#sonar.web.javaAdditionalOpts= + # Binding IP address. For servers with more than one IP address, this property specifies which # address will be used for listening on the specified ports. # By default, ports will be used on all IP addresses associated with the server. @@ -173,6 +176,9 @@ sonar.jdbc.timeBetweenEvictionRunsMillis=30000 # -XX:+UseCMSInitiatingOccupancyOnly -XX:+HeapDumpOnOutOfMemoryError \ # -Djava.awt.headless=true +# Same as previous property, but allows to not repeat all settings like -Djava.awt.headless=true +#sonar.search.javaAdditionalOpts= + # Elasticsearch port. Default is 9001. Use 0 to get a free port. # This port must be private and must not be exposed to the Internet. #sonar.search.port=9001 diff --git a/sonar-application/src/main/java/org/sonar/application/App.java b/sonar-application/src/main/java/org/sonar/application/App.java index 502cf561394..ff8016fabc8 100644 --- a/sonar-application/src/main/java/org/sonar/application/App.java +++ b/sonar-application/src/main/java/org/sonar/application/App.java @@ -70,7 +70,8 @@ public class App implements Stoppable { JavaCommand elasticsearch = new JavaCommand("search"); elasticsearch .setWorkDir(homeDir) - .addJavaOptions(props.value(DefaultSettings.SEARCH_JAVA_OPTS)) + .addJavaOptions(props.nonNullValue(DefaultSettings.SEARCH_JAVA_OPTS)) + .addJavaOptions(props.nonNullValue(DefaultSettings.SEARCH_JAVA_ADDITIONAL_OPTS)) .setTempDir(tempDir.getAbsoluteFile()) .setClassName("org.sonar.search.SearchServer") .setArguments(props.rawProperties()) @@ -83,6 +84,7 @@ public class App implements Stoppable { JavaCommand webServer = new JavaCommand("web") .setWorkDir(homeDir) .addJavaOptions(props.nonNullValue(DefaultSettings.WEB_JAVA_OPTS)) + .addJavaOptions(props.nonNullValue(DefaultSettings.WEB_JAVA_ADDITIONAL_OPTS)) .setTempDir(tempDir.getAbsoluteFile()) // required for logback tomcat valve .setEnvVariable("sonar.path.logs", props.nonNullValue("sonar.path.logs")) diff --git a/sonar-application/src/main/java/org/sonar/application/DefaultSettings.java b/sonar-application/src/main/java/org/sonar/application/DefaultSettings.java index 701249f5f63..4a936789499 100644 --- a/sonar-application/src/main/java/org/sonar/application/DefaultSettings.java +++ b/sonar-application/src/main/java/org/sonar/application/DefaultSettings.java @@ -36,7 +36,9 @@ class DefaultSettings { static final String CLUSTER_NODE_NAME = "sonar.node.name"; static final String SEARCH_PORT = "sonar.search.port"; static final String SEARCH_JAVA_OPTS = "sonar.search.javaOpts"; + static final String SEARCH_JAVA_ADDITIONAL_OPTS = "sonar.search.javaAdditionalOpts"; static final String WEB_JAVA_OPTS = "sonar.web.javaOpts"; + static final String WEB_JAVA_ADDITIONAL_OPTS = "sonar.web.javaAdditionalOpts"; static final String JDBC_URL = "sonar.jdbc.url"; static final String JDBC_LOGIN = "sonar.jdbc.username"; static final String JDBC_PASSWORD = "sonar.jdbc.password"; @@ -70,9 +72,11 @@ class DefaultSettings { defaults.put(SEARCH_JAVA_OPTS, "-Xmx256m -Xms256m -Xss256k -Djava.net.preferIPv4Stack=true " + "-XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly " + "-XX:+HeapDumpOnOutOfMemoryError -Djava.awt.headless=true"); + defaults.put(SEARCH_JAVA_ADDITIONAL_OPTS, ""); defaults.put(CLUSTER_NODE_NAME, "sonar-" + System.currentTimeMillis()); defaults.put(WEB_JAVA_OPTS, "-Xmx768m -XX:MaxPermSize=160m -XX:+HeapDumpOnOutOfMemoryError -Djava.net.preferIPv4Stack=true " + "-Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djruby.management.enabled=false"); + defaults.put(WEB_JAVA_ADDITIONAL_OPTS, ""); defaults.put(JDBC_URL, "jdbc:h2:tcp://localhost:9092/sonar"); defaults.put(JDBC_LOGIN, "sonar"); defaults.put(JDBC_PASSWORD, "sonar"); |