无法在MacOSx中启动SonarCube服务器

时间:2018-07-01 13:33:10

标签: java sonarqube

运行最新版本的sonarcube 7.1.2并收到以下错误。

执行的命令:sudo ./sonar.sh

Wrapper Started as Console
Launching a JVM...
Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
Copyright 1999-2006 Tanuki Software, Inc.  All Rights Reserved.

2018.07.01 18:36:05 INFO  app[][o.s.a.AppFileSystem] Cleaning or 
creating temp directory /Users/aneeshgoel/Downloads/sonarqube-7.2.1/temp

2018.07.01 18:36:05 INFO  app[][o.s.a.es.EsSettings] Elasticsearch 
listening on /127.0.0.1:9001
2018.07.01 18:36:05 INFO  app[][o.s.a.p.ProcessLauncherImpl] Launch 
process[[key='es', ipcIndex=1, logFilenamePrefix=es]] from 
[/Users/aneeshgoel/Downloads/sonarqube-7.2.1/elasticsearch]: 
/Users/aneeshgoel/Downloads/sonarqube- 
7.2.1/elasticsearch/bin/elasticsearch - 
Epath.conf=/Users/aneeshgoel/Downloads/sonarqube-7.2.1/temp/conf/es

2018.07.01 18:36:05 INFO  app[][o.s.a.SchedulerImpl] Waiting for 
Elasticsearch to be up and running

2018.07.01 18:36:10 INFO  app[][o.e.p.PluginsService] no modules loaded
2018.07.01 18:36:10 INFO  app[][o.e.p.PluginsService] loaded plugin 
[org.elasticsearch.transport.Netty4Plugin]

2018.07.01 18:36:16 WARN  app[][o.s.a.p.AbstractProcessMonitor] Process 
exited with exit value [es]: 1

2018.07.01 18:36:16 INFO  app[][o.s.a.SchedulerImpl] Process [es] is 
stopped
2018.07.01 18:36:16 INFO  app[][o.s.a.SchedulerImpl] SonarQube is 
stopped
<-- Wrapper Stopped

然后我尝试使用非sudo用户。 命令./sonar.sh

得到的错误是:

--> Wrapper Started as Console
Launching a JVM...
Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
  Copyright 1999-2006 Tanuki Software, Inc.  All Rights Reserved.

2018.07.01 18:18:16 INFO  app[][o.s.a.AppFileSystem] Cleaning or creating temp directory /Users/aneeshgoel/Downloads/sonarqube-7.2.1/temp

WrapperSimpleApp: Encountered an error running main: java.nio.file.AccessDeniedException: /Users/aneeshgoel/Downloads/sonarqube-7.2.1/temp/conf/es/elasticsearch.yml
java.nio.file.AccessDeniedException: /Users/aneeshgoel/Downloads/sonarqube-7.2.1/temp/conf/es/elasticsearch.yml
at sun.nio.fs.UnixException.translateToIOException(UnixException.java:84)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
at sun.nio.fs.UnixFileSystemProvider.implDelete(UnixFileSystemProvider.java:244)
at sun.nio.fs.AbstractFileSystemProvider.delete(AbstractFileSystemProvider.java:103)
at java.nio.file.Files.delete(Files.java:1126)
at org.sonar.process.FileUtils2$DeleteRecursivelyFileVisitor.visitFile(FileUtils2.java:170)

我尝试过也给目录写权限,但是还是没有运气。请有人帮忙调试问题。

1 个答案:

答案 0 :(得分:1)

不幸的是,SonarQube安装指南没有说明有关为分析服务器配置用户的内容。安装它的人以后可能会忘记它,而使SonarQube拥有root权限运行一段时间。

它非常简单直接。准备声纳系统用户并更改安装目录权限:

您必须在sonar用户的上下文中运行声纳。若要创建一个名为sonar的用户,请按照下列步骤操作:

  

groupadd声纳用户add -c“声纳系统用户” -d / opt / sonarqube -g   声纳-s / bin / bash声纳chown -R声纳:声纳/ opt / sonarqube

然后编辑此处显示的文件:

  

/opt/sonarqube/bin/sonar.sh

找到显示为 RUN_AS_USER = sonar 的行,该行将被注释,然后更改为声纳并尝试立即运行该应用程序。