SonarQube 包装器在 Windows 上停止且没有指示器

问题描述 投票:0回答:1

我通过下载 zip 并按照

这篇文章
设置 JAVA_HOME
PATH
Windows 环境变量来安装
此版本的 OpenJDK

执行

java -version
给我这个:

C:\git\sonarqube-8.6.0.39681\bin\windows-x86-64> java -version
openjdk version "11" 2018-09-25
OpenJDK Runtime Environment 18.9 (build 11+28)
OpenJDK 64-Bit Server VM 18.9 (build 11+28, mixed mode)
C:\git\sonarqube-8.6.0.39681\bin\windows-x86-64>

然后,我从此处下载了 SonarQube ,并使用 PowerShell 导航到

\sonarqube-8.6.0.39681\bin\windows-x86-64
文件夹以执行
.\StartSonar.bat
文件。

我看到的输出是这样的:

C:\git\sonarqube-8.6.0.39681\bin\windows-x86-64> .\StartSonar.bat
wrapper  | --> Wrapper Started as Console
wrapper  | Launching a JVM...
jvm 1    | Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
jvm 1    |   Copyright 1999-2006 Tanuki Software, Inc.  All Rights Reserved.
jvm 1    |
jvm 1    | 2021.01.19 11:47:42 INFO  app[][o.s.a.AppFileSystem] Cleaning or creating temp directory C:\git\sonarqube-8.6.0.39681\temp
jvm 1    | 2021.01.19 11:47:42 INFO  app[][o.s.a.es.EsSettings] Elasticsearch listening on [HTTP: 127.0.0.1:9001, TCP: 127.0.0.1:51631]
jvm 1    | 2021.01.19 11:47:43 INFO  app[][o.s.a.ProcessLauncherImpl] Launch process[[key='es', ipcIndex=1, logFilenamePrefix=es]] from [C:\git\sonarqube-8.6.0.39681\elasticsearch]: C:\jdk-11\bin\java -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -Djava.io.tmpdir=C:\git\sonarqube-8.6.0.39681\temp -XX:ErrorFile=../logs/es_hs_err_pid%p.log -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 -Dio.netty.allocator.numDirectArenas=0 -Dlog4j.shutdownHookEnabled=false -Dlog4j2.disable.jmx=true -Djava.locale.providers=COMPAT -Xmx512m -Xms512m -XX:MaxDirectMemorySize=256m -XX:+HeapDumpOnOutOfMemoryError -Delasticsearch -Des.path.home=C:\git\sonarqube-8.6.0.39681\elasticsearch -Des.path.conf=C:\git\sonarqube-8.6.0.39681\temp\conf\es -cp lib/* org.elasticsearch.bootstrap.Elasticsearch
jvm 1    | 2021.01.19 11:47:43 INFO  app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
jvm 1    | OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
jvm 1    | 2021.01.19 11:47:52 INFO  app[][o.s.a.SchedulerImpl] Process[es] is up
jvm 1    | 2021.01.19 11:47:52 INFO  app[][o.s.a.ProcessLauncherImpl] Launch process[[key='web', ipcIndex=2, logFilenamePrefix=web]] from [C:\git\sonarqube-8.6.0.39681]: C:\jdk-11\bin\java -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djava.io.tmpdir=C:\git\sonarqube-8.6.0.39681\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 -Xmx512m -Xms128m -XX:+HeapDumpOnOutOfMemoryError -Dhttp.nonProxyHosts=localhost|127.*|[::1] -cp ./lib/common/*;C:\git\sonarqube-8.6.0.39681\lib\jdbc\h2\h2-1.4.199.jar org.sonar.server.app.WebServer C:\git\sonarqube-8.6.0.39681\temp\sq-process18025213426507358055properties
jvm 1    | 2021.01.19 11:47:53 INFO  app[][o.s.a.SchedulerImpl] Process[web] is stopped
jvm 1    | 2021.01.19 11:47:53 INFO  app[][o.s.a.SchedulerImpl] Process[es] is stopped
jvm 1    | 2021.01.19 11:47:53 INFO  app[][o.s.a.SchedulerImpl] SonarQube is stopped
wrapper  | <-- Wrapper Stopped
C:\git\sonarqube-8.6.0.39681\bin\windows-x86-64>

所以我检查了

\sonarqube-8.6.0.39681\logs\web.log
看到了这个:

2021.01.19 11:42:21 INFO  web[][o.s.p.ProcessEntryPoint] Starting web
2021.01.19 11:42:22 ERROR web[][o.s.s.a.EmbeddedTomcat] Fail to start web server
org.apache.catalina.LifecycleException: Failed to initialize connector [Connector[HTTP/1.1-9000]]
    at org.apache.catalina.core.StandardService.initInternal(StandardService.java:559)
    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136)
    at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:848)
    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:173)
    at org.apache.catalina.startup.Tomcat.start(Tomcat.java:440)
    at org.sonar.server.app.EmbeddedTomcat.start(EmbeddedTomcat.java:66)
    at org.sonar.server.app.WebServer.start(WebServer.java:52)
    at org.sonar.process.ProcessEntryPoint.launch(ProcessEntryPoint.java:97)
    at org.sonar.process.ProcessEntryPoint.launch(ProcessEntryPoint.java:81)
    at org.sonar.server.app.WebServer.main(WebServer.java:99)
2021.01.19 11:42:22 WARN  web[][o.s.p.ProcessEntryPoint] Fail to start web
java.lang.RuntimeException: org.apache.catalina.LifecycleException: Failed to initialize connector [Connector[HTTP/1.1-9000]]
    at com.google.common.base.Throwables.propagate(Throwables.java:241)
    at org.sonar.server.app.EmbeddedTomcat.start(EmbeddedTomcat.java:70)
    at org.sonar.server.app.WebServer.start(WebServer.java:52)
    at org.sonar.process.ProcessEntryPoint.launch(ProcessEntryPoint.java:97)
    at org.sonar.process.ProcessEntryPoint.launch(ProcessEntryPoint.java:81)
    at org.sonar.server.app.WebServer.main(WebServer.java:99)
Caused by: org.apache.catalina.LifecycleException: Failed to initialize connector [Connector[HTTP/1.1-9000]]
    at org.apache.catalina.core.StandardService.initInternal(StandardService.java:559)
    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136)
    at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:848)
    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:173)
    at org.apache.catalina.startup.Tomcat.start(Tomcat.java:440)
    at org.sonar.server.app.EmbeddedTomcat.start(EmbeddedTomcat.java:66)
    ... 4 common frames omitted
2021.01.19 11:42:22 INFO  web[][o.s.p.ProcessEntryPoint] Hard stopping process
2021.01.19 11:47:53 INFO  web[][o.s.p.ProcessEntryPoint] Starting web
2021.01.19 11:47:53 ERROR web[][o.s.s.a.EmbeddedTomcat] Fail to start web server
org.apache.catalina.LifecycleException: Failed to initialize connector [Connector[HTTP/1.1-9000]]
    at org.apache.catalina.core.StandardService.initInternal(StandardService.java:559)
    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136)
    at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:848)
    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:173)
    at org.apache.catalina.startup.Tomcat.start(Tomcat.java:440)
    at org.sonar.server.app.EmbeddedTomcat.start(EmbeddedTomcat.java:66)
    at org.sonar.server.app.WebServer.start(WebServer.java:52)
    at org.sonar.process.ProcessEntryPoint.launch(ProcessEntryPoint.java:97)
    at org.sonar.process.ProcessEntryPoint.launch(ProcessEntryPoint.java:81)
    at org.sonar.server.app.WebServer.main(WebServer.java:99)
2021.01.19 11:47:53 WARN  web[][o.s.p.ProcessEntryPoint] Fail to start web
java.lang.RuntimeException: org.apache.catalina.LifecycleException: Failed to initialize connector [Connector[HTTP/1.1-9000]]
    at com.google.common.base.Throwables.propagate(Throwables.java:241)
    at org.sonar.server.app.EmbeddedTomcat.start(EmbeddedTomcat.java:70)
    at org.sonar.server.app.WebServer.start(WebServer.java:52)
    at org.sonar.process.ProcessEntryPoint.launch(ProcessEntryPoint.java:97)
    at org.sonar.process.ProcessEntryPoint.launch(ProcessEntryPoint.java:81)
    at org.sonar.server.app.WebServer.main(WebServer.java:99)
Caused by: org.apache.catalina.LifecycleException: Failed to initialize connector [Connector[HTTP/1.1-9000]]
    at org.apache.catalina.core.StandardService.initInternal(StandardService.java:559)
    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136)
    at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:848)
    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:173)
    at org.apache.catalina.startup.Tomcat.start(Tomcat.java:440)
    at org.sonar.server.app.EmbeddedTomcat.start(EmbeddedTomcat.java:66)
    ... 4 common frames omitted
2021.01.19 11:47:53 INFO  web[][o.s.p.ProcessEntryPoint] Hard stopping process

\sonarqube-8.6.0.39681\logs\es.log
日志显示:

2021.01.19 11:42:13 INFO  es[][o.e.n.Node] version[7.9.3], pid[17976], build[unknown/unknown/c4138e51121ef06a6404866cddc601906fe5c868/2020-10-16T10:36:16.141335Z], OS[Windows 10/10.0/amd64], JVM[Oracle Corporation/OpenJDK 64-Bit Server VM/11/11+28]
2021.01.19 11:42:13 INFO  es[][o.e.n.Node] JVM home [C:\jdk-11]
2021.01.19 11:42:13 INFO  es[][o.e.n.Node] JVM arguments [-XX:+UseConcMarkSweepGC, -XX:CMSInitiatingOccupancyFraction=75, -XX:+UseCMSInitiatingOccupancyOnly, -Djava.io.tmpdir=C:\git\sonarqube-8.6.0.39681\temp, -XX:ErrorFile=../logs/es_hs_err_pid%p.log, -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, -Dio.netty.allocator.numDirectArenas=0, -Dlog4j.shutdownHookEnabled=false, -Dlog4j2.disable.jmx=true, -Djava.locale.providers=COMPAT, -Xmx512m, -Xms512m, -XX:MaxDirectMemorySize=256m, -XX:+HeapDumpOnOutOfMemoryError, -Delasticsearch, -Des.path.home=C:\git\sonarqube-8.6.0.39681\elasticsearch, -Des.path.conf=C:\git\sonarqube-8.6.0.39681\temp\conf\es]
2021.01.19 11:42:14 INFO  es[][o.e.p.PluginsService] loaded module [analysis-common]
2021.01.19 11:42:14 INFO  es[][o.e.p.PluginsService] loaded module [lang-painless]
2021.01.19 11:42:14 INFO  es[][o.e.p.PluginsService] loaded module [parent-join]
2021.01.19 11:42:14 INFO  es[][o.e.p.PluginsService] loaded module [percolator]
2021.01.19 11:42:14 INFO  es[][o.e.p.PluginsService] loaded module [transport-netty4]
2021.01.19 11:42:14 INFO  es[][o.e.p.PluginsService] no plugins loaded
2021.01.19 11:42:14 INFO  es[][o.e.e.NodeEnvironment] using [1] data paths, mounts [[OSDisk (C:)]], net usable_space [79.2gb], net total_space [475.3gb], types [NTFS]
2021.01.19 11:42:14 INFO  es[][o.e.e.NodeEnvironment] heap size [494.9mb], compressed ordinary object pointers [true]
2021.01.19 11:42:14 WARN  es[][o.e.d.c.s.Settings] [node.master] setting was deprecated in Elasticsearch and will be removed in a future release! See the breaking changes documentation for the next major version.
2021.01.19 11:42:14 WARN  es[][o.e.d.c.s.Settings] [node.data] setting was deprecated in Elasticsearch and will be removed in a future release! See the breaking changes documentation for the next major version.
2021.01.19 11:42:14 INFO  es[][o.e.n.Node] node name [sonarqube], node ID [rvPV04lsS-S2EVg8okPbPg], cluster name [sonarqube]
2021.01.19 11:42:17 WARN  es[][o.e.d.c.r.OperationRouting] searches will not be routed based on awareness attributes starting in version 8.0.0; to opt into this behaviour now please set the system property [es.search.ignore_awareness_attributes] to [true]
2021.01.19 11:42:18 INFO  es[][o.e.t.NettyAllocator] creating NettyAllocator with the following configs: [name=unpooled, factors={es.unsafe.use_unpooled_allocator=false, g1gc_enabled=false, g1gc_region_size=0b, heap_size=494.9mb}]
2021.01.19 11:42:18 INFO  es[][o.e.d.DiscoveryModule] using discovery type [zen] and seed hosts providers [settings]
2021.01.19 11:42:18 WARN  es[][o.e.g.DanglingIndicesState] gateway.auto_import_dangling_indices is disabled, dangling indices will not be automatically detected or imported and must be managed manually
2021.01.19 11:42:18 INFO  es[][o.e.n.Node] initialized
2021.01.19 11:42:18 INFO  es[][o.e.n.Node] starting ...
2021.01.19 11:42:19 INFO  es[][o.e.t.TransportService] publish_address {127.0.0.1:51407}, bound_addresses {127.0.0.1:51407}
2021.01.19 11:42:20 INFO  es[][o.e.c.c.Coordinator] cluster UUID [KN6nD07MQgSuD1bgIEWZDw]
2021.01.19 11:42:20 INFO  es[][o.e.c.s.MasterService] elected-as-master ([1] nodes joined)[{sonarqube}{rvPV04lsS-S2EVg8okPbPg}{QKaKD--HSEOvHtjU_xyTnw}{127.0.0.1}{127.0.0.1:51407}{dimr}{rack_id=sonarqube} elect leader, _BECOME_MASTER_TASK_, _FINISH_ELECTION_], term: 3, version: 5, delta: master node changed {previous [], current [{sonarqube}{rvPV04lsS-S2EVg8okPbPg}{QKaKD--HSEOvHtjU_xyTnw}{127.0.0.1}{127.0.0.1:51407}{dimr}{rack_id=sonarqube}]}
2021.01.19 11:42:20 INFO  es[][o.e.c.s.ClusterApplierService] master node changed {previous [], current [{sonarqube}{rvPV04lsS-S2EVg8okPbPg}{QKaKD--HSEOvHtjU_xyTnw}{127.0.0.1}{127.0.0.1:51407}{dimr}{rack_id=sonarqube}]}, term: 3, version: 5, reason: Publication{term=3, version=5}
2021.01.19 11:42:20 INFO  es[][o.e.h.AbstractHttpServerTransport] publish_address {127.0.0.1:9001}, bound_addresses {127.0.0.1:9001}
2021.01.19 11:42:20 INFO  es[][o.e.n.Node] started
2021.01.19 11:42:20 INFO  es[][o.e.g.GatewayService] recovered [0] indices into cluster_state
2021.01.19 11:47:45 INFO  es[][o.e.n.Node] version[7.9.3], pid[8664], build[unknown/unknown/c4138e51121ef06a6404866cddc601906fe5c868/2020-10-16T10:36:16.141335Z], OS[Windows 10/10.0/amd64], JVM[Oracle Corporation/OpenJDK 64-Bit Server VM/11/11+28]
2021.01.19 11:47:45 INFO  es[][o.e.n.Node] JVM home [C:\jdk-11]
2021.01.19 11:47:45 INFO  es[][o.e.n.Node] JVM arguments [-XX:+UseConcMarkSweepGC, -XX:CMSInitiatingOccupancyFraction=75, -XX:+UseCMSInitiatingOccupancyOnly, -Djava.io.tmpdir=C:\git\sonarqube-8.6.0.39681\temp, -XX:ErrorFile=../logs/es_hs_err_pid%p.log, -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, -Dio.netty.allocator.numDirectArenas=0, -Dlog4j.shutdownHookEnabled=false, -Dlog4j2.disable.jmx=true, -Djava.locale.providers=COMPAT, -Xmx512m, -Xms512m, -XX:MaxDirectMemorySize=256m, -XX:+HeapDumpOnOutOfMemoryError, -Delasticsearch, -Des.path.home=C:\git\sonarqube-8.6.0.39681\elasticsearch, -Des.path.conf=C:\git\sonarqube-8.6.0.39681\temp\conf\es]
2021.01.19 11:47:46 INFO  es[][o.e.p.PluginsService] loaded module [analysis-common]
2021.01.19 11:47:46 INFO  es[][o.e.p.PluginsService] loaded module [lang-painless]
2021.01.19 11:47:46 INFO  es[][o.e.p.PluginsService] loaded module [parent-join]
2021.01.19 11:47:46 INFO  es[][o.e.p.PluginsService] loaded module [percolator]
2021.01.19 11:47:46 INFO  es[][o.e.p.PluginsService] loaded module [transport-netty4]
2021.01.19 11:47:46 INFO  es[][o.e.p.PluginsService] no plugins loaded
2021.01.19 11:47:46 INFO  es[][o.e.e.NodeEnvironment] using [1] data paths, mounts [[OSDisk (C:)]], net usable_space [79.2gb], net total_space [475.3gb], types [NTFS]
2021.01.19 11:47:46 INFO  es[][o.e.e.NodeEnvironment] heap size [494.9mb], compressed ordinary object pointers [true]
2021.01.19 11:47:46 WARN  es[][o.e.d.c.s.Settings] [node.master] setting was deprecated in Elasticsearch and will be removed in a future release! See the breaking changes documentation for the next major version.
2021.01.19 11:47:46 WARN  es[][o.e.d.c.s.Settings] [node.data] setting was deprecated in Elasticsearch and will be removed in a future release! See the breaking changes documentation for the next major version.
2021.01.19 11:47:46 INFO  es[][o.e.n.Node] node name [sonarqube], node ID [rvPV04lsS-S2EVg8okPbPg], cluster name [sonarqube]
2021.01.19 11:47:48 WARN  es[][o.e.d.c.r.OperationRouting] searches will not be routed based on awareness attributes starting in version 8.0.0; to opt into this behaviour now please set the system property [es.search.ignore_awareness_attributes] to [true]
2021.01.19 11:47:49 INFO  es[][o.e.t.NettyAllocator] creating NettyAllocator with the following configs: [name=unpooled, factors={es.unsafe.use_unpooled_allocator=false, g1gc_enabled=false, g1gc_region_size=0b, heap_size=494.9mb}]
2021.01.19 11:47:49 INFO  es[][o.e.d.DiscoveryModule] using discovery type [zen] and seed hosts providers [settings]
2021.01.19 11:47:50 WARN  es[][o.e.g.DanglingIndicesState] gateway.auto_import_dangling_indices is disabled, dangling indices will not be automatically detected or imported and must be managed manually
2021.01.19 11:47:50 INFO  es[][o.e.n.Node] initialized
2021.01.19 11:47:50 INFO  es[][o.e.n.Node] starting ...
2021.01.19 11:47:51 INFO  es[][o.e.t.TransportService] publish_address {127.0.0.1:51631}, bound_addresses {127.0.0.1:51631}
2021.01.19 11:47:51 INFO  es[][o.e.c.c.Coordinator] cluster UUID [KN6nD07MQgSuD1bgIEWZDw]
2021.01.19 11:47:51 INFO  es[][o.e.c.s.MasterService] elected-as-master ([1] nodes joined)[{sonarqube}{rvPV04lsS-S2EVg8okPbPg}{AQEp76FURcuprB2K6s4biQ}{127.0.0.1}{127.0.0.1:51631}{dimr}{rack_id=sonarqube} elect leader, _BECOME_MASTER_TASK_, _FINISH_ELECTION_], term: 4, version: 7, delta: master node changed {previous [], current [{sonarqube}{rvPV04lsS-S2EVg8okPbPg}{AQEp76FURcuprB2K6s4biQ}{127.0.0.1}{127.0.0.1:51631}{dimr}{rack_id=sonarqube}]}
2021.01.19 11:47:51 INFO  es[][o.e.c.s.ClusterApplierService] master node changed {previous [], current [{sonarqube}{rvPV04lsS-S2EVg8okPbPg}{AQEp76FURcuprB2K6s4biQ}{127.0.0.1}{127.0.0.1:51631}{dimr}{rack_id=sonarqube}]}, term: 4, version: 7, reason: Publication{term=4, version=7}
2021.01.19 11:47:51 INFO  es[][o.e.h.AbstractHttpServerTransport] publish_address {127.0.0.1:9001}, bound_addresses {127.0.0.1:9001}
2021.01.19 11:47:51 INFO  es[][o.e.n.Node] started
2021.01.19 11:47:51 INFO  es[][o.e.g.GatewayService] recovered [0] indices into cluster_state

我该如何运行 SonarQube?

windows-10 sonarqube openjdk-11
1个回答
0
投票

将端口从 9000 更改为其他端口

Web context. When set, it must start with forward slash (for example /sonarqube).
The default value is root context (empty value).
sonar.web.context=
TCP port for incoming HTTP connections. Default value is 9000.
sonar.web.port=8000
© www.soinside.com 2019 - 2024. All rights reserved.