老师我按照你docker安装的部署一步一步执行,还是报了错误信息,如下
root@racknerd-2e0a9b:~# docker logs -f sonarqube_prod
2024.07.08 07:24:48 INFO app[o.s.a.AppFileSystem] Cleaning or creating temp directory /opt/sonarqube/temp
2024.07.08 07:24:48 INFO app[o.s.a.es.EsSettings] Elasticsearch listening on [HTTP: 127.0.0.1:9001, TCP: 127.0.0.1:43903]
2024.07.08 07:24:48 INFO app[o.s.a.ProcessLauncherImpl] Launch process[ELASTICSEARCH] from [/opt/sonarqube/elasticsearch]: /opt/java/openjdk/bin/java -Xms4m -Xmx64m -XX:+UseSerialGC -Dcli.name=server -Dcli.script=./bin/elasticsearch -Dcli.libs=lib/tools/server-cli -Des.path.home=/opt/sonarqube/elasticsearch -Des.path.conf=/opt/sonarqube/temp/conf/es -Des.distribution.type=tar -cp /opt/sonarqube/elasticsearch/lib/:/opt/sonarqube/elasticsearch/lib/cli-launcher/ org.elasticsearch.launcher.CliToolLauncher
2024.07.08 07:24:48 INFO app[o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
2024-07-08 07:25:07,503 main ERROR Unable to create file /opt/sonarqube/logs/es.log java.io.IOException: Permission denied
at java.base/java.io.UnixFileSystem.createFileExclusively(Native Method)
at java.base/java.io.File.createNewFile(Unknown Source)
at org.apache.logging.log4j.core@8.13.4/org.apache.logging.log4j.core.appender.rolling.RollingFileManager$RollingFileManagerFactory.createManager(RollingFileManager.java:735)
at org.apache.logging.log4j.core@8.13.4/org.apache.logging.log4j.core.appender.rolling.RollingFileManager$RollingFileManagerFactory.createManager(RollingFileManager.java:718)
at org.apache.logging.log4j.core@8.13.4/org.apache.logging.log4j.core.appender.AbstractManager.getManager(AbstractManager.java:144)
at org.apache.logging.log4j.core@8.13.4/org.apache.logging.log4j.core.appender.OutputStreamManager.getManager(OutputStreamManager.java:100)
at org.apache.logging.log4j.core@8.13.4/org.apache.logging.log4j.core.appender.rolling.RollingFileManager.getFileManager(RollingFileManager.java:217)
at org.apache.logging.log4j.core@8.13.4/org.apache.logging.log4j.core.appender.RollingFileAppender$Builder.build(RollingFileAppender.java:135)
at org.apache.logging.log4j.core@8.13.4/org.apache.logging.log4j.core.appender.RollingFileAppender$Builder.build(RollingFileAppender.java:62)
at org.apache.logging.log4j.core@8.13.4/org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.build(PluginBuilder.java:124)
at org.apache.logging.log4j.core@8.13.4/org.apache.logging.log4j.core.config.AbstractConfiguration.createPluginObject(AbstractConfiguration.java:1138)
at org.apache.logging.log4j.core@8.13.4/org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:1063)
at org.apache.logging.log4j.core@8.13.4/org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:1055)
at org.apache.logging.log4j.core@8.13.4/org.apache.logging.log4j.core.config.AbstractConfiguration.doConfigure(AbstractConfiguration.java:664)
at org.apache.logging.log4j.core@8.13.4/org.apache.logging.log4j.core.config.AbstractConfiguration.initialize(AbstractConfiguration.java:258)
at org.apache.logging.log4j.core@8.13.4/org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:304)
at org.apache.logging.log4j.core@8.13.4/org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:621)
at org.apache.logging.log4j.core@8.13.4/org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:285)
at org.elasticsearch.server@8.13.4/org.elasticsearch.common.logging.LogConfigurator.configure(LogConfigurator.java:250)
at org.elasticsearch.server@8.13.4/org.elasticsearch.common.logging.LogConfigurator.configure(LogConfigurator.java:129)
at org.elasticsearch.server@8.13.4/org.elasticsearch.bootstrap.Elasticsearch.initPhase1(Elasticsearch.java:134)
at org.elasticsearch.server@8.13.4/org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:69)
2024-07-08 07:25:07,525 main ERROR Could not create plugin of type class org.apache.logging.log4j.core.appender.RollingFileAppender for element RollingFile: java.lang.IllegalStateException: ManagerFactory [org.apache.logging.log4j.core.appender.rolling.RollingFileManager$RollingFileManagerFactory@350aac89] unable to create manager for [/opt/sonarqube/logs/es.log] with data [org.apache.logging.log4j.core.appender.rolling.RollingFileManager$FactoryData@1c5920df[pattern=/opt/sonarqube/logs/es.%d{yyyy-MM-dd}.log, append=true, bufferedIO=true, bufferSize=8192, policy=CompositeTriggeringPolicy(policies=[TimeBasedTriggeringPolicy(nextRolloverMillis=0, interval=1, modulate=true)]), strategy=DefaultRolloverStrategy(min=-2147483648, max=2147483647, useMax=false), advertiseURI=null, layout=%d{yyyy.MM.dd HH:mm:ss} %-5level es[%logger{1.}] %msg%n, filePermissions=null, fileOwner=null]] java.lang.IllegalStateException: ManagerFactory [org.apache.logging.log4j.core.appender.rolling.RollingFileManager$RollingFileManagerFactory@350aac89] unable to create manager for [/opt/sonarqube/logs/es.log] with data [org.apache.logging.log4j.core.appender.rolling.RollingFileManager$FactoryData@1c5920df[pattern=/opt/sonarqube/logs/es.%d{yyyy-MM-dd}.log, append=true, bufferedIO=true, bufferSize=8192, policy=CompositeTriggeringPolicy(policies=[TimeBasedTriggeringPolicy(nextRolloverMillis=0, interval=1, modulate=true)]), strategy=DefaultRolloverStrategy(min=-2147483648, max=2147483647, useMax=false), advertiseURI=null, layout=%d{yyyy.MM.dd HH:mm:ss} %-5level es[%logger{1.}] %msg%n, filePermissions=null, fileOwner=null]]
at org.apache.logging.log4j.core@8.13.4/org.apache.logging.log4j.core.appender.AbstractManager.getManager(AbstractManager.java:146)
at org.apache.logging.log4j.core@8.13.4/org.apache.logging.log4j.core.appender.OutputStreamManager.getManager(OutputStreamManager.java:100)
at org.apache.logging.log4j.core@8.13.4/org.apache.logging.log4j.core.appender.rolling.RollingFileManager.getFileManager(RollingFileManager.java:217)
at org.apache.logging.log4j.core@8.13.4/org.apache.logging.log4j.core.appender.RollingFileAppender$Builder.build(RollingFileAppender.java:135)
at org.apache.logging.log4j.core@8.13.4/org.apache.logging.log4j.core.appender.RollingFileAppender$Builder.build(RollingFileAppender.java:62)
at org.apache.logging.log4j.core@8.13.4/org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.build(PluginBuilder.java:124)
at org.apache.logging.log4j.core@8.13.4/org.apache.logging.log4j.core.config.AbstractConfiguration.createPluginObject(AbstractConfiguration.java:1138)
at org.apache.logging.log4j.core@8.13.4/org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:1063)
at org.apache.logging.log4j.core@8.13.4/org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:1055)
at org.apache.logging.log4j.core@8.13.4/org.apache.logging.log4j.core.config.AbstractConfiguration.doConfigure(AbstractConfiguration.java:664)
at org.apache.logging.log4j.core@8.13.4/org.apache.logging.log4j.core.config.AbstractConfiguration.initialize(AbstractConfiguration.java:258)
at org.apache.logging.log4j.core@8.13.4/org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:304)
at org.apache.logging.log4j.core@8.13.4/org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:621)
at org.apache.logging.log4j.core@8.13.4/org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:285)
at org.elasticsearch.server@8.13.4/org.elasticsearch.common.logging.LogConfigurator.configure(LogConfigurator.java:250)
at org.elasticsearch.server@8.13.4/org.elasticsearch.common.logging.LogConfigurator.configure(LogConfigurator.java:129)
at org.elasticsearch.server@8.13.4/org.elasticsearch.bootstrap.Elasticsearch.initPhase1(Elasticsearch.java:134)
at org.elasticsearch.server@8.13.4/org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:69)
2024-07-08 07:25:07,530 main ERROR Unable to invoke factory method in class org.apache.logging.log4j.core.appender.RollingFileAppender for element RollingFile: java.lang.IllegalStateException: No factory method found for class org.apache.logging.log4j.core.appender.RollingFileAppender java.lang.IllegalStateException: No factory method found for class org.apache.logging.log4j.core.appender.RollingFileAppender
at org.apache.logging.log4j.core@8.13.4/org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.findFactoryMethod(PluginBuilder.java:260)
at org.apache.logging.log4j.core@8.13.4/org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.build(PluginBuilder.java:136)
at org.apache.logging.log4j.core@8.13.4/org.apache.logging.log4j.core.config.AbstractConfiguration.createPluginObject(AbstractConfiguration.java:1138)
at org.apache.logging.log4j.core@8.13.4/org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:1063)
at org.apache.logging.log4j.core@8.13.4/org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:1055)
at org.apache.logging.log4j.core@8.13.4/org.apache.logging.log4j.core.config.AbstractConfiguration.doConfigure(AbstractConfiguration.java:664)
at org.apache.logging.log4j.core@8.13.4/org.apache.logging.log4j.core.config.AbstractConfiguration.initialize(AbstractConfiguration.java:258)
at org.apache.logging.log4j.core@8.13.4/org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:304)
at org.apache.logging.log4j.core@8.13.4/org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:621)
at org.apache.logging.log4j.core@8.13.4/org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:285)
at org.elasticsearch.server@8.13.4/org.elasticsearch.common.logging.LogConfigurator.configure(LogConfigurator.java:250)
at org.elasticsearch.server@8.13.4/org.elasticsearch.common.logging.LogConfigurator.configure(LogConfigurator.java:129)
at org.elasticsearch.server@8.13.4/org.elasticsearch.bootstrap.Elasticsearch.initPhase1(Elasticsearch.java:134)
at org.elasticsearch.server@8.13.4/org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:69)
2024-07-08 07:25:07,534 main ERROR Null object returned for RollingFile in Appenders.
2024-07-08 07:25:07,535 main ERROR Unable to locate appender “file_es” for logger config “root”
2024.07.08 07:25:08 INFO es[o.e.n.NativeAccess] Using [jna] native provider and native methods for [Linux]
2024.07.08 07:25:09 ERROR es[o.e.b.Elasticsearch] fatal exception while booting Elasticsearch
java.lang.IllegalStateException: Unable to access ‘path.data’ (/opt/sonarqube/data/es8)
at org.elasticsearch.bootstrap.FilePermissionUtils.addDirectoryPath(FilePermissionUtils.java:66) ~[elasticsearch-8.13.4.jar:?]
at org.elasticsearch.bootstrap.Security.addFilePermissions(Security.java:236) ~[elasticsearch-8.13.4.jar:?]
at org.elasticsearch.bootstrap.Security.createPermissions(Security.java:178) ~[elasticsearch-8.13.4.jar:?]
at org.elasticsearch.bootstrap.Security.configure(Security.java:125) ~[elasticsearch-8.13.4.jar:?]
at org.elasticsearch.bootstrap.Elasticsearch.initPhase2(Elasticsearch.java:199) ~[elasticsearch-8.13.4.jar:?]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:73) ~[elasticsearch-8.13.4.jar:?]
Caused by: java.nio.file.AccessDeniedException: /opt/sonarqube/data/es8
at sun.nio.fs.UnixException.translateToIOException(Unknown Source) ~[?:?]
at sun.nio.fs.UnixException.rethrowAsIOException(Unknown Source) ~[?:?]
at sun.nio.fs.UnixException.rethrowAsIOException(Unknown Source) ~[?:?]
at sun.nio.fs.UnixFileSystemProvider.createDirectory(Unknown Source) ~[?:?]
at java.nio.file.Files.createDirectory(Unknown Source) ~[?:?]
at java.nio.file.Files.createAndCheckIsDirectory(Unknown Source) ~[?:?]
at java.nio.file.Files.createDirectories(Unknown Source) ~[?:?]
at org.elasticsearch.bootstrap.Security.ensureDirectoryExists(Security.java:330) ~[elasticsearch-8.13.4.jar:?]
at org.elasticsearch.bootstrap.FilePermissionUtils.addDirectoryPath(FilePermissionUtils.java:64) ~[elasticsearch-8.13.4.jar:?]
… 5 more
ERROR: Elasticsearch did not exit normally - check the logs at /opt/sonarqube/logs/sonarqube.log
ERROR: Elasticsearch died while starting up, with exit code 1
2024.07.08 07:25:10 WARN app[o.s.a.p.AbstractManagedProcess] Process exited with exit value [ElasticSearch]: 1
2024.07.08 07:25:10 INFO app[o.s.a.SchedulerImpl] Process[ElasticSearch] is stopped
2024.07.08 07:25:10 INFO app[o.s.a.SchedulerImpl] SonarQube is stopped
还请老师看下是什么原因,多谢老师了