centos 6.5 安裝和配置 SonarQube
1、下載安裝包:
http://www.sonarqube.org/downloads/
2、上傳伺服器並解壓:
unzip sonarqube-5.6.zip -d /dir
3、安裝MySQL並進入mysql
3.1 mysql -u root -p3.2 建立資料庫和帳號:
mysql> CREATE DATABASE sonar CHARACTER SET utf8 COLLATE utf8_general_ci; mysql> CREATE USER 'sonar' IDENTIFIED BY 'sonar';mysql> GRANT ALL ON sonar.* TO 'sonar'@'%' IDENTIFIED BY 'sonar';mysql> GRANT ALL ON sonar.* TO 'sonar'@'localhost' IDENTIFIED BY 'sonar';mysql> FLUSH PRIVILEGES;
4配置 sonar參數 ,串連mysql vi /conf/sonar.properties檔案
去掉注釋並增加:
sonar.jdbc.url=jdbc:mysql://192.168.16.219:3306/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformancesonar.jdbc.username=rootsonar.jdbc.password=rootsonar.sorceEncoding=UTF-8sonar.login=adminsonar.password=admin
5、啟動服務 目錄切換至sonar的
/bin/linux-x86-64/目錄,啟動服務
#./sonar.sh start 啟動服務#./sonar.sh stop 停止服務#./sonar.sh restart 重啟服務
訪問http:\ip:9000即可
tips: 有的時候留意: iptables 是否阻止, 可以先service iptables stop 確認 是否影響