yum install java-17-amazon-corretto -y
sysctl -w vm.max_map_count=262144
sysctl fs.file-max
ulimit -n
ulimit -u
yum install postgresql15 postgresql15-server -y
postgresql-setup --initdb
Need to change config file as shown in below
vi /var/lib/pgsql/data/pg_hba.conf
Replace Method name "ident" to "md5"
Enable postgresql:
systemctl enable postgresql
Start postgresql:
systemctl start postgresql
Login into Database
su - postgres
psql
Create a sonarqubedb database, username and provide access to user
create database sonarqubedb;
create user sonarqube with encrypted password 'Naresh#240';
grant all privileges on database sonarqubedb to sonarqube;
\c sonarqubedb;
GRANT ALL ON SCHEMA public TO sonarqube;
GRANT USAGE ON SCHEMA public TO sonarqube;
\q
exit
Download the latest sonarqube installation file to /opt folder. You can get the latest download link from here. http://www.sonarqube.org/downloads/
cd /opt
wget https://binaries.sonarsource.com/Distribution/sonarqube/sonarqube-9.9.0.65466.zip
unzip sonarqube-9.9.0.65466.zip
mv sonarqube-9.9.0.65466 sonarqube
chown -R ec2-user:ec2-user sonarqube
Open /opt/sonarqube/conf/sonar.properties file
sudo vi /opt/sonarqube/conf/sonar.properties
Switch to ec2-user and navigate to the start script directory
su - ec2-user
cd /opt/sonarqube/bin/linux-x86-64
./sonar.sh start
./sonar.sh status
Troubleshooting Sonarqube: All the logs of sonarqube are present in the /opt/sonarqube/logs directory
cd /opt/sonarqube/logs