Linux安裝SonarQube 7.4

一、環境說明

OS:CentOS 7.4
IP:172.16.38.31
mysql:5.7
JDK:1.8
sonarqube:7.4

二、安裝JDK

linux下安裝jdk

三、安裝配置Mysql

1.Linux安裝mysql

2.配置mysql,創建SonarQube連接Mysql的庫和用戶

mysql -uroot -p
CREATE DATABASE sonar CHARACTER SET utf8 COLLATE utf8_general_ci;
grant all privileges on sonar.* to "sonar"@"%" identified by "Sonar!23";
flush privileges;

四、配置elasticsearch需要的環境

因爲SonarQube服務裏面包含有elasticsearch服務,所以需要調整內核

Linux修改文件句柄數及vm.max_map_count的大小

五、安裝SonarQube7.4

百度網盤地址:

鏈接:https://pan.baidu.com/s/1dp8cIi5-61fLh2XwKavNvg 
提取碼:cnjs

1.創建用戶、解壓、創建目錄

useradd sonar
echo "sonar:123456" |chpasswd

wget https://binaries.sonarsource.com/CommercialDistribution/sonarqube-developer/sonarqube-developer-7.4.zip
unzip sonarqube-7.4.zip
mv sonarqube-7.4 /usr/local/
chown sonar:sonar -R /usr/local/sonarqube-7.4/

mkdir -p /data/soarqube/{data,temp}
chown sonar:sonar -R /data/soarqube/

2.修改配置文件sonar.properties

sonar.jdbc.username=sonar
sonar.jdbc.password=Sonar!23
sonar.jdbc.url=jdbc:mysql://172.16.38.31:3306/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformance&useSSL=false
sonar.web.javaOpts=-server
sonar.path.data=/data/soarqube/data
sonar.path.temp=/data/soarqube/temp

參數說明

3.啓動SonarQube

su sonar
cd /usr/local/sonarqube-7.4/bin/linux-x86-64
./sonar.sh start
tailf /usr/local/sonarqube-7.4/logs/sonar.log		#查看日誌

如圖則表示啓動成功!
在這裏插入圖片描述

4.WEB訪問

http://172.16.38.31:9000
用戶名/密碼:admin/admin

在這裏插入圖片描述
在這裏插入圖片描述
在這裏插入圖片描述

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章