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

CentOS7 SonarQube安装的更多相关文章

  1. 代码审查工具Sonarqube安装

    前言:在项目开发当中,完成需求并上线是一件很开心的事情,但为了能按时上线功能不得不为了完成功能而写代码,写的时候觉得先把功能上了以后再回头优化此处代码,但真正上线之后你就会发现你再也不想去修改之前遗留 ...

  2. 在centos7上安装Jenkins

    在centos7上安装Jenkins 安装 添加yum repos,然后安装 sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins ...

  3. CentOS7 Jenkins安装

    CentOS7 Jenkins安装 CentOS7 Jenkins安装 Download 从Jenkins下载apache-tomcat-8.0.18.tar.gz Install 安装 上传RPM文 ...

  4. 在 CentOS7 上安装 zookeeper-3.4.9 服务

    在 CentOS7 上安装 zookeeper-3.4.9 服务 1.创建 /usr/local/services/zookeeper 文件夹: mkdir -p /usr/local/service ...

  5. 在 CentOS7 上安装 MongoDB

    在 CentOS7 上安装 MongoDB 1 通过 SecureCRT 连接至 CentOS7 服务器: 2 进入到 /usr/local/ 目录: cd /usr/local 3 在当前目录下创建 ...

  6. 在 CentOS7 上安装 MySQL5.7

    在 CentOS7 上安装 MySQL5.7 1 通过 SecureCRT 连接到阿里云 CentOS7 服务器: 2 进入到目录 /usr/local/ 中: cd /usr/local/ 3 创建 ...

  7. 在 CentOS7 上安装 Tomcat9

    在 CentOS7 上安装 Tomcat9 1 通过 SecureCRT 连接到阿里云 CentOS7 服务器: 2 进入到目录 /usr/local/ 中: cd /usr/local/ 3 创建目 ...

  8. 在CentOS7上安装JDK1.8

    在CentOS7上安装JDK1.8 1 通过 SecureCRT 连接到阿里云 CentOS7 服务器: 2 进入到目录 /usr/local/ 中: cd /usr/local/ 3 创建目录 to ...

  9. centos7.0 安装字体库

    最近在centos7.0下用itextpdf将word文档转成pdf时出现字体丢失的情况.网上找了很多资料,各式各样的原因和解决方法.后来经过一番测试发现是centos7.0 minimal没有安装相 ...

随机推荐

  1. 工作当中实际运用(1)——tab选项卡

    不废话 直接上代码: tab选项卡 window.onload=function(){ var titles= document.getElementById('header-dh').getElem ...

  2. HK一行所见闻

    香港一行 20多年来,未未去过HK,前段时间由于工作关系去了趟HK.感触良多. 一清早,福田过关,做火车,做地铁,一通到了目的地. 总结对那边的印象: 1,所有人都是粤语,包括工作交流.而且他们不怎么 ...

  3. Salesforce + AngularJS + Bootstrap

    也可以分成三步: 1. 添加css和js引用: <apex:stylesheet value="https://maxcdn.bootstrapcdn.com/bootstrap/3. ...

  4. CentOS7(mini) 急速部署ASP.NET应用

    从mono 2.8+的时候就开始关注linux运行.NET的一些消息 最近闲来无事,发现mono官方已经提供有编译好的源,极大便利了部署过程,不需要自己去编译mono了 用Nancy.Owin写了一个 ...

  5. sublime Text 2 制表符

    写python的时候经常会有提示indent expected错误很常见,比如同一个文件有的是用空格敲出来的,有的是用tab键出来的这时候错误很难排查,这里说说在notepad++跟sublime下的 ...

  6. hash_map的简洁实现

    hash_map的简洁实现   hash_map是经常被使用的一种数据结构,而其实现方式也是多种多样.如果要求我们使用尽可能简单的方式实现hash_map,具体该如何做呢? 我们知道hash_map最 ...

  7. Unity3D热更新全书-重头再来

    之前写了Unity3D热更新全书系列Blog 提出了下载.加载.脚本三个方面的开源类库 下载方面有EasyDown加载方面有GameObjParser脚本方面有C#Light另外有一个没有独立成库,但 ...

  8. ECMAScript5的其它新特性

    之前两篇博客 ECMAScript5 Object的新属性方法,ECMAScript5 Array新增方法,分别介绍了ECMAScript5对Object和Array的拓展,这两个对象最常用,而且改动 ...

  9. swift 加载 storyboard 里的UIViewController

    let storyBoard:UIStoryboard! = UIStoryboard(name: "Main", bundle: nil) let deskVC:DeskView ...

  10. Atitit ACID解决方案2PC(两阶段提交)  跨越多个数据库实例的ACID保证

    Atitit ACID解决方案2PC(两阶段提交)  跨越多个数据库实例的ACID保证 1.1. ACID解决方案1 1.2. 数据库厂商在很久以前就认识到数据库分区的必要性,并引入了一种称为2PC( ...