Skip to content

Commit

Permalink
add sonarqube:new: :book:
Browse files Browse the repository at this point in the history
  • Loading branch information
yanghaiji committed Aug 1, 2022
1 parent 51b5ea2 commit e14d2ca
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,6 @@
### [🔖 DDD 领域驱动设计](note/ddd/README.md)
### [🔖 ETL工具Kettle从入门到入魔](note/kettle/README.md)
### [🔖 ElasticSearch从入门到入魔](note/elasticsearch/README.md)
### [🔖 SonarQube实战](sonarqube/README.md)
### [🔖 面试题总结](note/InterviewQuestions/JavaYouHuo面试题总结.md)
### [🔖 更多实战](note/actualCombat/README.md)
5 changes: 5 additions & 0 deletions note/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,11 @@
- [🔖 elasticsearch 中常用的数据类型大全](elasticsearch/basics/datatype.md)
- [🔖 elasticsearch mapping](elasticsearch/basics/mapping.md)
- [🔖 elasticsearch mapping routing](elasticsearch/basics/routing.md)

## [🔖 SonarQube实战](sonarqube/README.md)
- [🔖 elasticSearch 安装](sonarqube/book/install.md)


## [🔖 面试题总结](InterviewQuestions/JavaYouHuo面试题总结.md)

## [🔖 实战](actualCombat/README.md)
Expand Down
3 changes: 3 additions & 0 deletions note/sonarqube/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## Sonarqube 实战

###[Sonarqube 安装](book/install.md)
61 changes: 61 additions & 0 deletions note/sonarqube/book/install.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# 安装sonarqube

> 本文安装采用Docker的方式安装
>
> 在安装前,请确保您已经安装了postgresql
## 安装

> 在这里有一个值得注意的是,sonarqube 9.0 之后需要使用JDK11及其以上版本,如果您的项目采用的是JDK8编译,那您在安装时需要选择sonarqube 9.0之前的版本,小编这里采用了sonarqube 8.8的版本。
---

### docker 安装命令

```dockerfile
docker pull sonarqube:8.8-community
docker run -d --name sonarqube \
-p 9000:9000 \
-e SONAR_JDBC_URL=jdbc:postgresql://localhost:5432/sonarqube \
-e SONAR_JDBC_USERNAME=postgres \
-e SONAR_JDBC_PASSWORD=123456 \
-v sonarqube/data:/opt/sonarqube/data \
-v sonarqube/extensions:/opt/sonarqube/extensions \
-v sonarqube/logs:/opt/sonarqube/logs \
-v sonarqube/conf:/opt/sonarqube/conf \
sonarqube:8.8-community
```

部署完成后可能会起不来,这是我们可以查看启动日志

> docker logs -f sonarqube
这是我在部署时遇到的问题解决方案

```
vim /etc/sysctl.conf
最后一行添加:
vm.max_map_count=262144
vm.max_map_count=524288
sysctl -p 加载生效
重新启动容器
docker start sonarqube
vi /etc/security/ limit.conf
sonarqube - nofile 131072
sonarqube - nproc 8192
-----------------------------------
一、Linux下Docker安装SonarQube(PostgreSQL)
https://blog.51cto.com/u_15072908/4322206
```

完成后根据主机的ip+port访问即可,如localhost:9000 ,登录的默认用户及密码都为admin

## 扩展

大家可以访问 http://localhost:9000/admin/marketplace 这个页面,下载一些自己喜欢的插件,和语言包之类的

![image-20220720115312815](../img/image-20220720115312815.png)
Binary file added note/sonarqube/img/image-20220720115312815.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit e14d2ca

Please sign in to comment.