我已经在我的Ubuntu 14.04 LTS上安装了声纳(我使用vagrant在windows中运行),遵循教程here
我的sonar.properties文件位于
之下/opt/sonar/conf/sonar.properties
sonar.jdbc.username=sonar
sonar.jdbc.password=sonar
sonar.jdbc.url=jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformance
sonar.web.host=127.0.0.1
sonar.web.context=/sonar
sonar.web.port=9000
sonar.jdbc.driverClassName=com.mysql.jdbc.Driver
sonar.jdbc.validationQuery=select 1
sonar.jdbc.dialect=mysql
sonar.jdbc.maxActive=20 sonar.jdbc.maxIdle=5
sonar.jdbc.minIdle=2
sonar.jdbc.maxWait=5000
sonar.jdbc.minEvictableIdleTimeMillis=600000
sonar.jdbc.timeBetweenEvictionRunsMillis=30000
安装完成后,我重新启动,启动声纳,如下所示
/opt/sonar/bin/linux-x86-64/sonar.sh restart
/opt/sonar/bin/linux-x86-64/sonar.sh start
现在我已经检查了声纳的状态,如下所示
/opt/sonar/bin/linux-x86-64/sonar.sh status
并且输出 SonarQube正在运行。
经过一段时间(如15秒)后,我再次检查了状态,现在输出 SonarQube未运行。
我不知道导致声纳立即关闭的原因是什么,因为它没有显示任何错误
sonar.log( /opt/sonar/logs/sonar.log )文件输出
--> 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.
2017.07.28 06:47:48 INFO app[o.s.a.AppFileSystem] Cleaning or creating temp directory /opt/sonar/temp
2017.07.28 06:47:48 INFO app[o.s.p.m.JavaProcessLauncher] Launch process[es]: /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 -javaagent:/usr/lib/jvm/java-8-oracle/jre/lib/management-agent.jar -cp ./lib/common/*:./lib/search/* org.sonar.search.SearchServer /opt/sonar/temp/sq-process8071013234782021313properties
2017.07.28 06:47:48 INFO es[o.s.p.ProcessEntryPoint] Starting es
2017.07.28 06:47:48 INFO es[o.s.s.EsSettings] Elasticsearch listening on 127.0.0.1:9001
2017.07.28 06:47:49 INFO es[o.elasticsearch.node] [sonar-1501224467799] version[1.7.5], pid[5493], build[00f95f4/2016-02-02T09:55:30Z]
2017.07.28 06:47:49 INFO es[o.elasticsearch.node] [sonar-1501224467799] initializing ...
2017.07.28 06:47:49 INFO es[o.e.plugins] [sonar-1501224467799] loaded [], sites []
2017.07.28 06:47:49 INFO es[o.elasticsearch.env] [sonar-1501224467799] using [1] data paths, mounts [[/ (/dev/sda1)]], net usable_space [34.3gb], net total_space [39.3gb], types [ext4]
2017.07.28 06:47:50 WARN es[o.e.bootstrap] JNA not found. native methods will be disabled.
2017.07.28 06:47:52 INFO es[o.elasticsearch.node] [sonar-1501224467799] initialized
2017.07.28 06:47:52 INFO es[o.elasticsearch.node] [sonar-1501224467799] starting ...
2017.07.28 06:47:52 INFO es[o.e.transport] [sonar-1501224467799] bound_address {inet[/127.0.0.1:9001]}, publish_address {inet[/127.0.0.1:9001]}
2017.07.28 06:47:52 INFO es[o.e.discovery] [sonar-1501224467799] sonarqube/a-DrjveQTd6cOLiDMQGFPA
2017.07.28 06:47:55 INFO es[o.e.cluster.service] [sonar-1501224467799] new_master [sonar-1501224467799][a-DrjveQTd6cOLiDMQGFPA][vagrant-ubuntu-trusty-64][inet[/127.0.0.1:9001]]{rack_id=sonar-1501224467799}, reason: zen-disco-join (elected_as_master)
2017.07.28 06:47:55 INFO es[o.elasticsearch.node] [sonar-1501224467799] started
2017.07.28 06:47:55 INFO es[o.e.gateway] [sonar-1501224467799] recovered [0] indices into cluster_state
2017.07.28 06:47:55 INFO app[o.s.p.m.Monitor] Process[es] is up
2017.07.28 06:47:55 INFO app[o.s.p.m.JavaProcessLauncher] Launch process[web]: /usr/lib/jvm/java-8-oracle/jre/bin/java -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djruby.management.enabled=false -Djruby.compile.invokedynamic=false -Xmx512m -Xms128m -XX:+HeapDumpOnOutOfMemoryError -Djava.net.preferIPv4Stack=true -Djava.io.tmpdir=/opt/sonar/temp -javaagent:/usr/lib/jvm/java-8-oracle/jre/lib/management-agent.jar -cp ./lib/common/*:./lib/server/*:/opt/sonar/lib/jdbc/mysql/mysql-connector-java-5.1.35.jar org.sonar.server.app.WebServer /opt/sonar/temp/sq-process7630170265596703695properties
2017.07.28 06:47:56 INFO web[o.s.p.ProcessEntryPoint] Starting web
2017.07.28 06:47:56 INFO web[o.s.s.a.TomcatContexts] Webapp directory: /opt/sonar/web
2017.07.28 06:47:57 INFO web[o.a.c.h.Http11NioProtocol] Initializing ProtocolHandler ["http-nio-127.0.0.1-9000"]
2017.07.28 06:47:57 INFO web[o.a.t.u.n.NioSelectorPool] Using a shared selector for servlet write/read
2017.07.28 06:47:58 INFO web[o.s.s.p.ServerImpl] SonarQube Server / 5.6.4 / 52298794f1a34a4fd713ff8d441a0c13432e40a9
2017.07.28 06:47:58 INFO web[o.sonar.db.Database] Create JDBC data source for jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformance
2017.07.28 06:47:58 ERROR web[o.a.c.c.C.[.[.[/]] Exception sending context initialized event to listener instance of class org.sonar.server.platform.PlatformServletContextListener
java.lang.NumberFormatException: For input string: "20 sonar.jdbc.maxIdle=5"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) ~[na:1.8.0_131]
at java.lang.Integer.parseInt(Integer.java:580) ~[na:1.8.0_131]
at java.lang.Integer.parseInt(Integer.java:615) ~[na:1.8.0_131]
at org.apache.commons.dbcp.BasicDataSourceFactory.createDataSource(BasicDataSourceFactory.java:223) ~[commons-dbcp-1.4.jar:1.4]
at org.sonar.db.DefaultDatabase.initDataSource(DefaultDatabase.java:92) ~[sonar-db-5.6.4.jar:na]
at org.sonar.db.DefaultDatabase.start(DefaultDatabase.java:70) ~[sonar-db-5.6.4.jar:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_131]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_131]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_131]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_131]
at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.invokeMethod(ReflectionLifecycleStrategy.java:110) ~[picocontainer-2.15.jar:na]
at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.start(ReflectionLifecycleStrategy.java:89) ~[picocontainer-2.15.jar:na]
at org.sonar.core.platform.ComponentContainer$1.start(ComponentContainer.java:320) ~[sonar-core-5.6.4.jar:na]
at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.start(AbstractInjectionFactory.java:84) ~[picocontainer-2.15.jar:na]
--> Wrapat org.picocontainer.behaviors.AbstractBehavior.start(AbstractBehavior.java:169) ~[picocontainer-2.15.jar:na]
Launchinat org.picocontainer.behaviors.Stored$RealComponentLifecycle.start(Stored.java:132) ~[picocontainer-2.15.jar:na]
Wrapper at org.picocontainer.behaviors.Stored.start(Stored.java:110) ~[picocontainer-2.15.jar:na]
Copyriat org.picocontainer.DefaultPicoContainer.potentiallyStartAdapter(DefaultPicoContainer.java:1016) ~[picocontainer-2.15.jar:na]
at org.picocontainer.DefaultPicoContainer.startAdapters(DefaultPicoContainer.java:1009) ~[picocontainer-2.15.jar:na]
2017.07.at org.picocontainer.DefaultPicoContainer.start(DefaultPicoContainer.java:767) ~[picocontainer-2.15.jar:na]
2017.07.at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:141) ~[sonar-core-5.6.4.jar:na].awt.headless=true -Xmx1G -Xms256m -Xss256k -Djava.net.preferIPv4Stack=true -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:CMat org.sonar.server.platform.platformlevel.PlatformLevel.start(PlatformLevel.java:84) ~[sonar-server-5.6.4.jar:na]r=/opt/sonar/temp -javaagent:/usr/lib/jvm/java-8-oracle/jre/lib/management-agent.jar -cp ./lib/common/*:./lib/search/* org.sonat org.sonar.server.platform.Platform.start(Platform.java:216) ~[sonar-server-5.6.4.jar:na]
2017.07.at org.sonar.server.platform.Platform.startLevel1Container(Platform.java:175) ~[sonar-server-5.6.4.jar:na]
2017.07.at org.sonar.server.platform.Platform.init(Platform.java:90) ~[sonar-server-5.6.4.jar:na]
2017.07.at org.sonar.server.platform.PlatformServletContextListener.contextInitialized(PlatformServletContextListener.java:43) ~[sonar-server-5.6.4.jar:na]
2017.07.at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4812) [tomcat-embed-core-8.0.32.jar:8.0.32]
2017.07.at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5255) [tomcat-embed-core-8.0.32.jar:8.0.32]
2017.07.at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147) [tomcat-embed-core-8.0.32.jar:8.0.32])]], net usable_space [34.3gb], net total_space [39.3gb], types [ext4]
2017.07.at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408) [tomcat-embed-core-8.0.32.jar:8.0.32]
2017.07.at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398) [tomcat-embed-core-8.0.32.jar:8.0.32]
2017.07.at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_131]g ...
2017.07.at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_131], publish_address {inet[/127.0.0.1:9001]}
2017.07.at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_131]
2017.07.at java.lang.Thread.run(Thread.java:748) [na:1.8.0_131]224467799] new_master [sonar-1501224467799][a-DrjveQTd6cOLiDMQGFPA][vagrant-ubuntu-trusty-64][inet[/127.0.0.1:9001]]{rack_id=sonar-1501224467799}, reason: zen-disco-join (electe2017.07.28 06:47:58 ERROR web[o.a.c.c.StandardContext] One or more listeners failed to start. Full details will be found in the appropriate container log file
2017.07.28 06:47:58 ERROR web[o.a.c.c.StandardContext] Context [] startup failed due to previous errors
2017.07.28 06:47:58 WARN web[o.a.c.l.WebappClassLoaderBase] The web application [ROOT] appears to have started a thread named [Abandoned connection cleanup thread] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: INFO app[o.s.p.m.Monitor] Process[es] is up
java.lang.Object.wait(Native Method).JavaProcessLauncher] Launch process[web]: /usr/lib/jvm/java-8-oracle/jre/bin/java -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djruby.management.enabled=false -Djruby.compile.invokedynamic=false -Xmx java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:143)erIPv4Stack=true -Djava.io.tmpdir=/opt/sonar/temp -javaagent:/usr/lib/jvm/java-8-oracle/jre/lib/management-agent.jar -cp ./lib/common/*:./lib/server/*:/opt/sonar/lib/jdbc/mysql/my com.mysql.jdbc.AbandonedConnectionCleanupThread.run(AbandonedConnectionCleanupThread.java:43)265596703695properties
2017.07.28 06:47:58 INFO web[o.a.c.h.Http11NioProtocol] Starting ProtocolHandler ["http-nio-127.0.0.1-9000"]
2017.07.28 06:47:58 INFO web[o.s.s.a.TomcatAccessLog] Web server is started/sonar/web
2017.07.28 06:47:58 INFO web[o.s.s.a.EmbeddedTomcat] HTTP connector enabled on port 9000ttp-nio-127.0.0.1-9000"]
2017.07.28 06:47:58 WARN web[o.s.p.ProcessEntryPoint] Fail to start webselector for servlet write/read
java.lang.IllegalStateException: Webapp did not startarQube Server / 5.6.4 / 52298794f1a34a4fd713ff8d441a0c13432e40a9
2017.07.at org.sonar.server.app.EmbeddedTomcat.isUp(EmbeddedTomcat.java:84) ~[sonar-server-5.6.4.jar:na]06/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformance
2017.07.at org.sonar.server.app.WebServer.isUp(WebServer.java:47) [sonar-server-5.6.4.jar:na]to listener instance of class org.sonar.server.platform.PlatformServletContextListener
java.lanat org.sonar.process.ProcessEntryPoint.launch(ProcessEntryPoint.java:105) ~[sonar-process-5.6.4.jar:na]
at org.sonar.server.app.WebServer.main(WebServer.java:68) [sonar-server-5.6.4.jar:na]:1.8.0_131]
2017.07.28 06:47:58 INFO web[o.a.c.h.Http11NioProtocol] Pausing ProtocolHandler ["http-nio-127.0.0.1-9000"]
2017.07.28 06:47:59 INFO web[o.a.c.h.Http11NioProtocol] Stopping ProtocolHandler ["http-nio-127.0.0.1-9000"]
2017.07.28 06:47:59 INFO web[o.a.c.h.Http11NioProtocol] Destroying ProtocolHandler ["http-nio-127.0.0.1-9000"]ommons-dbcp-1.4.jar:1.4]
2017.07.28 06:47:59 INFO web[o.s.s.a.TomcatAccessLog] Web server is stopped92) ~[sonar-db-5.6.4.jar:na]
2017.07.28 06:48:00 INFO app[o.s.p.m.Monitor] Process[es] is stopping ~[sonar-db-5.6.4.jar:na]
2017.07.28 06:48:00 INFO es[o.s.p.StopWatcher] Stopping processhod) ~[na:1.8.0_131]
2017.07.28 06:48:00 INFO es[o.elasticsearch.node] [sonar-1501224467799] stopping ...
2017.07.28 06:48:00 INFO es[o.elasticsearch.node] [sonar-1501224467799] stopped
2017.07.28 06:48:00 INFO es[o.elasticsearch.node] [sonar-1501224467799] closing ...
2017.07.28 06:48:00 INFO es[o.elasticsearch.node] [sonar-1501224467799] closed
2017.07.28 06:48:00 INFO app[o.s.p.m.Monitor] Process[es] is stopped
<-- Wrapper Stopped
我已经检查过mysql是否正在运行,如下所示,它正在运行
mysqladmin -u root -p status
Uptime: 2781 Threads: 1 Questions: 122 Slow queries: 0 Opens: 48 Flush tables: 1 Open tables: 41 Queries per second avg: 0.043
所以最后我不明白是什么让声纳在启动后的一段时间后关闭,以及为了连续运行声纳以及在哪里调试会发生什么变化?
答案 0 :(得分:2)
你在这里缺少换行符:
.my-grid {
display:grid;
grid-template-columns: 15% 1fr 25% ;
grid-template-rows: 1fr; /* for as many rows as you need */
grid-gap: 10px;
border: 2px solid #222;
box-sizing: border-box;
}
Sonar无法解析sonar.jdbc.maxActive=20 sonar.jdbc.maxIdle=5
选项,因为第一个maxActive
之后的所有内容都被解析为整数。这显然失败了:
java.lang.NumberFormatException:对于输入字符串:“20 sonar.jdbc.maxIdle = 5”
简单的解决方案:
=