0.参考文档

LTS 7.9.1 新特性:https://www.sonarqube.org/sonarqube-7-9-lts/

JDK11 下载地址: 链接:https://pan.baidu.com/s/1VGEUd2nPzsDeOE2Ycrcmqg  密码:gpx9

1.下载软件包

下载链接: https://www.sonarqube.org/downloads/

2.添加系统用户

useradd sonarqube
passwd sonarqube

  

3.优化系统参数

sysctl -w  vm.max_map_count=262144
sysctl -w fs.file-max=65536
ulimit -u 4096 sonarqube
ulimit -n 65536 sonarqube

  

4.解压安装包

mv sonarqube-7.9.1.zip  /home/sonarqube/
chown -R sonarqube:sonarqube /home/sonarqube/
su - sonarqube
yum -y install unzip
unzip sonarqube-7.9.1.zip

  

5.更改配置文件

vim sonarqube-7.9.1/conf/sonar.properties

[sonarqube@localhost ~]$ grep -v "^#" sonarqube-7.9.1/conf/sonar.properties | grep -v "^$"
sonar.jdbc.username=sonarqube
sonar.jdbc.password=meiyoumima
sonar.jdbc.url=jdbc:postgresql://127.0.0.1/sonarqube?currentSchema=my_schema

  

6.安装PostgreSQL#下载pg9.6 源

yum install https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-7-x86_64/pgdg-centos96-9.6-3.noarch.rpm
yum install postgresql96-server postgresql96-contrib
#初始化db
/usr/pgsql-9.6/bin/postgresql96-setup initdb #启动服务、开机自启
systemctl start postgresql-9.6
systemctl enable postgresql-9.6 #防火墙
firewall-cmd --add-service=postgresql --permanent
firewall-cmd --reload #登录数据库
su - postgres
psql -U postgres
ALTER USER postgres with encrypted password 'xxxxxx';
\q
exit #创建sonarqube用户
create user sonarqube with password 'xxxxx';
create database sonarqube owner sonarqube;
grant all  on database sonarqube to sonarqube;
create schema my_schema; #开启远程访问
vi /var/lib/pgsql/9.6/data/postgresql.conf #listen_addresses = '*' 
vi /var/lib/pgsql/9.6/data/pg_hba.conf systemctl restart postgresql-9.6.service #pg_hba.conf
# IPv4 local connections:
host all all 0.0.0.0/0 trust
# IPv6 local connections:
host all all ::1/128 ident
# Allow replication connections from localhost, by a user with the
# replication privilege.
#local replication postgres peer
#host replication postgres 127.0.0.1/32 ident
#host replication postgres ::1/128 ident
host all all 0.0.0.0/0 ident

  

7.添加系统服务

ln -s /home/sonarqube/sonarqube-7.9.1/bin/linux-x86-64/sonar.sh  /usr/bin/sonar

vim /etc/init.d/sonarqube

#!/bin/sh
#
# rc file for SonarQube
#
# chkconfig: 345 96 10
# description: SonarQube system (www.sonarsource.org)
#
### BEGIN INIT INFO
# Provides: sonar
# Required-Start: $network
# Required-Stop: $network
# Default-Start: 3 4 5
# Default-Stop: 0 1 2 6
# Short-Description: SonarQube system (www.sonarsource.org)
# Description: SonarQube system (www.sonarsource.org)
### END INIT INFO /usr/bin/sonar $* chkconfig --add sonarqube
chkconfig sonarqube on service sonarqube status

  

8.FAQ

1. JDK11错误: 需要安装JDK11

[sonarqube@localhost linux-x86-64]$ ./sonar.sh  console
Running SonarQube...
wrapper | --> Wrapper Started as Console
wrapper | Launching a JVM...
jvm 1 | Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
jvm 1 | Copyright 1999-2006 Tanuki Software, Inc. All Rights Reserved.
jvm 1 |
jvm 1 | 20:46:06.753 [WrapperSimpleAppMain] WARN org.sonar.application.config.JdbcSettings - JDBC URL is recommended to have the property 'rewriteBatchedStatements=true'
jvm 1 | 20:46:06.764 [WrapperSimpleAppMain] WARN org.sonar.application.config.JdbcSettings - JDBC URL is recommended to have the property 'useConfigs=maxPerformance'
jvm 1 |
jvm 1 | WrapperSimpleApp: Encountered an error running main: java.lang.IllegalStateException: SonarQube requires Java 11+ to run
jvm 1 | java.lang.IllegalStateException: SonarQube requires Java 11+ to run
jvm 1 | at org.sonar.application.App.checkJavaVersion(App.java:93)
jvm 1 | at org.sonar.application.App.start(App.java:56)
jvm 1 | at org.sonar.application.App.main(App.java:98)
jvm 1 | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
jvm 1 | at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
jvm 1 | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
jvm 1 | at java.lang.reflect.Method.invoke(Method.java:498)
jvm 1 | at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240)
jvm 1 | at java.lang.Thread.run(Thread.java:748)
wrapper | <-- Wrapper Stopped

2.MySQL数据库不支持

Centos7安装部署SonarQube7.9.1教程的更多相关文章

  1. CentOS7安装部署zabbix3.4操作记录

    CentOS7安装部署zabbix3.4操作记录 1.安装前准备 1.1 查看centos的系统版本 [root@zabbix ~]# cat /etc/redhat-release CentOS L ...

  2. centos7 安装部署运行 Redis5

    原文:centos7 安装部署运行 Redis5 Redis5 下载与解压(官网: https://redis.io/download ) 下载命令:wget http://download.redi ...

  3. 容器centos7安装部署ansible

    容器centos7安装部署ansible centos镜像版本及ansible版本 centos:centos7.5.1804 ansible:2.9.11 启动容器并进入容器 docker run ...

  4. Centos7安装部署搭建gitlab平台、汉化

    Centos7安装部署搭建gitlab平台.汉化 安装环境要求:内存不要小于4G,否则后期web界面可能会报错 一.准备工作 1.1 查看系统版本 首先查询系统版本,下载Gitlab的对应版本 [ro ...

  5. 【运维技术】VM虚拟机上使用centos7安装docker启动gogs服务教程【含B站视频教程】

    VM虚拟机上使用centos7安装docker启动gogs服务视频教程 BiliBili视频教程链接飞机票,点我 使用VMware Workstation安装Centos7 MinMal系统 第一步: ...

  6. centos7安装部署opentsdb2.4.0

    写在前面 安装HBase 在HBase中创建表结构 安装配置并启动opentsdb 写在前面 最近因为项目需要在读opentsdb的一部分源码,后面会做个小结分享出来.本人是不大喜欢写这种安装部署的文 ...

  7. centos7 安装部署 Jenkins

    Jenkins 安装部署 1. 安装资源下载 Jenkin镜像地址: http://mirrors.jenkins-ci.org/status.html 选择清华大学镜像地址下载rpm https:/ ...

  8. centos7安装部署SVN

      SVN介绍 SVN是个自由.开源的版本控制系统,绝大多数开源软件都使用SVN作为代码版本管理软件. SVN的官方网站http://subversion.apache.org/.目前SVN在开源社区 ...

  9. Centos7 安装部署Kubernetes(k8s)集群

    目录 一.系统环境 二.前言 三.Kubernetes 3.1 概述 3.2 Kubernetes 组件 3.2.1 控制平面组件 3.2.2 Node组件 四.安装部署Kubernetes集群 4. ...

随机推荐

  1. (转)Java并发包:AtomicBoolean和AtomicReference

    转:https://blog.csdn.net/zxc123e/article/details/52057289 文章译自:http://tutorials.jenkov.com/java-util- ...

  2. Codeforces Round #506 (Div. 3) E

    Codeforces Round #506 (Div. 3) E dfs+贪心 #include<bits/stdc++.h> using namespace std; typedef l ...

  3. docker 部署netcore 的关键语句

    网站容器:docker run -it --name myTestWeb -p 8080:80 -v /mnt/hgfs/my_share/core/website/:/website microso ...

  4. 记录一些比较长的adb命令,复制用

    adb shell content query --uri content://settings/secure --projection value --where "name=\'andr ...

  5. GET和POST区别及缓存问题

    2.就是get和post区别的缓存问题. 首先要了解什么是缓存. HTTP缓存的基本目的就是使应用执行的更快,更易扩展,但是HTTP缓存通常只适用于idempotent request(可以理解为查询 ...

  6. 测开之路三十九:js基础

    js的两种使用方式 第一种使用方式:单独写js文件 在static下新建一个js文件并写入内容 alert('这是一个弹窗'); 在html文件里面,用script标签引入 <script sr ...

  7. Java学习之包

    一.包:就是类的命名空间(在文件系统中的表现形式就是文件夹) 二.代码编写规则 1.写在程序文件的第一行 2.格式:package 包名[.包名1.包名2......] 类的全名称 包名.类名 例如: ...

  8. <读书笔记>《锋利的jQuery》

    2016年4月3日 第4章 jq中的事件和动画 4.1 jq中的事件 (1)window.onload.$(documet).ready()的区别: 1.执行时机:window.onload需要整个页 ...

  9. fiddler接口知识

    1. 访问接口时经常会出现乱码的情况,需要fiddler解码操作 2.域名过滤

  10. Dubbo 系列(07-5)集群容错 - Mock

    Dubbo 系列(07-5)集群容错 - Mock [toc] Spring Cloud Alibaba 系列目录 - Dubbo 篇 1. 背景介绍 相关文档推荐: Dubbo 实战 - 服务降级 ...