Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install SonarQube7.9.1 in CentOS

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article is to share with you about how to install SonarQube7.9.1 in CentOS, the editor thinks it is very practical, so I share it with you to learn. I hope you can get something after reading this article.

1. Prepare

SonarQube version: sonarqube-7.9.1.zip

Jdk version: jdk-11.0.4_linux-x64_bin.tar.gz (sonarqube from 7.9 onwards, no longer supports jdk11 below)

Database: PostgreSQL 10.10 (mysql is no longer supported by sonarqube from 7.8) (functional verification can also SonarQube the built-in database, so there is no need to change the database configuration)

2. Install PostgreSQL

For details, please see: CentOS installation PostgreSQL

3. Install JDK

Tar-zxvf / var/ftp/pub/jdk-11.0.4_linux-x64_bin.tar.gz / / extract the installation package ln-s / usr/local/jdk-11.0.4/bin/java / usr/bin/ create a soft connection

You can also directly modify the wrapper.java.command parameter in the $SONARQUBE_HOME/conf/wrapper.conf file to specify the java command line location without creating a soft connection.

Wrapper.java.command=/usr/local/jdk-11.0.4/bin/java

4. Decompress SonarQube

Yum install-y zip unzip / / install the decompression tool unzip / var/ftp/pub/sonarqube-7.9.1.zip / / extract the installation package

5. Modify the $SONARQUBE_HOME/conf/sonar.properties file to change the data connection configuration

Sonar.jdbc.username=test_usersonar.jdbc.password=abc123sonar.jdbc.url=jdbc:postgresql://localhost:5432/test_db

If SonarQube and PostgreSQL are on the same host, please configure the PostgreSQL access policy file pg_hba.conf 127.0.0x32. The password policy of ident should be password or md5. For more information, please see the pg_hba.conf file of PostgreSQL

6. Create SonarQube startup users (SonarQube built-in elasticsearch,elasticsearch does not allow root users to start)

Useradd sonarqubepasswd sonarqube

7. Set system parameters (some parameters need to be set for elasticsearch startup)

For more information, see: common errors in elasticsearch startup

The following error occurred in $SONARQUBE_HOME/logs/es.log when these parameters were not set:

9. Log in to start the user and start the program

Su-sonarqube / / Log in to cd / usr/local/sonarqube-7.9.1/bin/linux-x86-64 / / as a sonarqube user to enter the startup command directory. / sonar.sh start / / start the program

Create a service and set the startup method

This part of the verification failed, leave it here and deal with it later. The elasticsearch included with sonarqube does not allow root users to start, but it is not valid to modify the RUN_AS_USER configuration item in $SONARQUBE/bin/linux-x86-64/sonar.sh.

Create the file sonar in the / etc/init.d/ directory as follows:

#! / bin/sh## rc file for SonarQube## chkconfig: 345 961 cycles description: SonarQube system (www.sonarsource.org) # BEGIN INIT INFO# Provides: $network# Required-Stop: $network# Default-Start: 345 # Default-Stop: 0 12 "Short-Description: SonarQube system (www.sonarsource.org) # Description: SonarQube system (www.sonarsource.org) # # END INIT INFO / usr/bin/sonar $*

Create soft connections and set execution permissions

Ln-s / usr/local/sonarqube-7.9.1/bin/linux-x86-64/sonar.sh / usr/bin/sonar / / create software connection chmod 755 / etc/init.d/sonar / / add execution permissions

Common commands:

Service sonar start / / start the service service sonar stop / / shut down the service service sonar restart / / restart the service chkconfig sonar on / / set boot chkconfig sonar off / / turn off boot startup above is how to install SonarQube7.9.1 in CentOS. The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report