无法在Ubuntu中启动Sonarqube

无法在Ubuntu中启动Sonarqube,sonarqube,Sonarqube,当我试图启动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.AppFileSy

当我试图启动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

Elasticsearch未启动,请参阅日志:

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

下面是他们在书中所说的:

Elasticsearch使用大量文件描述符或文件句柄。跑步 文件外描述符可能是灾难性的,很可能导致 数据丢失。确保增加打开的数量限制 运行Elasticsearch至65536或 更高

因此,您需要增加限额:

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


解决方案是使用sonar.service文件,该文件应保存在/etc/systemd/system.sonar.service中

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

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

sysctl-w fs.file max=65535

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

sysctl-w vm.max\u map\u count=262144


你能分享你的es.log的内容吗?@mc1arke es.log文件被添加。我这样做了,但问题仍然存在。你在启动Elasticsearch的同一个shell中执行了ulimit?我在/etc/security/limits.cong中设置了nofile。可以吗?老实说,我不知道它是如何与limits.conf一起工作的。他们给出了两种解决方案,两种都试试!是的。但一切都没有改变。ulimit-n命令的输出为65536。但这并不是全部答案。您还必须更改服务文件。
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
[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