升级到SonarQube v5.1.2(从v4.3开始)时,我们遇到了问题。
我们做了两次尝试,但不幸的是都失败了。 你知道如何解决这个问题吗?
sonar.log的第一行:
Launching a JVM...
Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
Copyright 1999-2006 Tanuki Software, Inc. All Rights Reserved.
INFO app[o.s.p.m.JavaProcessLauncher] Launch process[search]: /usr/java/jdk1.8.0_51/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=/home/sonar/sonarqube-5.1.2/temp -cp ./lib/common/*:./lib/search/* org.sonar.search.SearchServer /tmp/sq-process2340632225276692772properties
INFO es[o.s.p.ProcessEntryPoint] Starting search
INFO es[o.s.s.SearchServer] Starting Elasticsearch[sonarqube] on port 9001
INFO es[o.elasticsearch.node] [sonar-1438669636197] version[1.4.4], pid[1922], build[c88f77f/2015-02-19T13:05:36Z]
INFO es[o.elasticsearch.node] [sonar-1438669636197] initializing ...
INFO es[o.e.plugins] [sonar-1438669636197] loaded [], sites []
INFO es[o.elasticsearch.node] [sonar-1438669636197] initialized
INFO es[o.elasticsearch.node] [sonar-1438669636197] starting ...
INFO es[o.e.transport] [sonar-1438669636197] bound_address {inet[/0.0.0.0:9001]}, publish_address {inet[/172.18.131.174:9001]}
INFO es[o.e.discovery] [sonar-1438669636197] sonarqube/9CC-OoQhRdmgJA5FerS6Ow
INFO es[o.e.cluster.service] [sonar-1438669636197] new_master [sonar-1438669636197][9CC-OoQhRdmgJA5FerS6Ow][sonar.xxxxx-yyyyy.com][inet[/172.18.131.174:9001]]{rack_id=sonar-1438669636197}, reason: zen-disco-join (elected_as_master)
INFO es[o.elasticsearch.node] [sonar-1438669636197] started
INFO es[o.e.gateway] [sonar-1438669636197] recovered [6] indices into cluster_state
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=512m; support was removed in 8.0
INFO app[o.s.p.m.Monitor] Process[search] is up
INFO app[o.s.p.m.JavaProcessLauncher] Launch process[web]: /usr/java/jdk1.8.0_51/jre/bin/java -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djruby.management.enabled=false -Djruby.compile.invokedynamic=false -Xmx4096M -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -Djruby.management.enabled=false -server -Djava.io.tmpdir=/home/sonar/sonarqube-5.1.2/temp -cp ./lib/common/*:./lib/server/*:/home/sonar/sonarqube-5.1.2/extensions/jdbc-driver/oracle/ojdbc6.jar org.sonar.server.app.WebServer /tmp/sq-process1374933862508638147properties
INFO web[o.s.p.ProcessEntryPoint] Starting web
INFO web[o.s.s.app.Webapp] Webapp directory: /home/sonar/sonarqube-5.1.2/web
INFO web[o.a.c.h.Http11NioProtocol] Initializing ProtocolHandler ["http-nio-0.0.0.0-8080"]
INFO web[o.a.t.u.n.NioSelectorPool] Using a shared selector for servlet write/read
以下是sonar.log文件的尾随行:
INFO web[o.s.s.es.BulkIndexer] 258201 requests processed (1528 items/sec)
INFO web[o.s.s.es.BulkIndexer] 347558 requests processed (1489 items/sec)
INFO web[o.s.s.es.BulkIndexer] 480274 requests processed (2211 items/sec)
INFO web[o.s.s.es.BulkIndexer] 599469 requests processed (1986 items/sec)
INFO web[o.s.s.es.BulkIndexer] 723744 requests processed (2071 items/sec)
INFO es[o.e.monitor.jvm] [sonar-1438625732248] [gc][young][6048][167] duration [889ms], collections [1]/[1.5s], total [889ms]/[3.7s], memory [139.7mb]->[64.8mb]/[1007.3mb], all_pools {[young] [80.4mb]->[582.5kb]/[133.1mb]}{[survivor] [10.2mb]->[14.3mb]/[16.6mb]}{[old] [48.9mb]->[49.9mb]/[857.6mb]}
INFO web[o.s.s.es.BulkIndexer] 851566 requests processed (2130 items/sec)
INFO web[o.s.s.es.BulkIndexer] 990080 requests processed (2308 items/sec)
INFO web[o.s.s.es.BulkIndexer] 1123117 requests processed (2217 items/sec)
INFO web[o.s.s.es.BulkIndexer] 1252505 requests processed (2156 items/sec)
INFO web[o.s.s.es.BulkIndexer] 1383991 requests processed (2191 items/sec)
INFO web[o.s.s.es.BulkIndexer] 1508978 requests processed (2083 items/sec)
WARN es[o.e.monitor.jvm] [sonar-1438625732248] [gc][young][6403][338] duration [1.1s], collections [1]/[2.5s], total [1.1s]/[6.8s], memory [169.3mb]->[79.2mb]/[1007.3mb], all_pools {[young] [86.8mb]->[1.7mb]/[133.1mb]}{[survivor] [16.6mb]->[9.2mb]/[16.6mb]}{[old] [65.8mb]->[68.2mb]/[857.6mb]}
WARN es[o.e.monitor.jvm] [sonar-1438625732248] [gc][young][6418][345] duration [2.7s], collections [1]/[3.4s], total [2.7s]/[9.6s], memory [137mb]->[42.9mb]/[1007.3mb], all_pools {[young] [99.7mb]->[1mb]/[133.1mb]}{[survivor] [13.1mb]->[14.3mb]/[16.6mb]}{[old] [24.1mb]->[27.5mb]/[857.6mb]}
INFO web[o.s.s.es.BulkIndexer] 1643805 requests processed (2247 items/sec)
INFO web[o.s.s.es.BulkIndexer] 1757738 requests processed (1898 items/sec)
WARN es[o.e.monitor.jvm] [sonar-1438625732248] [gc][young][6514][400] duration [2.9s], collections [1]/[3.1s], total [2.9s]/[13.3s], memory [143.1mb]->[60.5mb]/[1007.3mb], all_pools {[young] [81.3mb]->[2.1kb]/[133.1mb]}{[survivor] [15.1mb]->[13.1mb]/[16.6mb]}{[old] [46.6mb]->[47.3mb]/[857.6mb]}
WARN web[o.e.transport] [sonar-1438625732248] Transport response handler not found of id [6348]
INFO web[o.e.client.transport] [sonar-1438625732248] failed to get node info for [#transport#-1][sonar][inet[/127.0.0.2:9001]], disconnecting...
org.elasticsearch.transport.ReceiveTimeoutTransportException: [][inet[/127.0.0.2:9001]][cluster:monitor/nodes/info] request_id [6348] timed out after [5437ms]
at org.elasticsearch.transport.TransportService$TimeoutHandler.run(TransportService.java:366) ~[elasticsearch-1.4.4.jar:na]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_51]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_51]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_51]
ERROR web[o.s.s.ui.JRubyFacade] Fail to upgrade database
java.util.concurrent.ExecutionException: org.elasticsearch.client.transport.NoNodeAvailableException: None of the configured nodes are available: []
com.google.common.base.Throwables.propagate(Throwables.java:156)
org.sonar.server.es.BaseIndexer.index(BaseIndexer.java:77)
org.sonar.server.search.IndexSynchronizer.execute(IndexSynchronizer.java:87)
org.sonar.server.platform.ServerComponents$1.doPrivileged(ServerComponents.java:852)
org.sonar.server.user.DoPrivileged.execute(DoPrivileged.java:43)
org.sonar.server.platform.ServerComponents.executeStartupTasks(ServerComponents.java:847)
org.sonar.server.platform.Platform.executeStartupTasks(Platform.java:126)
org.sonar.server.platform.Platform.startLevel34Containers(Platform.java:122)
org.sonar.server.platform.Platform.doStart(Platform.java:81)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:497)
org.jruby.javasupport.JavaMethod.invokeDirectWithExceptionHandling(JavaMethod.java:440)
org.jruby.javasupport.JavaMethod.invokeDirect(JavaMethod.java:304)
org.jruby.java.invokers.InstanceMethodInvoker.call(InstanceMethodInvoker.java:52)
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:306)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:136)
org.jruby.ast.CallNoArgNode.interpret(CallNoArgNode.java:60)
org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:74)
org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:139)
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:182)
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:306)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:136)
org.jruby.ast.CallNoArgNode.interpret(CallNoArgNode.java:60)
org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
org.jruby.ast.RescueNode.executeBody(RescueNode.java:221)
org.jruby.ast.RescueNode.interpret(RescueNode.java:116)
org.jruby.ast.BeginNode.interpret(BeginNode.java:83)
org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
org.jruby.evaluator.ASTInterpreter.INTERPRET_BLOCK(ASTInterpreter.java:112)
org.jruby.runtime.InterpretedBlock.evalBlockBody(InterpretedBlock.java:384)
org.jruby.runtime.InterpretedBlock.yield(InterpretedBlock.java:336)
org.jruby.runtime.BlockBody.call(BlockBody.java:73)
org.jruby.runtime.Block.call(Block.java:101)
org.jruby.RubyProc.call(RubyProc.java:290)
org.jruby.RubyProc.call(RubyProc.java:228)
org.jruby.internal.runtime.RubyRunnable.run(RubyRunnable.java:97)
java.lang.Thread.run(Thread.java:745)
INFO web[o.s.s.es.BulkIndexer] 1824543 requests processed (1113 items/sec)
INFO web[o.s.s.es.BulkIndexer] 1824543 requests processed (0 items/sec)
INFO web[o.s.s.es.BulkIndexer] 1824543 requests processed (0 items/sec)
INFO web[o.s.s.es.BulkIndexer] 1824543 requests processed (0 items/sec)
INFO web[o.s.s.es.BulkIndexer] 1824543 requests processed (0 items/sec)
答案 0 :(得分:0)
查看你的sonar.log,看来你在端口9001上运行的搜索服务器(弹性搜索)正在超时。
org.elasticsearch.transport.ReceiveTimeoutTransportException:[] [inet [/127.0.0.2:9001]] [cluster:monitor / nodes / info] request_id [6348]在[5437ms]之后超时 请检查您的网络是否运行缓慢。将searchserver的线程转储在升级时尝试做什么。您可以使用命令找到搜索服务器的进程ID: netstat -lpn | grep 9001 一旦有了进程ID,就可以使用jstack pid进行线程转储。
答案 1 :(得分:0)
查看您提供的sonar.log
提取,您将面临从ElasticSearch HttpClient到SonarQube中嵌入的ElasticSearch服务器的连接超时。
迁移到5.1.2时,会(重新)创建一些ES索引。这就是各种2015.08.03 21:59:46 INFO web[o.s.s.es.BulkIndexer] XXXXX requests (YYYY items/sec)
日志所表明的内容。
在引发错误之前,我们会看到很多这些日志,但也会看到来自ElasticSearch的GC警告(WARN es[o.e.monitor.jvm] [sonar-1438625732248] [gc][young][6514][400] ...
日志)。如果我们看一下持续时间,我们会看到它增加到2.9s。在此期间,ElasticSearch的JVM除了收集内存外没有做任何事情,尤其是响应来自客户端的连接,因此超时。
索引非常占用CPU(因为GC日志表明ElasticSearch中没有使用太多内存)。
您的选择是: