SonarQube 5.4 不会启动包装错误

SonarQube 5.4 won't start wrapper error

此处代码错误:

Starting SonarQube...
wrapper  | Spawning intermediate process...
Started SonarQube.

系统信息在这里:

Linux xxxxx 4.2.0-16-generic #19-Ubuntu SMP Thu Oct 8 15:35:06 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

java-版本 java 版本“1.8.0_77” Java(TM) SE 运行时环境(build 1.8.0_77-b03) Java HotSpot(TM) 64 位服务器 VM(内部版本 25.77-b03,混合模式)

并且 这里的wrapper.properties:

# Path to JVM executable. By default it must be available in PATH.
# Can be an absolute path, for example:
#wrapper.java.command=/path/to/my/jdk/bin/java

wrapper.java.command=/usr/lib/jvm/java-8-oracle/jre/bin/java

#
# DO NOT EDIT THE FOLLOWING SECTIONS
#


#********************************************************************
# Wrapper Java
#********************************************************************
wrapper.java.additional.1=-Djava.awt.headless=true
wrapper.java.mainclass=org.tanukisoftware.wrapper.WrapperSimpleApp
wrapper.java.classpath.1=../../lib/jsw/*.jar
wrapper.java.classpath.2=../../lib/*.jar
wrapper.java.library.path.1=./lib
wrapper.app.parameter.1=org.sonar.application.App
wrapper.java.initmemory=3
wrapper.java.maxmemory=3

#********************************************************************
# Wrapper Logs
#********************************************************************

wrapper.console.format=PM
wrapper.console.loglevel=DEBUG
wrapper.logfile=../../logs/sonar.log
wrapper.logfile.format=M
wrapper.logfile.loglevel=INFO

# Maximum size that the log file will be allowed to grow to before
#  the log is rolled. Size is specified in bytes.  The default value
#  of 0, disables log rolling.  May abbreviate with the 'k' (kb) or
#  'm' (mb) suffix.  For example: 10m = 10 megabytes.
#wrapper.logfile.maxsize=0

# Maximum number of rolled log files which will be allowed before old
#  files are deleted.  The default value of 0 implies no limit.
#wrapper.logfile.maxfiles=0

# Log Level for sys/event log output.  (See docs for log levels)
wrapper.syslog.loglevel=NONE

#********************************************************************
# Wrapper Windows Properties
#********************************************************************
# Title to use when running as a console
wrapper.console.title=SonarQube

# Disallow start of multiple instances of an application at the same time on Windows
wrapper.single_invocation=true

#********************************************************************
# Wrapper Windows NT/2000/XP Service Properties
#********************************************************************
# WARNING - Do not modify any of these properties when an application
#  using this configuration file has been installed as a service.
#  Please uninstall the service before modifying this section.  The
#  service can then be reinstalled.

# Name of the service
wrapper.ntservice.name=SonarQube

# Display name of the service
wrapper.ntservice.displayname=SonarQube

# Description of the service
wrapper.ntservice.description=SonarQube

# Service dependencies.  Add dependencies as needed starting from 1
wrapper.ntservice.dependency.1=

# Mode in which the service is installed.  AUTO_START or DEMAND_START
wrapper.ntservice.starttype=AUTO_START

# Allow the service to interact with the desktop.
wrapper.ntservice.interactive=false

#********************************************************************
# Forking Properties
#********************************************************************
wrapper.disable_restarts=TRUE
wrapper.ping.timeout=0
wrapper.shutdown.timeout=3000
wrapper.jvm_exit.timeout=3000

如果需要更多信息,sonar.sh 此处:

#! /bin/sh
#
# rc file for SonarQube
#
# chkconfig: 345 96 10
# description: SonarQube system (www.sonarsource.org)
#
### BEGIN INIT INFO
# Provides: sonar
# Required-Start: $network
# Required-Stop: $network
# Default-Start: 3 4 5
# Default-Stop: 0 1 2 6
# Short-Description: SonarQube system (www.sonarsource.org)
# Description: SonarQube system (www.sonarsource.org)
### END INIT INFO
#
# Copyright (c) 1999, 2006 Tanuki Software Inc.
#
# Java Service Wrapper sh script.  Suitable for starting and stopping
#  wrapped Java applications on UNIX platforms.
#

#-----------------------------------------------------------------------------
# These settings can be modified to fit the needs of your application

# Default values for the Application variables, below.
#
# NOTE: The build for specific applications may override this during the resource-copying
# phase, to fill in a concrete name and avoid the use of the defaults specified here.
DEF_APP_NAME="SonarQube"
DEF_APP_LONG_NAME="SonarQube"
SONAR_HOME=/opt/sonar
PLATFORM=linux-x86-64
# Application
APP_NAME="${DEF_APP_NAME}"
APP_LONG_NAME="${DEF_APP_LONG_NAME}"

# Wrapper
WRAPPER_CMD="${SONAR_HOME}/bin/${PLATFORM}/wrapper"
WRAPPER_CONF="${SONAR_HOME}/conf/wrapper.conf"

# Priority at which to run the wrapper.  See "man nice" for valid priorities.
#  nice is only used if a priority is specified.
PRIORITY=

# Location of the pid file.
PIDDIR="/var/run"

关于日志错误的更多信息:

[~]:/linux-x86-64/sonar.sh console
Running SonarQube...
wrapper  | --> Wrapper Started as Console
wrapper  | Using tick timer.
wrapperp | server listening on port 32000.
wrapper  | Command[0] : /usr/lib/jvm/java-8-oracle/jre/bin/java
wrapper  | Command[1] : -Djava.awt.headless=true
wrapper  | Command[2] : -Xms3m
wrapper  | Command[3] : -Xmx3m
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.4.jar
wrapper  | Command[7] : -Dwrapper.key=Z4yQiQf29fGXQCJP
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=16048
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@5c647e05
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    | Loaded native library: libwrapper-linux-x86-64.so
jvm 1    | Calling native initialization method.
jvm 1    | Inside native WrapperManager initialization method
jvm 1    | Java Version   : 1.8.0_77-b03 Java HotSpot(TM) 64-Bit Server VM
jvm 1    | Java VM Vendor : Oracle Corporation
jvm 1    |
jvm 1    | Control event monitor thread started.
jvm 1    | Startup runner thread started.
jvm 1    | WrapperManager.start(org.tanukisoftware.wrapper.WrapperSimpleApp@4f023edb, args[]) called by thread: main
jvm 1    | Communications runner thread started.
jvm 1    | Open socket to wrapper...Wrapper-Connection
jvm 1    | Opened Socket from 31000 to 32000
jvm 1    | Send a packet KEY : Z4yQiQf29fGXQCJP
jvm 1    | handleSocket(Socket[addr=/127.0.0.1,port=32000,localport=31000])
wrapperp | accepted a socket from 127.0.0.1 on port 31000
wrapperp | read a packet KEY : Z4yQiQf29fGXQCJP
wrapper  | Got key from JVM: Z4yQiQf29fGXQCJP
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    | 2016.04.10 04:51:23 INFO  app[o.s.a.AppFileSystem] Cleaning or creating temp directory /opt/sonar/temp
jvm 1    | 2016.04.10 04:51:23 INFO  app[o.s.p.m.JavaProcessLauncher] Launch process[search]: /usr/lib/jvm/java-8-oracle/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-process5756979811171898411properties
jvm 1    | Send a packet START_PENDING : 5000
jvm 1    | Wrapper Manager: ShutdownHook started
jvm 1    | WrapperManager.stop(0) called by thread: Wrapper-Shutdown-Hook
jvm 1    | Send a packet STOP : 0
wrapperp | read a packet START_PENDING : 5000
wrapper  | JVM signalled a start pending with waitHint of 5000 millis.
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    | Startup runner thread stopped.
jvm 1    | Send a packet START_PENDING : 5000
jvm 1    | WrapperSimpleApp: start(args) end.  Main Completed=false, exitCode=null
jvm 1    | WrapperListener.start runner thread stopped.
jvm 1    | returned from WrapperListener.start()
jvm 1    | Send a packet STARTED :
jvm 1    | Received a packet STOP :
jvm 1    | Thread, Wrapper-Shutdown-Hook, handling the shutdown process.
jvm 1    | calling listener.stop()
jvm 1    | WrapperSimpleApp: stop(0)
jvm 1    | returned from listener.stop() -> 0
jvm 1    | shutdownJVM(0) Thread:Wrapper-Shutdown-Hook
jvm 1    | Send a packet STOPPED : 0
wrapperp | read a packet START_PENDING : 5000
wrapper  | JVM signalled a start pending with waitHint of 5000 millis.
wrapperp | read a packet STARTED :
wrapper  | JVM signalled that it was started.
wrapperp | send a packet STOP : NULL
wrapperp | read a packet STOPPED : 0
wrapper  | JVM signalled that it was stopped.
jvm 1    | Received a packet STOP :
jvm 1    | Closing socket.
wrapperp | socket read no code (closed?).
wrapperp | server listening on port 32001.
jvm 1    | Server daemon shut down
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

如前所述,当 JVM 无法启动时会发生此错误。在您的情况下,无法分配所需的最小内存量。