Sonarqube code Quality Management Platform Installation

Source: Internet
Author: User

IP: 192.168.4.221

Environment: centos 6.6, jdk7, mysql5.1, SonarQube-4.5.4 (LTs)

RootUser operations

Preparations: JDK 7 has been installed and environment variables have been configured.

 

1Install mysql5.1

(Refer to the MySQL installation procedure on the svn management platform. If you have installed MySQL, you do not need to install it)

# Rpm-Qa | grepmysql # Check whether the MySQL database is installed on the operating system,

If yes, you can run the rpm-e command or the rpm-e -- nodeps command to uninstall it.

# Yum installmysql-server MySQL mysql-devel

# Service mysqldstart

 

# Chkconfig -- list | grep mysqld

Mysqld 0: off 1: off 2: off 3: off 4: off 5: off 6: Off

The command above shows that MySQL does not set boot start, so you need to set boot start

# Chkconfig mysqldon

 

To facilitate remote management, open port 3306 in the firewall.

# Vi/etc/sysconfig/iptables

-A input-M state -- state new-m tcp-p tcp -- dport 3306-J accept

Restart the firewall to make the port configuration take effect.

# Service iptablesrestart

 

Set the password of the root user of the MySQL database:

# Mysqladmin-uroot password 'wusc. 123'

Log on to the database:

# Mysql-u root-P

 

MySQL authorized remote access (use root to log on to MySQL first)

Mysql> grant allprivileges on *. * To 'root' @ '%' identified by 'wusc. 321 'with grant option;

Mysql> flushprivileges;


2, Configure MySQL

In combination with sonarqube, it is best to use the InnoDB Engine for MySQL databases to improve performance.

Check what storage engine your MySQL currently provides: mysql> show engines;

650) This. width = 650; "src =" http://s4.51cto.com/wyfs02/M00/81/FB/wKioL1dGrw6DkjJLAABIoCZ2IfI803.png "Title =" code quality 1.png "alt =" wkiol1dgrw6dkjjlaabiocz2ifi803.png "/>

Look at yourmysqlCurrent default storage engine:

mysql> show variables like‘%storage_engine%‘;

650) This. width = 650; "src =" http://s4.51cto.com/wyfs02/M01/81/FC/wKiom1dGrirBuwsIAAAWqn66LJE828.png "Title =" code quality 2.png "alt =" wkiom1dgrirbuwsiaaawqn66lje828.png "/>

ModifyMySQLThe storage engine isInnoDB, In the configuration file/etc/my.cnfIn

[mysqld] Add belowdefault-storage-engine=INNODB

# vi /etc/my.cnf

[mysqld]

default-storage-engine=INNODB

 

RestartmysqlServer

# service mysqld restart

 

Log on againMySQLCheck whether the default engine settings take effect

mysql> show variables like‘%storage_engine%‘;

+----------------+--------+

| Variable_name  |Value  |

+----------------+--------+

| storage_engine | InnoDB |

+----------------+--------+

 

innodb_buffer_pool_size Set the parameter value as large as possible

This parameter is mainly used to cache indexes, data, and buffer when inserting InnoDB tables.

The default value is 128 MB. The size of the dedicated MySQL server is 70%-80% of the operating system memory.

Setting Method: add the innodb_buffer_pool_size parameter under the my. CNF file [mysqld ].

# vi /etc/my.cnf

[mysqld]

Innodb_buffer_pool_size = 256 m

(We set it to 256 MB here because we are not a dedicated MySQL database server, and many other services need to occupy the system memory)

 

Set MySQL query Cachequery_cache_size ,Set at least 15 MB

# vi /etc/my.cnf

[mysqld]

Query_cache_type = 1

Query_cache_size = 32 m

 

RestartmysqlServer

# service mysqld restart

 

Verify that the cache settings take effect:

Mysql> show variableslike '% query_cache % ';

+ ------------------------------ + ---------- +

| Variable_name | value |

+ ------------------------------ + ---------- +

| Have_query_cache | Yes |

| Query_cache_limit | 1048576 |

| Query_cache_min_res_unit | 4096 |

| Query_cache_size | 33554432 |

| Query_cache_type | on |

| Query_cache_wlock_invalidate | off |

+ ------------------------------ + ---------- +

 

3, Create sonarqube database (UTF-8 code)


Ii. Install sonarqube's Webserver

Download the latest ltsversion of the sonarqubeinstallation package (the latest version is sonarqube-4.5.4.zip ):

: Http://www.sonarqube.org/downloads/

650) This. width = 650; "src =" http://s1.51cto.com/wyfs02/M02/81/FB/wKioL1dGrzKjxUzJAACyMwfaAz8384.png "Title =" code quality 3.png "alt =" wkiol1dgrzkjxuzjaacymwfaaz8384.png "/>

Http://dist.sonar.codehaus.org/sonarqube-4.5.4.zip

Download:

# Wgethttp: // dist.sonar.codehaus.org/sonarqube-4.5.4.zip

Unzip and install:

# Unzipsonarqube-4.5.4.zip

# Mvsonarqube-4.5.4 sonarqube

 

Edit sonar Configuration:

# Cdsonarqube/CONF/

# Visonar. Properties

Sonar. JDBC. Username = root

Sonar. JDBC. Password = wusc.123

# ----- MySQL 5.x

Sonar. JDBC. url = JDBC: mysql: // localhost: 3306/sonarqube? Useunicode = true & characterencoding = utf8 & rewritebatchedstatements = true & useconfigs = maxperformance

 

Sonar. Web. Host = 0.0.0.0

Sonar. Web. Context =/sonarqube

Sonar. Web. Port = 9090

 

Save the preceding configuration (Note: Check whether the default port 9000 is in use)

 

Open port 9090 in the firewall:

# Vi/etc/sysconfig/iptables

-A input-M state -- state new-m tcp-p tcp -- dport 9090-J accept

Restart the firewall to make the port configuration take effect.

# Service iptablesrestart

 

Start sonarqube Web Server

#/Root/sonarqube/bin/linux-x86-64/sonar. shstart

(The table is automatically created and initialized at the first startup)

 

Enter http: // 192.168.4.221: 9090/sonarqube/in the browser/

650) This. width = 650; "src =" http://s2.51cto.com/wyfs02/M00/81/FB/wKioL1dGr0aj8XYIAAFBiD6YU4U895.png "Title =" code quality 4.png "alt =" wkiol1dgr0aj8xyiaafbid6yu4u895.png "/>

 

Login. The default user name/password is admin/admin

650) This. width = 650; "src =" http://s4.51cto.com/wyfs02/M00/81/FC/wKiom1dGrmSgZ-WuAAAaamZLFuA150.png "Title =" code quality 5.png "alt =" wKiom1dGrmSgZ-WuAAAaamZLFuA150.png "/>

 

650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M01/81/FC/wKiom1dGrnqABAQWAAF_G5dhjWU765.png "Title =" code quality 6.png "alt =" wkiom1dgrnq1_waaf_g5dh1_u765.png "/>

 

 

At this point, sonarqube has been installed. Next, configure and use sonarqube.


This article is from the "11642765" blog, please be sure to keep this source http://11652765.blog.51cto.com/11642765/1783508

Sonarqube code Quality Management Platform Installation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.