SonarQube启动报错
可以查看日志,一般日志会记录错误的详细内容
执行以下命令,查看日志:
cd /opt/sonarqube-6.7.6/logs
tail -n 100 sonar.log
定位到问题的详细信息:
WrapperSimpleApp: Encountered an error running main: java.nio.file.AccessDeniedException: /opt/sonarqube-6.7.6/temp/conf/es/elasticsearch.ymljava.nio.file.AccessDeniedException: /opt/sonarqube-6.7.6/temp/conf/es/elasticsearch.ymlat 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:186)at org.sonar.process.FileUtils2$DeleteRecursivelyFileVisitor.visitFile(FileUtils2.java:181)at java.nio.file.Files.walkFileTree(Files.java:2670)at java.nio.file.Files.walkFileTree(Files.java:2742)at org.sonar.process.FileUtils2.deleteDirectoryImpl(FileUtils2.java:143)at org.sonar.process.FileUtils2.deleteDirectory(FileUtils2.java:112)at org.sonar.application.AppFileSystem$CleanTempDirFileVisitor.visitFile(AppFileSystem.java:117)at org.sonar.application.AppFileSystem$CleanTempDirFileVisitor.visitFile(AppFileSystem.java:101)at java.nio.file.Files.walkFileTree(Files.java:2670)at org.sonar.application.AppFileSystem.createOrCleanTempDirectory(AppFileSystem.java:96)at org.sonar.application.AppFileSystem.reset(AppFileSystem.java:62)at org.sonar.application.App.start(App.java:55)at org.sonar.application.App.main(App.java:78)at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)at java.lang.reflect.Method.invoke(Method.java:498)at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240)at java.lang.Thread.run(Thread.java:748)<-- Wrapper Stopped--> Wrapper Started as DaemonLaunching a JVM...Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.orgCopyright 1999-2006 Tanuki Software, Inc. All Rights Reserved.
解决方法:
删除sonarqube temp目录下的所有文件即可
rm -f /opt/sonarqube-6.7.6/temp
命令解释
-f 删除当前目录下的所有类型的文件