1.安装mysql数据库
参考https://blog.51cto.com/11726705/2359634
2.配置数据库用户名和密码
vi /usr/local/sonarqube-6.7.4/conf/sonar.properties #sonar.jdbc.username= sonar.jdbc.username=root #sonar.jdbc.password= sonar.jdbc.password=yzyx123
3.修改数据库名称
sonar.jdbc.url=jdbc:mysql://localhost:3306/ sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformance&useSSL=false
4.修改浏览器访问后缀
# Web context. When set, it must start with forward slash (for example /sonarqube). # The default value is root context (empty value). #sonar.web.context= sonar.web.context=/sonar
5.修改浏览器访问端口
# TCP port for incoming HTTP connections. Default value is 9000. #sonar.web.port=9000 sonar.web.port=9000
6.修改浏览器访问ip
# Binding IP address. For servers with more than one IP address, this property specifies which # address will be used for listening on the specified ports. # By default, ports will be used on all IP addresses associated with the server. #sonar.web.host=0.0.0.0 sonar.web.host=0.0.0.0
7.配置启动用户
useradd sonar
8.授权sonar用户文件夹权限
chown -R sonar:sonar /usr/local/sonarqube-6.7.4/
9.启动sonar
/usr/local/sonarqube-6.7.4/bin/linux-x86-64/sonar.sh start