SonarQube 无法在 Linux (localhost) 中启动
Posted
技术标签:
【中文标题】SonarQube 无法在 Linux (localhost) 中启动【英文标题】:SonarQube does not start in Linux (localhost) 【发布时间】:2019-08-27 16:47:06 【问题描述】:我正在尝试安装和配置 sonarqube 以在我的机器(Ubuntu 18.04.2 LTS)中的小型 Poroyect 中使用它,你已经从官方网站下载了 zip Sonarqube 7.7 社区版并在 /opt/ 中解压缩。我尝试按照声纳指南中所说的那样做,并在路径/opt/sonarqube/bin/linux-x86-64
中执行./sonar.sh console
,但我遇到了日志权限问题。
Running SonarQube...
wrapper | ERROR: Could not write pid file /opt/sonarqube/bin/linux-x86-64/./SonarQube.pid: Permission denied
Unable to open logfile ../../logs/sonar.log: Permission denied
所以我尝试和超级用户一样,我得到了
Running SonarQube...
wrapper | --> Wrapper Started as Console
wrapper | Launching a JVM...
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 | 2019.04.05 19:55:48 INFO app[][o.s.a.AppFileSystem] Cleaning or creating temp directory /opt/sonarqube/temp
jvm 1 | 2019.04.05 19:55:48 INFO app[][o.s.a.es.EsSettings] Elasticsearch listening on /127.0.0.1:9001
jvm 1 | 2019.04.05 19:55:48 INFO app[][o.s.a.p.ProcessLauncherImpl] Launch process[[key='es', ipcIndex=1, logFilenamePrefix=es]] from [/opt/sonarqube/elasticsearch]: /opt/sonarqube/elasticsearch/bin/elasticsearch
jvm 1 | 2019.04.05 19:55:48 INFO app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
jvm 1 | 2019.04.05 19:55:48 INFO app[][o.e.p.PluginsService] no modules loaded
jvm 1 | 2019.04.05 19:55:48 INFO app[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
jvm 1 | OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
jvm 1 | 2019.04.05 19:55:51 WARN app[][o.s.a.p.AbstractProcessMonitor] Process exited with exit value [es]: 1
jvm 1 | 2019.04.05 19:55:51 INFO app[][o.s.a.SchedulerImpl] Process [es] is stopped
jvm 1 | 2019.04.05 19:55:51 INFO app[][o.s.a.SchedulerImpl] SonarQube is stopped
jvm 1 | 2019.04.05 19:55:51 INFO app[][o.e.c.t.TransportClientNodesService] failed to get node info for #transport#-1pr4ED0vsRgCYZjgn1jbLlQ127.0.0.1127.0.0.1:9001, disconnecting...
jvm 1 | java.lang.IllegalStateException: Future got interrupted
jvm 1 | at org.elasticsearch.common.util.concurrent.FutureUtils.get(FutureUtils.java:60)
jvm 1 | at org.elasticsearch.action.support.AdapterActionFuture.actionGet(AdapterActionFuture.java:34)
jvm 1 | at org.elasticsearch.transport.ConnectionManager.internalOpenConnection(ConnectionManager.java:226)
jvm 1 | at org.elasticsearch.transport.ConnectionManager.openConnection(ConnectionManager.java:85)
jvm 1 | at org.elasticsearch.transport.TransportService.openConnection(TransportService.java:367)
jvm 1 | at org.elasticsearch.client.transport.TransportClientNodesService$SimpleNodeSampler.doSample(TransportClientNodesService.java:410)
jvm 1 | at org.elasticsearch.client.transport.TransportClientNodesService$NodeSampler.sample(TransportClientNodesService.java:361)
jvm 1 | at org.elasticsearch.client.transport.TransportClientNodesService.addTransportAddresses(TransportClientNodesService.java:202)
jvm 1 | at org.elasticsearch.client.transport.TransportClient.addTransportAddress(TransportClient.java:342)
jvm 1 | at org.sonar.application.es.EsConnectorImpl$MinimalTransportClient.<init>(EsConnectorImpl.java:108)
jvm 1 | at org.sonar.application.es.EsConnectorImpl.buildTransportClient(EsConnectorImpl.java:89)
jvm 1 | at org.sonar.application.es.EsConnectorImpl.getTransportClient(EsConnectorImpl.java:74)
jvm 1 | at org.sonar.application.es.EsConnectorImpl.getClusterHealthStatus(EsConnectorImpl.java:61)
jvm 1 | at org.sonar.application.process.EsProcessMonitor.checkStatus(EsProcessMonitor.java:90)
jvm 1 | at org.sonar.application.process.EsProcessMonitor.checkOperational(EsProcessMonitor.java:75)
jvm 1 | at org.sonar.application.process.EsProcessMonitor.isOperational(EsProcessMonitor.java:60)
jvm 1 | at org.sonar.application.process.SQProcess.refreshState(SQProcess.java:161)
jvm 1 | at org.sonar.application.process.SQProcess$EventWatcher.run(SQProcess.java:220)
jvm 1 | Caused by: java.lang.InterruptedException: null
jvm 1 | at java.base/java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1038)
jvm 1 | at java.base/java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1343)
jvm 1 | at org.elasticsearch.common.util.concurrent.BaseFuture$Sync.get(BaseFuture.java:251)
jvm 1 | at org.elasticsearch.common.util.concurrent.BaseFuture.get(BaseFuture.java:94)
jvm 1 | at org.elasticsearch.common.util.concurrent.FutureUtils.get(FutureUtils.java:57)
jvm 1 | ... 17 common frames omitted
wrapper | <-- Wrapper Stopped
我不明白我收到的错误以及为什么它不启动 sonarqube。
【问题讨论】:
不要尝试使用超级用户。只需更改您使用的用户对完整 SonarQube 文件夹的访问权限。 谢谢,这是我尝试的下一件事,它奏效了。 【参考方案1】:不要尝试使用超级用户。只需更改您使用的用户对完整 SonarQube 文件夹的访问权限。
【讨论】:
这对我来说就像魔术一样。谢谢你。 sudo chown -R $USER:$USER /opt/sonarqube以上是关于SonarQube 无法在 Linux (localhost) 中启动的主要内容,如果未能解决你的问题,请参考以下文章
在 linux 机器中设置时的 Sonarqube-4.0 问题 (linux-x86-32)