SonarQube 6.7.1在CentOS 7.3服务器无法启动,请求排查故障原因
Troubleshooting SonarQube 6.7.1 Startup Failure on CentOS 7.3
Hey there, let's dig into why your SonarQube instance won't start up! Since you mentioned you have Elasticsearch and SonarQube logs but haven't shared the actual content yet, I'll walk you through the most common troubleshooting steps tailored to your setup, plus what to look for once you provide those logs.
1. Verify User Permissions & System Basics
- SonarQube cannot run as the root user—this is a hard requirement. Make sure you're using a dedicated non-root user (like
sonarqube) to manage the service. Check which user is attempting to run it with:ps aux | grep sonar - Ensure the SonarQube user has full read/write access to the installation directory and its subfolders (especially
data,logs, andtemp):chown -R sonarqube:sonarqube /path/to/your/sonarqube
2. Elasticsearch-Specific Checks (Critical for SonarQube 6.7.x)
SonarQube 6.7.1 uses an embedded Elasticsearch instance, so these settings often cause startup failures:
- File Descriptors Limit: Elasticsearch needs at least 65535 open file descriptors. Check the current limit for your SonarQube user:
If it's lower, updatesu - sonarqube -c "ulimit -n"/etc/security/limits.confwith these lines:sonarqube soft nofile 65535 sonarqube hard nofile 65535 - Virtual Memory Limit: Elasticsearch requires
vm.max_map_countto be set to at least 262144. Check and adjust this:
To make this change permanent, addsysctl vm.max_map_count sysctl -w vm.max_map_count=262144vm.max_map_count=262144to/etc/sysctl.conf. - When you share your Elasticsearch logs, look for lines starting with
ERROR—common issues here include port conflicts (SonarQube's Elasticsearch uses port 9001 by default), insufficient heap memory, or corrupted data in thedata/essubfolder.
3. SonarQube Configuration & Log Checks
- Open
$SONARQUBE_HOME/conf/sonar.propertiesand verify:- Database connection details are correct (if using an external DB like PostgreSQL/MySQL—note that SonarQube 6.7.1 does not support MySQL 8+, so stick to MySQL 5.7 or lower).
- The default HTTP port (
sonar.web.port=9000) isn't being used by another service. Check with:netstat -tulpn | grep 9000
- Scan SonarQube's core logs (usually in
$SONARQUBE_HOME/logs/sonar.logorweb.log) forERRORorWARNentries—these often point to missing dependencies, failed database connections, or invalid configuration values.
4. Service & System Log Validation
- Check the SonarQube service status directly:
systemctl status sonarqube - Also, pull real-time system logs related to the SonarQube service to catch transient issues:
journalctl -u sonarqube -f
Once you share the actual content of your Elasticsearch and SonarQube logs, we can zero in on the exact cause of the startup failure!
内容的提问来源于stack exchange,提问作者fashuser
相关产品推荐
相关产品推荐

