Sonarqube无法在Ubuntu中启动

时间:2019-08-20 13:46:06

标签: sonarqube

当我尝试启动声纳波时,出现以下错误。

--> 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.08.19 17:30:23 INFO  app[][o.s.a.AppFileSystem] Cleaning or creating temp directory /opt/sonarqube/temp
2019.08.19 17:30:23 INFO  app[][o.s.a.es.EsSettings] Elasticsearch listening on /127.0.0.1:9001
2019.08.19 17:30:23 INFO  app[][o.s.a.ProcessLauncherImpl] Launch process[[key='es', ipcIndex=1, logFilenamePrefix=es]] from [/opt/sonarqube/elasticsearch]: /opt/sonarqube/elasticsearch/bin/elasticsearch
2019.08.19 17:30:23 INFO  app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
2019.08.19 17:30:24 INFO  app[][o.e.p.PluginsService] no modules loaded
2019.08.19 17:30:24 INFO  app[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
2019.08.19 17:30:41 WARN  app[][o.s.a.p.AbstractManagedProcess] Process exited with exit value [es]: 1
2019.08.19 17:30:41 INFO  app[][o.s.a.SchedulerImpl] Process[es] is stopped
2019.08.19 17:30:41 INFO  app[][o.s.a.SchedulerImpl] SonarQube is stopped
<-- Wrapper Stopped

我无法找到解决此问题的任何方法,我确实需要一些帮助来运行声纳波。我可能做错了什么,但是我遵循了sonarqube文档进行安装。

这是es.log文件

Server VM/11.0.4/11.0.4+11-post-Ubuntu-1ubuntu218.04.3]
2019.08.20 20:38:29 INFO  es[][o.e.n.Node] JVM arguments [-XX:+UseConcMarkSweepGC, -XX:CMSInitiatingOccupancyFraction=75, -XX:+UseCMSInitiatingOccupancyOnly, -Des.networkaddress.cache.ttl=60, -Des.networkaddress.cache.negative.ttl=10, -XX:+AlwaysPreTouch, -Xss1m, -Djava.awt.headless=true, -Dfile.encoding=UTF-8, -Djna.nosys=true, -XX:-OmitStackTraceInFastThrow, -Dio.netty.noUnsafe=true, -Dio.netty.noKeySetOptimization=true, -Dio.netty.recycler.maxCapacityPerThread=0, -Dlog4j.shutdownHookEnabled=false, -Dlog4j2.disable.jmx=true, -Djava.io.tmpdir=/opt/sonarqube/temp, -XX:ErrorFile=../logs/es_hs_err_pid%p.log, -Des.enforce.bootstrap.checks=true, -Xms512m, -Xmx512m, -Des.path.home=/opt/sonarqube/elasticsearch, -Des.path.conf=/opt/sonarqube/temp/conf/es, -Des.distribution.flavor=default, -Des.distribution.type=tar]
2019.08.20 20:38:30 INFO  es[][o.e.p.PluginsService] loaded module [analysis-common]
2019.08.20 20:38:30 INFO  es[][o.e.p.PluginsService] loaded module [lang-painless]
2019.08.20 20:38:30 INFO  es[][o.e.p.PluginsService] loaded module [mapper-extras]
2019.08.20 20:38:30 INFO  es[][o.e.p.PluginsService] loaded module [parent-join]
2019.08.20 20:38:30 INFO  es[][o.e.p.PluginsService] loaded module [percolator]
2019.08.20 20:38:30 INFO  es[][o.e.p.PluginsService] loaded module [reindex]
2019.08.20 20:38:30 INFO  es[][o.e.p.PluginsService] loaded module [repository-url]
2019.08.20 20:38:30 INFO  es[][o.e.p.PluginsService] loaded module [transport-netty4]
2019.08.20 20:38:30 INFO  es[][o.e.p.PluginsService] no plugins loaded
2019.08.20 20:38:34 WARN  es[][o.e.d.c.s.Settings] [http.enabled] setting was deprecated in Elasticsearch and will be removed in a future release! See the breaking changes documentation for the next major version.
2019.08.20 20:38:36 INFO  es[][o.e.d.DiscoveryModule] using discovery type [zen] and host providers [settings]
2019.08.20 20:38:36 INFO  es[][o.e.n.Node] initialized
2019.08.20 20:38:36 INFO  es[][o.e.n.Node] starting ...
2019.08.20 20:38:37 INFO  es[][o.e.t.TransportService] publish_address {127.0.0.1:9001}, bound_addresses {127.0.0.1:9001}
2019.08.20 20:38:37 INFO  es[][o.e.b.BootstrapChecks] explicitly enforcing bootstrap checks
2019.08.20 20:38:37 ERROR es[][o.e.b.Bootstrap] node validation exception
[1] bootstrap checks failed
[1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65535]
2019.08.20 20:38:37 INFO  es[][o.e.n.Node] stopping ...
2019.08.20 20:38:37 INFO  es[][o.e.n.Node] stopped
2019.08.20 20:38:37 INFO  es[][o.e.n.Node] closing ...
2019.08.20 20:38:37 INFO  es[][o.e.n.Node] closed

3 个答案:

答案 0 :(得分:1)

Elasticsearch尚未启动,请参阅日志:

  

2019.08.20 20:38:37错误es [] [o.e.b.Bootstrap]节点验证异常
  [1]引导检查失败
  [1]:elasticsearch过程的最大文件描述符[4096]太低,至少增加到[65535]

这就是他们在their doc中所说的话:

  

Elasticsearch使用许多文件描述符或文件句柄。跑步   文件描述符不足会造成灾难性的后果,并且很可能导致   数据丢失。确保增加开门数量的限制   运行Elasticsearch的用户的文件描述符达到65,536或   更高。

因此,您需要增加限制:

  

对于.zip和.tar.gz软件包,将 ulimit -n 65535 设置为root   启动Elasticsearch,或将 nofile 设置为 65535    /etc/security/limits.conf

答案 1 :(得分:0)

解决方案与sonar.service文件一起使用,应将其保存在/etc/systemd/system.sonar.service

[Unit]
Description=SonarQube service
After=syslog.target network.target

[Service]
Type=simple
User=sonarqube
Group=sonarqube
PermissionsStartOnly=true
ExecStart=/bin/nohup /opt/java/bin/java -Xms32m -Xmx32m -Djava.net.preferIPv4Stack=true -jar /opt/sonarqube/lib/sonar-application-7.4.jar
StandardOutput=syslog
LimitNOFILE=65536
LimitNPROC=8192
TimeoutStartSec=5
Restart=always

[Install]
WantedBy=multi-user.target

您必须定义服务的文件限制

答案 2 :(得分:0)

您需要设置fs.file-max以增加最大文件描述符。

  

sysctl -w fs.file-max = 65535

您可能还需要设置vm.max-map-count

  

sysctl -w vm.max_map_count = 262144