0

我最近在我的 RHEL 6.6 服务器上安装了 Sonarqube 5.1.2 的本机 RPM 包。我使用 64 位 OpenJDK 1.8.0_51 和 MySQL 作为数据库。Sonarqube 使用安装文件夹中 /bin 中的 sonar.sh 脚本(在我的情况下为 /opt/sonar)以 root 完美启动,但它不适用于 /etc/init 中的包创建的启动脚本。 d。

这是日志导出:

Running SonarQube...
wrapper  | --> Wrapper Started as Console
wrapper  | Using tick timer.
wrapperp | server listening on port 32000.
wrapper  | Command[0] : /etc/alternatives/java_sdk/bin/java
wrapper  | Command[1] : -Djava.awt.headless=true
wrapper  | Command[2] : -Xms3m
wrapper  | Command[3] : -Xmx32m
wrapper  | Command[4] : -Djava.library.path=./lib
wrapper  | Command[5] : -classpath
wrapper  | Command[6] : ../../lib/jsw/wrapper-3.2.3.jar:../../lib/sonar-application-5.1.2.jar
wrapper  | Command[7] : -Dwrapper.key=sdELP0aWwf4S5hdM
wrapper  | Command[8] : -Dwrapper.port=32000
wrapper  | Command[9] : -Dwrapper.jvm.port.min=31000
wrapper  | Command[10] : -Dwrapper.jvm.port.max=31999
wrapper  | Command[11] : -Dwrapper.debug=TRUE
wrapper  | Command[12] : -Dwrapper.pid=23176
wrapper  | Command[13] : -Dwrapper.version=3.2.3
wrapper  | Command[14] : -Dwrapper.native_library=wrapper
wrapper  | Command[15] : -Dwrapper.cpu.timeout=10
wrapper  | Command[16] : -Dwrapper.jvmid=1
wrapper  | Command[17] : org.tanukisoftware.wrapper.WrapperSimpleApp
wrapper  | Command[18] : org.sonar.application.App
wrapper  | Launching a JVM...
jvm 1    | WrapperManager class initialized by thread: main  Using classloader: sun.misc.Launcher$AppClassLoader@4e25154f
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    | Wrapper Manager: JVM #1
jvm 1    | Running a 64-bit JVM.
jvm 1    | Wrapper Manager: Registering shutdown hook
jvm 1    | Wrapper Manager: Using wrapper
jvm 1    | Load native library.  One or more attempts may fail if platform specific libraries do not exist.
jvm 1    | Loading native library failed: libwrapper-linux-x86-64.so  Cause: java.lang.UnsatisfiedLinkError: no wrapper-linux-x86-64 in java.library.path
jvm 1    | Loaded native library: libwrapper.so
jvm 1    | Calling native initialization method.
jvm 1    | Inside native WrapperManager initialization method
jvm 1    | Java Version   : 1.8.0_51-b16 OpenJDK 64-Bit Server VM
jvm 1    | Java VM Vendor : Oracle Corporation
jvm 1    |
jvm 1    | Startup runner thread started.
jvm 1    | Control event monitor thread started.
jvm 1    | WrapperManager.start(org.tanukisoftware.wrapper.WrapperSimpleApp@4a574795, args[]) called by thread: main
jvm 1    | Communications runner thread started.
jvm 1    | Open socket to wrapper...Wrapper-Connection
jvm 1    | Failed attempt to bind using local port 31000
jvm 1    | Opened Socket from 31001 to 32000
jvm 1    | Send a packet KEY : sdELP0aWwf4S5hdM
jvm 1    | handleSocket(Socket[addr=/127.0.0.1,port=32000,localport=31001])
wrapperp | accepted a socket from 127.0.0.1 on port 31001
wrapperp | read a packet KEY : sdELP0aWwf4S5hdM
wrapper  | Got key from JVM: sdELP0aWwf4S5hdM
wrapperp | send a packet LOW_LOG_LEVEL : 1
wrapperp | send a packet PING_TIMEOUT : 0
wrapperp | send a packet PROPERTIES : (Property Values)
wrapper  | Start Application.
wrapperp | send a packet START : start
jvm 1    | Received a packet LOW_LOG_LEVEL : 1
jvm 1    | Wrapper Manager: LowLogLevel from Wrapper is 1
jvm 1    | Received a packet PING_TIMEOUT : 0
jvm 1    | PingTimeout from Wrapper is 0
jvm 1    | Received a packet PROPERTIES : (Property Values)
jvm 1    | Received a packet START : start
jvm 1    | calling WrapperListener.start()
jvm 1    | Waiting for WrapperListener.start runner thread to complete.
jvm 1    | WrapperListener.start runner thread started.
jvm 1    | WrapperSimpleApp: start(args) Will wait up to 2 seconds for the main method to complete.
jvm 1    | WrapperSimpleApp: invoking main method
jvm 1    | Wrapper Manager: ShutdownHook started
jvm 1    | WrapperManager.stop(0) called by thread: Wrapper-Shutdown-Hook
jvm 1    | Send a packet STOP : 0
jvm 1    | Startup runner thread stopped.
wrapperp | read a packet STOP : 0
wrapper  | JVM requested a shutdown. (0)
wrapper  | wrapperStopProcess(0) called.
wrapper  | Sending stop signal to JVM
wrapperp | send a packet STOP : NULL
jvm 1    | Send a packet START_PENDING : 5000
wrapperp | read a packet START_PENDING : 5000
wrapper  | JVM signalled a start pending with waitHint of 5000 millis.
jvm 1    | Thread, Wrapper-Shutdown-Hook, handling the shutdown process.
jvm 1    | shutdownJVM(0) Thread:Wrapper-Shutdown-Hook
jvm 1    | Send a packet STOPPED : 0
wrapperp | read a packet STOPPED : 0
wrapper  | JVM signalled that it was stopped.
jvm 1    | Closing socket.
wrapperp | socket read no code (closed?).
wrapperp | server listening on port 32001.
jvm 1    | Wrapper Manager: ShutdownHook complete
wrapper  | JVM exited normally.
wrapper  | Signal trapped.  Details:
wrapper  |   signal number=17 (SIGCHLD), source="unknown"
wrapper  | Received SIGCHLD, checking JVM process status.
wrapper  | JVM process exited with a code of 0, leaving the wrapper exit code set to 0.
wrapper  | <-- Wrapper Stopped

我知道它必须是具有“声纳”用户权限的东西,它也是由安装包创建的,我已经确保 /opt/sonar 文件夹归声纳用户所有,但这些日志仍然无法分辨我缺少什么。我还将上面的日志与我以 root 用户启动脚本时的日志进行了比较,我能够指出至少一些差异。

使用root,调用main方法后,实际的java进程正常启动:

.
.
jvm 1    | WrapperSimpleApp: invoking main method
jvm 1    | INFO  app[o.s.p.m.JavaProcessLauncher] Launch process[search]: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.51-1.b16.el6_7.x86_64/jre/bin/java -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=/opt/sonar/temp -cp ./lib/common/*:./lib/search/* org.sonar.search.SearchServer /tmp/sq-process3395120832375267732properties

对于声纳用户,它没有启动,JVM(或包装器)只是启动关闭:

.
.
jvm 1    | WrapperSimpleApp: invoking main method
jvm 1    | Wrapper Manager: ShutdownHook started
jvm 1    | WrapperManager.stop(0) called by thread: Wrapper-Shutdown-Hook

不幸的是,我不知道声纳用户可能缺少什么,因为根据 RPM 包描述,启动脚本应该在没有 root 权限的情况下工作。

任何人都可以帮助我或指出正确的方向吗?如果没有必要,我真的不想以 root 身份运行 Sonarqube。

提前感谢您的帮助!

4

1 回答 1

0

您是否最初使用 root 帐户启动声纳(通过 sonar.sh)?如果是这样,您是否 chown -r /opt/sonar 目录到 sonar 用户?

于 2015-09-10T13:19:47.160 回答