You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Step-7(g): Replace “linux-x86–64” with the appropriate directory for your installation if it’s different
Step-7(h): Add the following line to the SonarQube script file (/opt/sonarqube/bin/linux-x86–64/sonar.sh) to specify the user to run SonarQube as
RUN_AS_USER=sona
Step-7(i): Replace “sona” with the name of the user you created earlier
Step-7(j): Save and exit the sonar.sh file
Step-8: Streamlining SonarQube: Setting Up a systemd Service#
Step-8(a): To create a systemd service file for SonarQube, use the following steps
(i) Create a new service file using a text editor:
sudo nano /etc/systemd/system/sonar.service
(ii) Add the following content to the file:
[Unit]
Description=SonarQube service
After=syslog.target network.target
[Service]
Type=forking
ExecStart=/opt/sonarqube/bin/linux-x86-64/sonar.sh start
ExecStop=/opt/sonarqube/bin/linux-x86-64/sonar.sh stop
User=sona
Group=sona
Restart=always
LimitNOFILE=65536
LimitNPROC=4096
[Install]
WantedBy=multi-user.target
Make sure to replace “User=sona” and “Group=sona” with the appropriate values you have created for your SonarQube installation.
(iii)Save and close the file.
Step-8(b): Reload the systemd sonar to apply the changes
sudo systemctl enable sonar
Step-8(c): Enable the SonarQube service to start at boot##
sudo systemctl start sonar
Step-8(d): Now, you can start the SonarQube service using the following command##
sudo systemctl status sonar
Step-8(e): Hooray, it’s up and running smoothly!
Step-9: Enhancing Performance: Modifying Kernel System Limits##
Step-9(a): To ensure SonarQube functions correctly with Elasticsearch, you’ll need to make some adjustments to the system defaults##
Step-9(b): To edit the sysctl configuration file, use the following command:##
sudo nano /etc/sysctl.conf
Step-9(c): This file controls various kernel parameters##
Step-9(d): Add the following lines to the sysctl configuration file (/etc/sysctl.conf)##
Step-9(e): Save and exit the sysctl configuration file##
Step-9(f): To apply the changes, reboot the system using the following command##
sudo reboot
Step-10: Exploring SonarQube: Accessing the Web Interface#
Step-10(a): Access SonarQube in a web browser by entering your server’s IP address followed by port 9000##
For example, http://IP:9000.
Step-10(b): The default username and password are both “admin”##
Step-10(c): To change the password in SonarQube, follow these steps##
(i) Log in to SonarQube using the username “admin” and password “admin”.
(ii) Once logged in, SonarQube will prompt you to change your password. Enter the current password “admin” and then enter your new password twice as prompted.
(iii) Click on the “Change password” button to save your new password.
Your password has now been successfully changed.
Step-10(c): Congratulations on successfully installing SonarQube Community version 10.0 on AWS EC2 Ubuntu 22! If you have any more questions or need further assistance, feel free to ask. Happy coding!##