You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Ubuntu重启后SonarQube无法启动问题求助

SonarQube重启后无法访问localhost:9000的解决办法

问题核心

系统重启后SonarQube无法通过localhost:9000访问,错误日志显示Elasticsearch进程以退出码78终止,直接导致SonarQube启动失败。

错误日志详情:

2023.08.30 04:57:23 WARN  app[][o.s.a.p.AbstractManagedProcess] Process exited with exit value [ElasticSearch]: 78
2023.08.30 04:57:23 INFO  app[][o.s.a.SchedulerImpl] Process[ElasticSearch] is stopped
2023.08.30 04:57:23 INFO  app[][o.s.a.SchedulerImpl] SonarQube is stopped
2023.08.30 05:01:05 INFO  app[][o.s.a.AppFileSystem] Cleaning or creating temp directory /opt/sonarqube/temp
2023.08.30 05:01:05 INFO  app[][o.s.a.es.EsSettings] Elasticsearch listening on [HTTP: 127.0.0.1:9001, TCP: 127.0.0.1:35339]
2023.08.30 05:01:05 INFO  app[][o.s.a.ProcessLauncherImpl] Launch process[ELASTICSEARCH] from [/opt/sonarqube/elasticsearch]: /opt/sonarqube/elasticsearch/bin/elasticsearch
2023.08.30 05:01:06 INFO  app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
2023.08.30 05:01:28 WARN  app[][o.s.a.p.AbstractManagedProcess] Process exited with exit value [ElasticSearch]: 78
2023.08.30 05:01:28 INFO  app[][o.s.a.SchedulerImpl] Process[ElasticSearch] is stopped
2023.08.30 05:01:28 INFO  app[][o.s.a.SchedulerImpl] SonarQube is stopped
sonar@ubuntu-virtual-machine:~/bin/linux-x86-64$

解决方案

  • 修复目录权限:确保SonarQube安装目录及子目录归sonar用户所有,执行命令:

    sudo chown -R sonar:sonar /opt/sonarqube
    
  • 调整系统虚拟内存参数:Elasticsearch要求vm.max_map_count至少为262144,系统重启后该参数可能被重置:

    • 临时生效:
      sudo sysctl -w vm.max_map_count=262144
      
    • 永久生效:编辑/etc/sysctl.conf文件,添加一行vm.max_map_count=262144,然后执行:
      sudo sysctl -p
      
  • 查看详细错误日志:检查Elasticsearch专属日志获取更精准的故障原因,执行命令:

    cat /opt/sonarqube/logs/elasticsearch.log | tail -20
    

内容的提问来源于stack exchange,提问作者Olumide Akinyemi

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.12 03:08:14