Sonar+postsql的安装配置,centos7.9系统

1.安装postsql15

bash 复制代码
sudo yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-6-x86_64/pgdg-redhat-repo-latest.noarch.rpm
sudo yum install -y postgresql15-server
sudo service postgresql-15 initdb
sudo chkconfig postgresql-15 on
sudo service postgresql-15 start

systemctl enable postgresql-15
systemctl start postgresql-15

2.进入postgres并且,创建sonar数据库

bash 复制代码
[root@jenkins conf]# su postgres
bash-4.2$ psql
psql (15.6)
Type "help" for help.

postgres=# create database sonar;

3.下载sonar安装包(java版本为java17)

https://binaries.sonarsource.com/Distribution/sonarqube/sonarqube-9.9.4.87374.zip

下载完成后上传到linux服务器中

bash 复制代码
[root@jenkins ~]# unzip sonarqube-9.9.4.87374.zip
[root@jenkins ~]# mv sonarqube-9.9.4.87374/* /opr/sonar

4.准备环境并且配置相关配置

bash 复制代码
[root@jenkins opt]# useradd sonar   #创建sonar用户配置用于启动sonar
[root@jenkins opt]# chmod -R sonar:sonar sonar #将文件权限的所属都改为sonar
bash 复制代码
[root@jenkins opt]# vim sonar/conf/sonar.properties
sonar.jdbc.username=postgres   #设置为数据库的账户和密码;默认postsql就会生成postgres和密码
sonar.jdbc.password=postgres

sonar.jdbc.url=jdbc:postgresql://localhost/sonar 
#设置连接的数据库的地址和数据库
  1. 启动sonar使用sonar用户启动
bash 复制代码
su sonar /opt/sonar/bin/linux-x86-64/sonar.sh start

6.启动成功,访问 192.168.118.182:9000 (端口可以在配置文件中更改)

相关推荐
骑蜗牛散步1 小时前
Docker下安装ElasticSearch
大数据·elasticsearch·jenkins
12亡灵归来342 小时前
配置Jenkins实现CI/CD流水线
运维·ci/cd·jenkins
常利兵4 小时前
告别臃肿!Elasticsearch平替Manticore登场
大数据·elasticsearch·jenkins
晓庆的故事簿1 天前
【无标题】
elasticsearch·jenkins
生万千欢喜心1 天前
linux 安装 Elasticsearch Kibana
linux·elasticsearch·jenkins
qq_452396231 天前
【工程实战】第九篇:持续集成 —— Jenkins 与 GitLab CI:构建无人值守的自动化流水线
ci/cd·gitlab·jenkins
野木香1 天前
linux安装常用服务(不含jenkins)
linux·运维·jenkins
终端行者4 天前
Jenkins 流水线 Pipeline 声明式语法基础 入门----上
运维·jenkins
终端行者4 天前
Jenkins流水线Pipeline声明式语法基础入门----下
运维·jenkins·cicd