CentOS7 SonarQube安装
2024-10-19 11:36:45
CentOS7 SonarQube安装
CentOS7 SonarQube安装
Download
Database
设定Postgres数据库
su postgres
psql -U postgres
CREATE USER sonar WITH PASSWORD 'sonar';
CREATE DATABASE sonar WITH OWNER sonar ENCODING 'UTF8';
\q
Install
- 安装
上传ZIP文件到/tmp目录下
mkdir /opt/sonar
cd /opt/sonar
unzip /tmp/sonarqube-5.0.zip
unzip /tmp/sonar-runner-dist-2.4.zip
环境变量
在/etc/profile.d目录下新建sonar.sh
#!/bin/bash
SONAR_HOME=/opt/sonar/sonarqube-5.0
SONAR_RUNNER_HOME=/opt/sonar/sonar-runner-2.4
PATH=$SONAR_RUNNER_HOME/bin:$PATH
export SONAR_HOME
export SONAR_RUNNER_HOME
export PATH
并赋予执行权限
chmod +x /etc/profile.d/sonar.sh
source /etc/profile.d/sonar.sh
/opt/sonar/sonarqube-5.0/conf/sonar.properties sonar.jdbc.username=sonar sonar.jdbc.password=sonar sonar.jdbc.url=jdbc:postgresql://localhost/sonar sonar.web.context= sonar.web.port=9084 sonar.search.port=9085
/opt/sonar/sonar-runner-2.4/conf/sonar-runner.properties #Configure here general information about the environment, such as SonarQube DB details for example #No information about specific project should appear here
#----- Default SonarQube server
sonar.host.url=http://localhost:9084 #----- PostgreSQL
sonar.jdbc.url=jdbc:postgresql://localhost/sonar #----- MySQL
#sonar.jdbc.url=jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8 #----- Oracle
#sonar.jdbc.url=jdbc:oracle:thin:@localhost/XE #----- Microsoft SQLServer
#sonar.jdbc.url=jdbc:jtds:sqlserver://localhost/sonar;SelectMethod=Cursor #----- Global database settings
sonar.jdbc.username=sonar
sonar.jdbc.password=sonar #----- Default source code encoding
sonar.sourceEncoding=UTF-8 #----- Security (when 'sonar.forceAuthentication' is set to 'true')
sonar.login=admin
sonar.password=admin
新建/etc/init.d/sonar
#!/bin/sh # chkconfig: - 80 20
# Description: SONAR /opt/sonar/sonarqube-5.0/bin/linux-x86-64/sonar.sh $*
exit $?
赋予执行权限
chmod +x /etc/init.d/sonar
设定开机启动
chkconfig sonar on
- 防火墙
新建文件/usr/lib/firewalld/services/sonar.xml
<?xml version="1.0" encoding="utf-8"?>
<service>
<short>Sonar Qube 5.0 service</short>
<description>SonarQube</description>
<portprotocol="tcp"port="9084"/>
</service>
修改防火墙设定
firewall-cmd --permanent --add-service=sonar
firewall-cmd --reload
最新文章
- VS2008切换设计视图卡死 停止响应
- struts配置文件中如何从一个package的action跳到另一个package中的某个action
- Android开发优化宝典
- Android中Bitmap和Drawable,等相关内容
- C#字符串string的常用使用方法
- Infinite scroll has been called autopagerize, unpaginate, endless pages
- Js实现京东无延迟菜单效果(demo)
- Log4net快速配置使用指南。(快速搭建log4net日志平台手册)
- Eclipse创建一个JAVA WEB项目
- WPF入门之一APP.XAML
- HDU 6143 17多校8 Killer Names(组合数学)
- HashMap实现原理分析(面试问题:两个hashcode相同 的对象怎么存入hashmap的)
- java-JProfiler(四)-HelloWorld示例
- 527D Clique Problem 判断一维线段没有两辆相交的最大线段数量
- jmeter 中使用ServerAgen链接超时可能出错的原因之一ip不对
- js便签笔记(2)——DOM元素的特性(Attribute)和属性(Property)
- 20165227 《Java程序设计》实验一(Java开发环境的熟悉)实验报告
- DIY远程监控室内温度设备(tiny6410+ds18b20+yeelink+curl)
- (转)Struts2返回JSON数据的具体应用范例
- Mac下包管理平台homebrew的使用
热门文章
- java 中 finally里面写了return 会发生什么?
- 关于公司内部的Nuget服务
- Blend 2015 教程 (四)控件模板
- 使用https的HSTS需要注意的一个问题
- 使用ASP.NET Web API 2创建OData v4 终结点
- dojo Provider(script、xhr、iframe)源码解析
- 动态绑定HTML
- Angular ngClick 阻止冒泡和默认行为
- [PCB设计] 2、畸形PCB板子的制作核心——AD14导入dwg格式文件的方法
- [浅学] 1、Node.js尝试_安装&;运行第一个helloworld