CentOS7 SonarQube安装

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

转载于:https://www.cnblogs.com/tjpanda88/p/4306152.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值