sonarqube6.7安装
1.下载sonar
https://www.sonarqube.org/#downloads
2.配置JDK1.8
3.centOS默认mysql版本为mariaDB
直接安装yum install mysql,据说可以替换mariaDB的版本
sonar自带数据库,但是会被提示
Embedded database should be used for evaluation purpose only
The embedded database will not scale, it will not support upgrading to newer versions of SonarQube, and there is no support for migrating your data out of it into a different database engine.
所以还是使用mysql比较好
这里要注意的是sonar不支持mysql5.5及以下版本
3.1升级mysql,使用rpm方式
删除原有的mariaDB
yum remove mysql mysql-*
查看已安装的软件:rpm -qa¦grep mysql
rpm方式
找到当前最新版本https://dev.mysql.com/downloads/mysql/
下载mysql
wget http://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.18-1.el7.x86_64.rpm-bundle.tar
解压
tar -xvf mysql-5.7.18-1.el7.x86_64.rpm-bundle.tar
依次执行(几个包有依赖关系,所以执行有先后)下面命令安装
[root@centos-linux ~]# rpm -ivh mysql-community-common-5.7.18-1.el7.x86_64.rpm
[root@centos-linux ~]# rpm -ivh mysql-community-libs-5.7.18-1.el7.x86_64.rpm
[root@centos-linux ~]# rpm -ivh mysql-community-client-5.7.18-1.el7.x86_64.rpm
[root@centos-linux ~]# rpm -ivh mysql-community-server-5.7.18-1.el7.x86_64.rpm
3.2升级mysql,使用yum方式
安装mysql的源
yum install http://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm
Yum install -y mysql-community-server
systemctl start mysqld.service
4.mysql 修改root账户密码
mysql5.6以后的版本安全机制增强了,临时密码只允许登录,不允许操作数据库,所以必须更改。
4.1先停止mysql服务
service mysqld stop
4.2先修改配置文件
vi /etc/my.cnf
# Disabling symbolic-links is recommended to prevent assorted security risks
skip-grant-tables #添加这句话,这时候登入mysql就不需要密码
symbolic-links=0
4.3.空密码登录mysql:
mysql -u root -p #输入命令回车进入,出现输入密码提示直接回车
4.4.设置mysql密码:
mysql> set password for root@localhost = password('123456');
ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement
mysql> flush privileges; #更新权限
Query OK, 0 rows affected (0.00 sec)
mysql> set password for root@localhost = password('123456'); or update user set authentication_string=PASSWORD("123456") where user="root";
Query OK, 0 rows affected, 1 warning (0.00 sec)
mysql>flush privileges; #更新权限
mysql>quit; #退出
4.5 停止mysql服务, 恢复mysql配置
service mysqld stop
4.6 vim /etc/my.cnf #修改配置文件
# Disabling symbolic-links is recommended to prevent assorted security risks
# skip-grant-tables # 注释掉这句话
symbolic-links=0
4.7启动mysql服务
service mysqld start
4.8 输入新密码登录
mysql -uroot -p
4.9.设置mysql开机自启:
systemctl enable mysqld
5.mysql 添加sonar用户
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;
这里有个问题,新密码设置的时候如果设置的过于简单会报错:所以sonar这个密码应该是用不了了。根据需要自己修改吧
运行后提示Table ‘performance_schema.session_variables’ doesn’t exist
解决的方法是:mysql_upgrade -u root -p --force
6.解压sonar,这里用6.7版本
7.修改配置文件
vi /usr/local/sonarqube/conf/sonar.properties
取消如下选项的#注释并修改内容
sonar.jdbc.url=jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformance
sonar.jdbc.username=sonar
sonar.jdbc.password=sonar
sonar.web.host=0.0.0.0
sonar.web.context=
sonar.web.port=9000
3.运行sonarqube目录下的./bin/linux-x86-64/sonar.sh start
sonar6.7版本已经不允许root用户直接登录了,所以登陆前要切换到其他linux用户
切换的用户要注意是否拥有该目录的权限
8.观察启动日志
tail -200f ./logs/sonar.log
9.打开防火墙的9000端口
firewall-cmd --permanent --add-port=9000/tcp
firewall-cmd --reload
10.访问sonar
http://localhost:9000/
可以看到页面了
11.登录
默认用户名admin,密码admin
12.安装中文补丁包
https://github.com/SonarQubeCommunity/sonar-l10n-zh
12.1下载sonar-l10n-zh-plugin-1.19.jar
12.2.将jar文件复制到Sonarqube主目录extensions/plugins文件夹内
12.3.重启Sonarqube服务
13.安装SonarQube Scanner
13.1.下载SonarQube Scanner
https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner
13.2.解压
unzip sonar-scanner-cli-3.0.3.778-linux.zip
13.3.修改配置文件
修改conf/sonar-scanner.properties
如果没有和sonarqube安装在同一台服务器上,就需要修改,否则默认就可以了
sonar.host.url=http://localhost:9000
sonarqube6.7安装的更多相关文章
- centos7安装sonarqube6.7 代码质量管理平台
应用介绍:SonarQube是一个用于代码质量管理的开源平台,用于管理源代码的质量通过插件形式: 可以支持包括java,C#,C/C++,PL/SQL,Cobol,JavaScrip,Groov ...
- Centos6.5上安装sonarqube6.7.6
Centos6.5已经装备好,可以联网 sonarqube6.7.6下载地址:https://www.sonarqube.org/downloads/ 步骤: 安装MySQL5.7 MySQL详细的安 ...
- CentOS6.8安装配置sonarqube6.4
下载最新版本的sonar(现在改名叫sonarqube) https://www.sonarqube.org/downloads/ 我下载的版本是Sonarqube6.4 1 使用前需要 ...
- SonarQube6.7.4安装部署
1.准备工作 https://www.sonarqube.org Sonar 是一个用于代码质量管理的开放平台.通过插件机制,Sonar 可以集成不同的测试工具,代码分析工具,以及持续集成工具.比如p ...
- Linux安装sonarQube
安装sonarQube之前,需要先安装JDK和mysql 服务器/home/azrlnx04/下创建三个文件夹,/java ./mysql. /sonar 一:安装JDK (1)打开http://ww ...
- Linux下SonarQube代码质量平台的安装和使用方法
Sonar简介: Sonar是一个用于代码质量管理的开源平台,用于管理源代码的质量,可以从七个维度检测代码质量 通过插件形式,可以支持包括java,C#,C/C++,PL/SQL,Cobol,Java ...
- sonarqube6.7部署文档
应用介绍:sonarqube是一个用于代码质量管理的开源平台,用于管理源代码的质量通过插件形式:可以支持包括Java.C#/C++.PL/SQL.Cobol.javascrip.Groovy等等二十几 ...
- SonarQube安装文档
1.SonarQube 1.1 SonarQube介绍 SonarQube是管理代码质量一个开放平台,可以快速的定位代码中潜在的或者明显的错误. SonarQube是否可以使用自定义规则由开发人员的开 ...
- sonar安装
##jdk不要用yum下载的 一.下载sonar源码 cd /usr/local/src wget https://sonarsource.bintray.com/Distribution/sonar ...
随机推荐
- JavaScript——AJAX
AJAX技术是网页构建的必备技能之一,本文希望能帮助大家轻松的学习这项技术 一.什么是ajax? ajax(异步javascript xml) 能够刷新局部网页数据而不是重新加载整个网页. 二.如何使 ...
- anaconda2安装cv2
http://m.blog.csdn.net/u010167269/article/details/62447648 下载离线安装包:https://anaconda.org/menpo/opencv ...
- docker --swarm创建一个集群
如果搭建错误可以强制脱离集群网络: docker swarm leave --force 初始化集群网络管理节点: docker swarm init --advertise-addr 10.101. ...
- APICloud之封装webApp
注册用户 https://www.apicloud.com/ 使用步骤 进入开发控制台 创建应用 选择webApp 根据自己的情况填写信息,然后创建即可 应用创建后的界面 端设置 app界面设置 证书 ...
- poj2586 【贪心】
Accounting for Computer Machinists (ACM) has sufferred from the Y2K bug and lost some vital data for ...
- MT【15】证明无理数(1)
证明:$tan3^0$是无理数. 分析:证明无理数的题目一般用反证法,最经典的就是$\sqrt{2}$是无理数的证明. 这里假设$tan3^0$是有理数,利用二倍角公式容易得到$tan6^0,tan1 ...
- vimrc 的配置
windows syntax on set nocompatible set guifont=Consolas:h17 set linespace=0 color molokai set clipbo ...
- Shell基础知识(二)
对于一个shell脚本来说,第一行是 "#!/bin/bash",这条命令中的 "#!" 告诉系统该用哪一款解释器来对该脚本进行解释,后面的"/bin ...
- JDK源码分析(5)Vector
JDK版本 Vector简介 /** * The {@code Vector} class implements a growable array of * objects. Like an arra ...
- 【洛谷P2617】Dynamic Rankings
题目大意:维护带修改区间 K 小值. 题解:学习到了树状数组套权值线段树. 主席树,即:可持久化权值线段树,支持维护静态区间的 K 小值问题,其核心思想是维护 N 棵权值线段树,每个线段树维护的是序列 ...