Linux 安裝sonarqube
- 配置jdk關(guān)鍵
- 下載sonar
cd /usr/local/src
wget https://binaries.sonarsource.com/Distribution/sonarqube/sonarqube-7.6.zip
unzip sonarqube-7.6.zip
mv sonarqube-7.6 /usr/local/
ln -s /usr/local/sonarqube-7.6/ /usr/local/sonarqube
- 安裝數(shù)據(jù)庫
如果沒有數(shù)據(jù)庫請執(zhí)行yum install -y mariadb mariadb-server
[root@linux-node1 ~]# systemctl start mariadb
[root@linux-node1 ~]# systemctl enable mariadb
Created symlink from /etc/systemd/system/multi-user.target.wants/mariadb.service to /usr/lib/systemd/system/mariadb.service.
[root@linux-node1 ~]# mysql_secure_installation
[root@linux-node1 ~]# mysql -uroot -p123456
- 配置數(shù)據(jù)庫信息
mysql> CREATE DATABASE sonar CHARACTER SET utf8 COLLATE utf8_general_ci;
mysql> GRANT ALL ON sonar.* TO 'sonar'@'localhost' IDENTIFIED BY 'sonar@pw';
mysql> GRANT ALL ON sonar.* TO 'sonar'@'%' IDENTIFIED BY 'sonar@pw';
mysql> FLUSH PRIVILEGES;
- 修改sonar配置信息
配置數(shù)據(jù)庫信息(注意sonar鏈接數(shù)據(jù)的的數(shù)據(jù)庫mysql的版本>=5.6)
sonar.jdbc.username=root
sonar.jdbc.password=zyzh2018
sonar.jdbc.url=jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true
配置sonar服務(wù)信息
sonar.web.host=0.0.0.0
sonar.web.port=9000
- 修改當(dāng)前的文件的權(quán)限分配給新建的用戶
sonar的啟動需要的是普通的用戶角色,如果使用root啟動的時候性雄,會提示錯誤
adduser sonarUser
passwd sonarUser
chown -R sonarUser:sonarUser sonarqube
切換到新建的用戶角色sonarUser中狂鞋,啟動sonar
su sonarUser
chmod -R 777 /data/conf/sonar
/data/conf/sonar/bin/linux-x86-64/sonar.sh start
- 中文插件安裝
登錄哟冬,默認(rèn)的登錄賬號信息是admin献烦,admin
從配置中找應(yīng)用市場蚕冬,從應(yīng)用市場中搜索chinese即可橘洞,安裝完插件以后需要重啟服務(wù)