安装SonarQuber6.5
2017-10-10 本文已影响0人
一课一练
- 下载SonarQuber zip包并解压至目录
wget https://sonarsource.bintray.com/Distribution/sonarqube/sonarqube-6.5.zip
unzip sonarqube-6.5.zip
- 在MySql中创建Schema
mysql> CREATE DATABASE sonar CHARACTER SET utf8 COLLATE utf8_general_ci;
Query OK, 1 row affected (0.00 sec)
mysql> CREATE USER 'sonar' IDENTIFIED BY 'sonar';
Query OK, 0 rows affected (0.00 sec)
mysql> GRANT ALL ON sonar.* TO 'sonar'@'%' IDENTIFIED BY 'sonar';
Query OK, 0 rows affected (0.00 sec)
mysql> GRANT ALL ON sonar.* TO 'sonar'@'localhost' IDENTIFIED BY 'sonar';
Query OK, 0 rows affected (0.00 sec)
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)
mysql> exit;
设置max_allowed_packet的值,以防无法上传Report
vim /etc/my.cnf
// 在[mysqld]一节下加入
max_allowed_packet=64M
- 设置properties
编辑<SONAR_HOME>/conf/sonar.properties
sonar.jdbc.username=sonar
sonar.jdbc.password=sonar
...
sonar.jdbc.url=jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformance&useSSL=false
- 防火墙开端口
firewall-cmd --permanent --zone=public --add-port=9000/tcp
firewall-cmd --reload