shell 由于内存问题,无法启动sonarqube

lstz6jyr  于 2022-12-13  发布在  Shell
关注(0)|答案(3)|浏览(144)

我正在我的CentOS 7中设置SonarQube以下教程:https://thegeeksalive.com/how-to-install-sonarqube-on-centos/
最后我启动了我的声纳,但是由于内存问题,它无法启动。

--> Wrapper Started as Daemon
Launching a JVM...
Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
  Copyright 1999-2006 Tanuki Software, Inc.  All Rights Reserved.

2019.07.24 10:58:55 INFO  app[][o.s.a.AppFileSystem] Cleaning or creating temp directory /opt/sonarqube/temp
2019.07.24 10:58:55 INFO  app[][o.s.a.es.EsSettings] Elasticsearch listening on /127.0.0.1:9001
2019.07.24 10:58:55 INFO  app[][o.s.a.ProcessLauncherImpl] Launch process[[key='es', ipcIndex=1, logFilenamePrefix=es]] from [/opt/sonarqube/elasticsearch]: /opt/sonarqube/elasticsearch/bin/elasticsearch
2019.07.24 10:58:55 INFO  app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
2019.07.24 10:58:55 INFO  app[][o.e.p.PluginsService] no modules loaded
2019.07.24 10:58:55 INFO  app[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
Java HotSpot(TM) 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
2019.07.24 10:59:08 INFO  app[][o.s.a.SchedulerImpl] Process[es] is up
2019.07.24 10:59:08 INFO  app[][o.s.a.ProcessLauncherImpl] Launch process[[key='web', ipcIndex=2, logFilenamePrefix=web]] from [/opt/sonarqube]: /usr/java/jdk-11.0.4/bin/java -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djava.io.tmpdir=/opt/sonarqube/temp --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 -Xmx512m -Xms128m -XX:+HeapDumpOnOutOfMemoryError -Dhttp.nonProxyHosts=localhost|127.*|[::1] -cp ./lib/common/*:/opt/sonarqube/lib/jdbc/mysql/mysql-connector-java-5.1.46.jar org.sonar.server.app.WebServer /opt/sonarqube/temp/sq-process16556217505100103896properties
2019.07.24 10:59:12 INFO  app[][o.s.a.SchedulerImpl] Process[web] is stopped
2019.07.24 10:59:12 WARN  app[][o.s.a.p.AbstractManagedProcess] Process exited with exit value [es]: 143
2019.07.24 10:59:12 INFO  app[][o.s.a.SchedulerImpl] Process[es] is stopped
2019.07.24 10:59:12 INFO  app[][o.s.a.SchedulerImpl] SonarQube is stopped
<-- Wrapper Stopped

希望大家帮我找到解决的办法。谢谢!

vom3gejh

vom3gejh1#

检查SonarQube主目录中logs/es.log中的内容。
如果您看到此消息,则应该在启动SonarQube之前运行以下命令

sysctl -w vm.max_map_count=262144
sysctl -w fs.file-max=65535
dfuffjeb

dfuffjeb2#

我猜你正在尝试使用Docker Composer来启动Sonarqube服务。你可以用这个试试。
1.将虚拟机最大Map计数=655360附加到/etc/sysctl.conf
1.$sysctl -p
1.再次重试

qlvxas9a

qlvxas9a3#

此错误很可能是由于项目太大,SonarQube无法使用默认内存设置进行扫描而导致的。
请尝试以下解决方法:
1.增加系统上的Java堆大小:

export _JAVA_OPTIONS="-Xmx1g"

1.更新$SONARQUBE_HOME/conf/ www.example.com中的javaOpts属性sonar.properties以授予更多内存。

相关问题