-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathsonarqube-install with postgresql
68 lines (46 loc) · 1.51 KB
/
sonarqube-install with postgresql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
##Minimum Requirement for sonarqube
2 vCpu and 4GB RAM
sudo apt-get update -y
# increase the vm.max_map_count kernal, file discriptor and ulimit for current session at runtime
sudo sysctl -w vm.max_map_count=262144
sudo sysctl -w fs.file-max=65536
ulimit -n 65536
ulimit -u 4096
sudo apt-get install openjdk-11-jdk openjdk-11-jre -y
sudo apt install postgresql postgresql-contrib
sudo adduser sonar
groups sonar
sudo usermod -aG sudo sonar
sudo visudo
sonar ALL=(ALL:ALL) NOPASSWD:ALL
cd /opt
sudo wget https://binaries.sonarsource.com/Distribution/sonarqube/sonarqube-8.9.10.61524.zip
sudo unzip sonarqube-8.9.10.61524.zip
sudo mv sonarqube-8.9.10.61524 sonarqube
sudo chown -R sonar:sonar /opt/sonarqube
## login postgres
sudo -i -u postgres
# check the version
psql
# change the password postgres user
\password postgres
# Create user with password
create user sonar with encrypted password 'Linux@123';
# Create Database
create database sonarqube;
# provide privileges for sonar and postgres
# Enter 2 times one its showing error as syntax error at or near grant
grant all privileges on database sonarqube to sonar;
grant all privileges on database sonarqube to postgres;
# exit the postgres
\q
exit
# Update the sonarqube configuration file
cd /opt/sonarqube/conf
vim sonar.properties
## Change the below lines
# Databases Section
sonar.jdbc.username="your created user"
onar.jdbc.password="your created password"
# postgreql section remove after sonarqube
sonar.jdbc.url="jdbc:postgresql://localhost:5432/sonarqube"