We have set up a Windows Server 2022 datacenter for our SonarQube Enterprise, to test it in Windows Server environment. Machine has 2 vcpus as well as 8 GB of RAM. I did test the community edition and it did work, but enterprise does not. What should we adjust? We are trying to run the zip package scenario.
Starting SonarQube...
2024.04.30 09:56:29 INFO app[][o.s.a.AppFileSystem] Cleaning or creating temp directory C:\sonarqube-10.5.0.89998\temp
2024.04.30 09:56:29 INFO app[][o.s.a.es.EsSettings] Elasticsearch listening on [HTTP: 127.0.0.1:9001, TCP: 127.0.0.1:55533]
2024.04.30 09:56:29 INFO app[][o.s.a.ProcessLauncherImpl] Launch process[ELASTICSEARCH] from [C:\sonarqube-10.5.0.89998\elasticsearch]: C:\Program Files (x86)\Eclipse Adoptium\jdk-17.0.10.7-hotspot\bin\java -Xms4m -Xmx64m -XX:+UseSerialGC -Dcli.name=server -Dcli.script=./bin/elasticsearch -Dcli.libs=lib/tools/server-cli -Des.path.home=C:\sonarqube-10.5.0.89998\elasticsearch -Des.path.conf=C:\sonarqube-10.5.0.89998\temp\conf\es -Des.distribution.type=tar -cp C:\sonarqube-10.5.0.89998\elasticsearch\lib\*;C:\sonarqube-10.5.0.89998\elasticsearch\lib\cli-launcher\* org.elasticsearch.launcher.CliToolLauncher
2024.04.30 09:56:29 INFO app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
Exception in thread "main" java.lang.RuntimeException: starting java failed with [1]
output:
Error occurred during initialization of VM
Could not reserve enough space for 2097152KB object heap
error:
at org.elasticsearch.server.cli.JvmOption.flagsFinal(JvmOption.java:120)
at org.elasticsearch.server.cli.JvmOption.findFinalOptions(JvmOption.java:87)
at org.elasticsearch.server.cli.MachineDependentHeap.determineHeapSettings(MachineDependentHeap.java:59)
at org.elasticsearch.server.cli.JvmOptionsParser.jvmOptions(JvmOptionsParser.java:138)
at org.elasticsearch.server.cli.JvmOptionsParser.determineJvmOptions(JvmOptionsParser.java:91)
at org.elasticsearch.server.cli.ServerProcess.createProcess(ServerProcess.java:208)
at org.elasticsearch.server.cli.ServerProcess.start(ServerProcess.java:104)
at org.elasticsearch.server.cli.ServerProcess.start(ServerProcess.java:88)
at org.elasticsearch.server.cli.ServerCli.startServer(ServerCli.java:239)
at org.elasticsearch.server.cli.ServerCli.execute(ServerCli.java:100)
at org.elasticsearch.common.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:54)
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:85)
at org.elasticsearch.cli.Command.main(Command.java:50)
at org.elasticsearch.launcher.CliToolLauncher.main(CliToolLauncher.java:64)
2024.04.30 09:56:33 WARN app[][o.s.a.p.AbstractManagedProcess] Process exited with exit value [ElasticSearch]: 1
2024.04.30 09:56:33 INFO app[][o.s.a.SchedulerImpl] Process[ElasticSearch] is stopped
2024.04.30 09:56:33 INFO app[][o.s.a.SchedulerImpl] SonarQube is stopped
The Enterprise Edition comes with higher defaults for JVM Heaps (which can be configured in your conf/sonar.properties file) to be ready for enterprise workloads.
In any case, it seems that your server has less than 2 GB of RAM free by the time it starts up Elasticsearch. Ideally, you would bump up the server RAM.
See the docs here on Enterprise Hardware Reccomendations:
For large teams or enterprise-scale installations of SonarQube, additional hardware is required. At the enterprise level, monitoring your SonarQube instance is essential and should guide further hardware upgrades as your instance grows. A starting configuration should include at least:
8 cores, to allow the main SonarQube platform to run with multiple compute engine workers
16GB of RAM For additional requirements and recommendations relating to database and Elasticsearch, see Hardware recommendations.
@Colin so I have scaled up the machine to 8 CPU’s and 16GB’s of RAM, but I still get ther error. Do you guys have some extended step by step configuration on how to install and confgure the Enterprise versions? Would appreciate a lot.
Starting SonarQube...
2024.05.15 12:52:06 INFO app[][o.s.a.AppFileSystem] Cleaning or creating temp directory C:\sonarqube-10.5.0.89998\var\sonarqube\temp
2024.05.15 12:52:06 INFO app[][o.s.a.es.EsSettings] Elasticsearch listening on [HTTP: 127.0.0.1:9001, TCP: 127.0.0.1:53262]
2024.05.15 12:52:07 INFO app[][o.s.a.ProcessLauncherImpl] Launch process[ELASTICSEARCH] from [C:\sonarqube-10.5.0.89998\elasticsearch]: C:\Program Files (x86)\Eclipse Adoptium\jdk-17.0.10.7-hotspot\bin\java -Xms4m -Xmx64m -XX:+UseSerialGC -Dcli.name=server -Dcli.script=./bin/elasticsearch -Dcli.libs=lib/tools/server-cli -Des.path.home=C:\sonarqube-10.5.0.89998\elasticsearch -Des.path.conf=C:\sonarqube-10.5.0.89998\var\sonarqube\temp\conf\es -Des.distribution.type=tar -cp C:\sonarqube-10.5.0.89998\elasticsearch\lib\*;C:\sonarqube-10.5.0.89998\elasticsearch\lib\cli-launcher\* org.elasticsearch.launcher.CliToolLauncher
2024.05.15 12:52:07 INFO app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
2024.05.15 12:52:24 INFO app[][o.s.a.SchedulerImpl] Process[es] is up
2024.05.15 12:52:24 INFO app[][o.s.a.ProcessLauncherImpl] Launch process[WEB_SERVER] from [C:\sonarqube-10.5.0.89998]: C:\Program Files (x86)\Eclipse Adoptium\jdk-17.0.10.7-hotspot\bin\java -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djava.io.tmpdir=C:\sonarqube-10.5.0.89998\var\sonarqube\temp -XX:-OmitStackTraceInFastThrow --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED --add-exports=java.base/jdk.internal.ref=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/sun.nio.ch=ALL-UNNAMED --add-opens=java.management/sun.management=ALL-UNNAMED --add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED -Dcom.redhat.fips=false -Xmx1G -Xms128m -XX:+HeapDumpOnOutOfMemoryError -Dhttp.nonProxyHosts=localhost|127.*|[::1] -cp ./lib/sonar-application-10.5.0.89998.jar;C:\sonarqube-10.5.0.89998\lib\jdbc\h2\h2-2.2.224.jar org.sonar.server.app.WebServer C:\sonarqube-10.5.0.89998\var\sonarqube\temp\sq-process9047676605127842344properties
WARNING: A terminally deprecated method in java.lang.System has been called
WARNING: System::setSecurityManager has been called by org.sonar.process.PluginSecurityManager (file:/C:/sonarqube-10.5.0.89998/lib/sonar-application-10.5.0.89998.jar)
WARNING: Please consider reporting this to the maintainers of org.sonar.process.PluginSecurityManager
WARNING: System::setSecurityManager will be removed in a future release
2024.05.15 12:52:36 INFO app[][o.s.a.SchedulerImpl] Process[web] is up
2024.05.15 12:52:36 INFO app[][o.s.a.ProcessLauncherImpl] Launch process[COMPUTE_ENGINE] from [C:\sonarqube-10.5.0.89998]: C:\Program Files (x86)\Eclipse Adoptium\jdk-17.0.10.7-hotspot\bin\java -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djava.io.tmpdir=C:\sonarqube-10.5.0.89998\var\sonarqube\temp -XX:-OmitStackTraceInFastThrow --add-opens=java.base/java.util=ALL-UNNAMED --add-exports=java.base/jdk.internal.ref=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/sun.nio.ch=ALL-UNNAMED --add-opens=java.management/sun.management=ALL-UNNAMED --add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED -Dcom.redhat.fips=false -Xmx2G -Xms128m -XX:+HeapDumpOnOutOfMemoryError -Dhttp.nonProxyHosts=localhost|127.*|[::1] -cp ./lib/sonar-application-10.5.0.89998.jar;C:\sonarqube-10.5.0.89998\lib\jdbc\h2\h2-2.2.224.jar org.sonar.ce.app.CeServer C:\sonarqube-10.5.0.89998\var\sonarqube\temp\sq-process4194401351745934669properties
Error occurred during initialization of VM
Could not reserve enough space for 2097152KB object heap
2024.05.15 12:52:36 WARN app[][o.s.a.p.AbstractManagedProcess] Process exited with exit value [Compute Engine]: 1
2024.05.15 12:52:36 INFO app[][o.s.a.SchedulerImpl] Process[Compute Engine] is stopped
2024.05.15 12:52:38 INFO app[][o.s.a.SchedulerImpl] Process[Web Server] is stopped
2024.05.15 12:52:38 INFO app[][o.s.a.SchedulerImpl] Process[ElasticSearch] is stopped
2024.05.15 12:52:38 INFO app[][o.s.a.SchedulerImpl] SonarQube is stopped
2024.04.30 09:56:29 INFO app[o.s.a.ProcessLauncherImpl] Launch process[ELASTICSEARCH] from [C:\sonarqube-10.5.0.89998\elasticsearch]: C:\Program Files (x86)\Eclipse Adoptium\jdk-17.0.10.7-hotspot\bin\java -Xms4m -Xmx64m
32-bit JVM limitations: On 32-bit systems, the JVM is limited to addressing a maximum of around 1.5-1.6 GB of contiguous memory space for the heap. If you try to allocate more than this limit, the JVM will fail to initialize.
Alright, seems I did install the wrong version at firs, as that was old. I did install JDK 17 and set the sonar path to that installation. Thank you guys so far.
I did install the wrong version, but coming out of your reply, I did download the 64 bit version 17 and installed that, plus I have updated the SONAR PATH to java, as well as adjusted the sonar.conf according to your advice. So, big thanks to you my friend!