无法在Windows上将SonarQube 5.3作为服务运行
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了无法在Windows上将SonarQube 5.3作为服务运行相关的知识,希望对你有一定的参考价值。
我无法在Windows Server 2012或Windows 10上运行SonarQube 5.3作为服务。它使用StartSonar.bat运行良好但是当安装并作为服务运行时出现错误
“本地计算机上的SonarQube服务启动然后停止。如果某些服务未被其他服务或程序使用,则会自动停止。”
我尝试过具有本地管理员访问权限的特定服务用户和具有相同结果的“本地系统帐户”用户。
我已经测试了启动服务,指定具有本地管理员访问权限的桌面用户,但是我们的策略是使用特定的服务用户来获取服务。
我尝试使用JDK 8 64位和JDK 7 32位,结果相同
sonar.log的内容是
Using tick timer.
--> Wrapper Started as Service
server listening on port 32000.
Launching a JVM...
command: "C:Program FilesJavajdk1.8.0_72injava.exe" -Djava.awt.headless=true -Xms3m -Xmx3m -Djava.library.path="./lib" -classpath "../../lib/jsw/wrapper-3.2.3.jar;../../lib/sonar-application-5.3.jar" -Dwrapper.key="Rfo5GpLfYyokZuoo" -Dwrapper.port=32000 -Dwrapper.jvm.port.min=31000 -Dwrapper.jvm.port.max=31999 -Dwrapper.debug="TRUE" -Dwrapper.pid=7932 -Dwrapper.version="3.2.3" -Dwrapper.native_library="wrapper" -Dwrapper.service="TRUE" -Dwrapper.cpu.timeout="10" -Dwrapper.jvmid=1 org.tanukisoftware.wrapper.WrapperSimpleApp org.sonar.application.App
JVM started (PID=3388)
WrapperManager class initialized by thread: main Using classloader: sun.misc.Launcher$AppClassLoader@5c647e05
Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
Copyright 1999-2006 Tanuki Software, Inc. All Rights Reserved.
Wrapper Manager: JVM #1
Running a 64-bit JVM.
Wrapper Manager: Registering shutdown hook
Wrapper Manager: Using wrapper
Load native library. One or more attempts may fail if platform specific libraries do not exist.
Loading native library failed: wrapper-windows-x86-64.dll Cause: java.lang.UnsatisfiedLinkError: no wrapper-windows-x86-64 in java.library.path
Loaded native library: wrapper.dll
Calling native initialization method.
Initializing WrapperManager native library.
Java Executable: C:Program FilesJavajdk1.8.0_72injava.exe
Windows version: 6.3.9600
Java Version : 1.8.0_72-b15 Java HotSpot(TM) 64-Bit Server VM
Java VM Vendor : Oracle Corporation
Control event monitor thread started.
Startup runner thread started.
WrapperManager.start(org.tanukisoftware.wrapper.WrapperSimpleApp@4f023edb, args[]) called by thread: main
Communications runner thread started.
Open socket to wrapper...Wrapper-Connection
Opened Socket from 31000 to 32000
Send a packet KEY : Rfo5GpLfYyokZuoo
handleSocket(Socket[addr=/127.0.0.1,port=32000,localport=31000])
accepted a socket from 127.0.0.1 on port 31000
read a packet KEY : Rfo5GpLfYyokZuoo
Got key from JVM: Rfo5GpLfYyokZuoo
send a packet LOW_LOG_LEVEL : 1
send a packet PING_TIMEOUT : 0
send a packet PROPERTIES : (Property Values)
Start Application.
send a packet START : start
Received a packet LOW_LOG_LEVEL : 1
Wrapper Manager: LowLogLevel from Wrapper is 1
Received a packet PING_TIMEOUT : 0
PingTimeout from Wrapper is 0
Received a packet PROPERTIES : (Property Values)
Received a packet START : start
calling WrapperListener.start()
Waiting for WrapperListener.start runner thread to complete.
WrapperListener.start runner thread started.
WrapperSimpleApp: start(args) Will wait up to 2 seconds for the main method to complete.
WrapperSimpleApp: invoking main method
Wrapper Manager: ShutdownHook started
WrapperManager.stop(0) called by thread: Wrapper-Shutdown-Hook
Send a packet STOP : 0
Startup runner thread stopped.
read a packet STOP : 0
JVM requested a shutdown. (0)
wrapperStopProcess(0) called.
Sending stop signal to JVM
send a packet STOP : NULL
Send a packet START_PENDING : 5000
read a packet START_PENDING : 5000
JVM signalled a start pending with waitHint of 5000 millis.
Thread, Wrapper-Shutdown-Hook, handling the shutdown process.
shutdownJVM(0) Thread:Wrapper-Shutdown-Hook
Send a packet STOPPED : 0
read a packet STOPPED : 0
JVM signalled that it was stopped.
Closing socket.
socket read no code (closed?).
server listening on port 32002.
Send a packet START_PENDING : 5000
Wrapper Manager: ShutdownHook complete
WrapperSimpleApp: start(args) end. Main Completed=false, exitCode=null
WrapperListener.start runner thread stopped.
JVM process exited with a code of 0, leaving the wrapper exit code set to 0.
JVM exited normally.
<-- Wrapper Stopped
--> Wrapper Started as Service
Using tick timer.
server listening on port 32000.
Launching a JVM...
command: "C:Program FilesJavajdk1.8.0_72injava.exe" -Djava.awt.headless=true -Xms3m -Xmx3m -Djava.library.path="./lib" -classpath "../../lib/jsw/wrapper-3.2.3.jar;../../lib/sonar-application-5.3.jar" -Dwrapper.key="dvwrESWxTion4Weh" -Dwrapper.port=32000 -Dwrapper.jvm.port.min=31000 -Dwrapper.jvm.port.max=31999 -Dwrapper.debug="TRUE" -Dwrapper.pid=4304 -Dwrapper.version="3.2.3" -Dwrapper.native_library="wrapper" -Dwrapper.service="TRUE" -Dwrapper.cpu.timeout="10" -Dwrapper.jvmid=1 org.tanukisoftware.wrapper.WrapperSimpleApp org.sonar.application.App
JVM started (PID=376)
WrapperManager class initialized by thread: main Using classloader: sun.misc.Launcher$AppClassLoader@5c647e05
Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
Copyright 1999-2006 Tanuki Software, Inc. All Rights Reserved.
Wrapper Manager: JVM #1
Running a 64-bit JVM.
Wrapper Manager: Registering shutdown hook
Wrapper Manager: Using wrapper
Load native library. One or more attempts may fail if platform specific libraries do not exist.
Loading native library failed: wrapper-windows-x86-64.dll Cause: java.lang.UnsatisfiedLinkError: no wrapper-windows-x86-64 in java.library.path
Loaded native library: wrapper.dll
Calling native initialization method.
Initializing WrapperManager native library.
Java Executable: C:Program FilesJavajdk1.8.0_72injava.exe
Windows version: 6.3.9600
Java Version : 1.8.0_72-b15 Java HotSpot(TM) 64-Bit Server VM
Java VM Vendor : Oracle Corporation
Control event monitor thread started.
Startup runner thread started.
WrapperManager.start(org.tanukisoftware.wrapper.WrapperSimpleApp@4f023edb, args[]) called by thread: main
Communications runner thread started.
Open socket to wrapper...Wrapper-Connection
Opened Socket from 31000 to 32000
Send a packet KEY : dvwrESWxTion4Weh
handleSocket(Socket[addr=/127.0.0.1,port=32000,localport=31000])
accepted a socket from 127.0.0.1 on port 31000
read a packet KEY : dvwrESWxTion4Weh
Got key from JVM: dvwrESWxTion4Weh
send a packet LOW_LOG_LEVEL : 1
send a packet PING_TIMEOUT : 0
send a packet PROPERTIES : (Property Values)
Start Application.
send a packet START : start
Received a packet LOW_LOG_LEVEL : 1
Wrapper Manager: LowLogLevel from Wrapper is 1
Received a packet PING_TIMEOUT : 0
PingTimeout from Wrapper is 0
Received a packet PROPERTIES : (Property Values)
Received a packet START : start
calling WrapperListener.start()
Waiting for WrapperListener.start runner thread to complete.
WrapperListener.start runner thread started.
WrapperSimpleApp: start(args) Will wait up to 2 seconds for the main method to complete.
WrapperSimpleApp: invoking main method
Wrapper Manager: ShutdownHook started
WrapperManager.stop(0) called by thread: Wrapper-Shutdown-Hook
Send a packet STOP : 0
Startup runner thread stopped.
read a packet STOP : 0
JVM requested a shutdown. (0)
wrapperStopProcess(0) called.
Sending stop signal to JVM
send a packet STOP : NULL
Send a packet START_PENDING : 5000
read a packet START_PENDING : 5000
JVM signalled a start pending with waitHint of 5000 millis.
Thread, Wrapper-Shutdown-Hook, handling the shutdown process.
shutdownJVM(0) Thread:Wrapper-Shutdown-Hook
Send a packet STOPPED : 0
read a packet STOPPED : 0
JVM signalled that it was stopped.
Closing socket.
socket read no code (closed?).
server listening on port 32002.
Send a packet START_PENDING : 5000
Wrapper Manager: ShutdownHook complete
WrapperSimpleApp: start(args) end. Main Completed=false, exitCode=null
WrapperListener.start runner thread stopped.
JVM process exited with a code of 0, leaving the wrapper exit code set to 0.
JVM exited normally.
<-- Wrapper Stopped
当使用“StartSonar.bat”从控制台运行时,在声纳启动之前会出现以下行,这些行在作为服务运行时不会出现
WrapperSimpleApp: start(args) Will wait up to 2 seconds for the main method to complete.
WrapperSimpleApp: invoking main method
2016.02.09 09:14:11 INFO app[o.s.p.m.JavaProcessLauncher] Launch process[search]: C:Program FilesJavajdk1.8.0_72jreinjava -Djava.awt.headless=true -Xmx1G -Xms256m -Xss256k -Djava.net.preferIPv4Stack=true -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+HeapDumpOnOutOfMemoryError -Djava.io.tmpdir=D:sonarqube-5.3 emp -cp ./lib/common/*;./lib/search/* org.sonar.search.SearchServer C:Users 8239AppDataLocalTempsq-process7650225466698856396properties
2016.02.09 09:14:11 INFO es[o.s.p.ProcessEntryPoint] Starting search
2016.02.09 09:14:11 INFO es[o.s.s.SearchSettings] Elasticsearch listening on 127.0.0.1:9001
通过包装器启动声纳是否需要某种分配特权?
随着Windows服务用户在本地添加并获得桌面交互权限,我现在可以启动SonarQube服务。
将SonarQube服务配置为不使用本地系统帐户,而是使用具有更多权限的其他用户。
看到 Running SonarQube as a Service on Windows Migrate SonarQube from Tomcat to a Windows service
另一个不需要从LocalSystem更改用户或提供额外权限的解决方案是在java.exe
中指定confwrapper.conf
二进制文件的完整路径。例:
wrapper.java.command=C:Program FilesJavajdk1.8.0_144injava.exe
由于日志文件中的错误消息(在logssonar.log
中)显示,所以包装器在分配Java进程时失败的假设是正确的。
在我的情况下,指定普通用户帐户并不是一个实用的解决方案,因为公司密码策略需要每隔几周更改一次密码。
以上是关于无法在Windows上将SonarQube 5.3作为服务运行的主要内容,如果未能解决你的问题,请参考以下文章
在 CentOS 上将 PHP 5.3 更新到 PHP 5.5 后,我无法访问 phpmyadmin