当前位置:网站首页>Installation of sonarqube code quality management platform (to be continued)
Installation of sonarqube code quality management platform (to be continued)
2022-06-13 08:55:00 【Turn X7】
Environmental Science :Centos7 、jdk11( need 11 Or above )、postgresql-11( need 10 Or above )、sonarqube-8.9.3(LTS- Long term support )
1、 install jdk11
Installation package
The official download :Java Archive Downloads - Java SE 11

CSDN Download address :jdk11-linux.rar-Linux Document resources -CSDN download
The installation procedure is the same as :Linux Installation in environment jdk_Turn X7-CSDN Blog
2、 install postgresql-11(sonarqube7.8 Version and above do not support mysql, Support database :MS SQL、Oracle、PostgreSQL), Use here PostgreSQL:
State in advance : The following steps depend on the operating system and PostgreSQL Slightly different versions , Specific view PostgreSQL: Linux downloads (Red Hat family)

After selecting the installation version and operating system, the installation script is automatically generated , The reader shall replace the following scripts in the installation process according to the actual situation
# Install the repository RPM
yum install https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
# Install the client packages:
yum install postgresql11
# Optionally install the server packages:
yum install postgresql11-server
# Optionally initialize the database and enable automatic start:
/usr/pgsql-11/bin/postgresql-11-setup initdb
systemctl enable postgresql-11
systemctl start postgresql-11
# PostgreSQL Automatically created postgres user , Before creating the database , Use postgres User or root The user logs in and resets postgres User password .
su -l postgres
# Connect to database , psql The command is activated PostgreSQL Database terminal :
psql
# The following description will be output to indicate that the connection has entered PostgreSQL database :
-bash-4.2$ psql
psql (11.5)
Type "help" for help.
postgres=# help
You are using psql, the command-line interface to PostgreSQL.
Type: \copyright for distribution terms
\h for help with SQL commands
\? for help with psql commands
\g or terminate with semicolon to execute query
\q to quit
# Reset postgres User password :
postgres=# \password
# Turn on Remote Access
vim /var/lib/pgsql/11/data/postgresql.conf
modify #listen_addresses = 'localhost' by listen_addresses=‘*'
# Trust remote connections
vim /var/lib/pgsql/11/data/pg_hba.conf
Modify the following , Trust the server connection
# IPv4 local connections:
host all all 127.0.0.1/32 trust
# Restart the database to take effect
systemctl restart postgresql-11
# Create database
CREATE DATABASE sonarqube OWNER postgres;
GRANT ALL PRIVILEGES ON DATABASE sonarqube to postgres;
ps: Client connection command :psql -h 127.0.0.1 -d postgres -U postgres -p 5432Attach uninstall instructions ( Do you know ):https://blog.csdn.net/qq_32077121/article/details/121804615
3、 install sonarqube
Official download address :Download | SonarQube

CSDN Download address :sonarqube-8.9.3.48735.zip-Linux Document resources -CSDN download
Official installation documentation :Install the Server | SonarQube Docs
# Create new users and set user passwords ( because sonarqube Self contained Elasticsearch Can't use root User run )
1、useradd sonar
2、passwd sonar
# take sonarqube Upload the compressed package to the server and decompress it
unzip sonarqube-8.9.3.48735.zip
# Configure database connections Profile location $SONARQUBE-HOME/conf/sonar.properties
sonar.jdbc.username=postgres
sonar.jdbc.password=postgres
sonar.jdbc.url=jdbc:postgresql://127.0.0.1:5432/sonarqube
# To configure Elasticsearch Storage path - Profile location $SONARQUBE-HOME/conf/sonar.properties
sonar.path.data=/var/sonarqube/data
sonar.path.temp=/var/sonarqube/temp
# Add the above table of contents sonar User access rights
chown sonar:sonar /var/sonarqube/data
chown sonar:sonar /var/sonarqube/temp
# To configure Web Server Profile location $SONARQUBE-HOME/conf/sonar.properties
sonar.web.host=xx.xx.xx.xx The reader needs to change to the actual ip Address
sonar.web.context=/sonarqube
sonar.web.port=9000
# modify jdk To configure Profile path :$SONARQUBE-HOME/conf/wrapper.conf
# If you have multiple versions of... Installed on your machine jdk, You need to display the specified sonarqube function jdk edition
wrapper.java.command=/path/to/my/jdk/bin/java
# function ( Need to switch to sonar User execution )
$SONARQUBE-HOME/bin/linux-x86-64/sonar.sh start
#sonarqube When starting an exception, you need to locate it through the log , Log path :$SONARQUBE-HOME/logs
# visit
http://xx.xx.xx.xx:9000/sonarqube/
# Interface login default user name and password :admin/adminAfter login, the interface is shown as follows :

4 Use sonarqube
open cmd The window enters the project root path and executes the following command
mvn clean install sonar:sonar -Dsonar.login=admin -Dsonar.password=admin
Execute the final result :

Browser access sonarqube Address to view the code quality analysis results

It can be passed later jenkins Automated tools instead of manual operation maven command , Every time there is a code push Code quality monitoring is automatically triggered after ( This article does not go far enough to state )
An error is reported when the program starts :todo To be supplemented in detail
1、
sysctl -w vm.max_map_count=262144
sysctl -w fs.file-max=65536
ulimit -n 65536
ulimit -u 4096
边栏推荐
- Animation through svg
- ES6 module import / export summary
- JS array method
- VI editor
- Onnx crop intermediate node
- An error CV2 is reported when the picture is converted to grayscale cvtColor(img, cv2.COLOR_BGR2GRAY)
- 4. Relationship selector (parent-child relationship, ancestor offspring relationship, brother relationship)
- Judgment of single exclamation point and double exclamation point in JS
- Form exercise 2
- GBase 8a V95与V86压缩策略类比
猜你喜欢

Explanation of JS event loop mechanism and asynchronous tasks

Browser render passes

Differences and uses among cookies, localstorage, sessionstorage, and application caching
![[pychart pit stepping record] prompt after configuring remote operation, [errno 2] no such file or directory](/img/71/92c06496a9d982294cac61595e0392.png)
[pychart pit stepping record] prompt after configuring remote operation, [errno 2] no such file or directory

Knowledge points related to system architecture 3

torch. How to calculate addmm (m, mat1, mat2)

On the use of regular expressions (bracket problem)

VI editor

Vs installation of vassistx plug-in causes Chinese input of wpf-xaml file to be garbled. Solution

顺时针打印个数组
随机推荐
What is the difference between getfullyear() and getyear()
[leetcode weekly race record] record of the 80th biweekly race
4. Relationship selector (parent-child relationship, ancestor offspring relationship, brother relationship)
Cesium view switching, locating, reading files, building data sources, entity control, model control, etc
Installing pytorch under Anaconda
15. copy constructor
VBA format word (page, paragraph, table, picture)
Mapbox usage, including drawing, loading, modifying, deleting points and faces, displaying pop ups, etc
12. constructor explanation, explicit, initialization list
Brief description of port, domain communication port and domain service
GBase 常见网络问题及排查方法
[network security] webshell empowerment of new thinking of SQL injection
Mobile terminal development I: basic concepts
13.inline,const,mutable,this,static
4、 Js-es5-i / O
【网络安全】SQL注入新思维之webshell提权
You don't know the usage of stringstream
Replace jade engine with EJS
JS wrapper object
Vscode plug in