SonarQube 7.1 - Debian 安裝 - 連線被拒絕

SonarQube 7.1 - Debian 安裝 - 連線被拒絕

我在首次運行 SonarQube 7.1 時遇到問題。我的日誌中仍然有錯誤,如下所示:

./sonar.sh console

org.elasticsearch.transport.ConnectTransportException: [][127.0.0.1:9001] connect_timeout[30s]
    at org.elasticsearch.transport.netty4.Netty4Transport.connectToChannels(Netty4Transport.java:362)
    at org.elasticsearch.transport.TcpTransport.openConnection(TcpTransport.java:570)
    at org.elasticsearch.transport.TcpTransport.openConnection(TcpTransport.java:117)
    at org.elasticsearch.transport.TransportService.openConnection(TransportService.java:351)
    at org.elasticsearch.client.transport.TransportClientNodesService$SimpleNodeSampler.doSample(TransportClientNodesService.java:407)
    at org.elasticsearch.client.transport.TransportClientNodesService$NodeSampler.sample(TransportClientNodesService.java:357)
    at org.elasticsearch.client.transport.TransportClientNodesService$ScheduledNodeSampler.run(TransportClientNodesService.java:390)
    at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:569)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
Caused by: io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: /127.0.0.1:9001
    at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
    at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717)
    at io.netty.channel.socket.nio.NioSocketChannel.doFinishConnect(NioSocketChannel.java:352)
    at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.finishConnect(AbstractNioChannel.java:340)
    at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:632)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:579)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:496)
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:458)
    at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858)
    ... 1 common frames omitted
Caused by: java.net.ConnectException: Connection refused
    ... 10 common frames omitted

我正在嘗試在 Ubuntu 19.10 和 Debian 10 上運行它。因為我必須弄清楚如何將其升級到最新版本,所以我正在創建測試環境來執行此操作。很久以前,有人確實創建了當前的產品,從那時起就沒有人碰過它:)

到目前為止已經做了什麼: - 我已經停止並禁用了 ufw 和 iptables - Java 版本幾乎與生產版本相同。

sonarqube@sonarqube-srv:/$ java -version
java version "1.8.0_231"
Java(TM) SE Runtime Environment (build 1.8.0_231-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.231-b11, mixed mode)
sonar configuration looks like this:
sonarqube@sonarqube-srv:/$ grep "^[^#;]" /opt/sonarqube-7.1/conf/sonar.properties 
sonar.web.javaOpts=-Xmx2048m -Xms128m -XX:+HeapDumpOnOutOfMemoryError
sonar.web.host=127.0.0.1
sonar.web.context=/sonarqube
sonar.web.port=9000
sonar.ce.javaOpts=-Xmx512m -Xms128m -XX:+HeapDumpOnOutOfMemoryError
sonar.search.javaOpts=-Xms512m -Xmx2048m -XX:+HeapDumpOnOutOfMemoryError
sonar.search.port=9001
sonar.search.host=127.0.0.1
sonar.log.level=DEBUG
sonar.log.level.app=DEBUG
sonar.log.level.web=DEBUG
sonar.log.level.ce=DEBUG
sonar.log.level.es=DEBUG
sonar.log.rollingPolicy=time:yyyy-MM-dd
sonar.log.maxFiles=7
sonar.web.accessLogs.enable=true
sonar.telemetry.enable=false

當我運行 ./sonar.sh start 而不是 ./sonar.sh console 時,我收到以下錯誤:

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007fe83110eb21, pid=5723, tid=0x00007fe848814700
#
# JRE version: Java(TM) SE Runtime Environment (8.0_231-b11) (build 1.8.0_231-b11)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.231-b11 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# J 21 C1 java.lang.String.getChars(II[CI)V (62 bytes) @ 0x00007fe83110eb21 [0x00007fe83110eb00+0x21]
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /opt/sonarqube-7.1/elasticsearch/hs_err_pid5723.log

答案1

我以前遇到過這個錯誤,為我解決的是:

  1. 確保運行聲納的用戶有權存取聲納的根資料夾。你可以透過運行來做到這一點sudo chown -R <sonar-user>:<sonar-user-group> <sonar installation dir>
  2. 如果不需要,請刪除(或重新命名)Sonar 安裝目錄中的暫存資料夾和日誌資料夾。

相關內容