Linux安装sonarQube
服务器系统:CentOS 7
服务器/home/azrlnx04/下创建三个文件夹,/java 、/mysql、 /sonar
安装sonarQube之前,需要先安装JDK和mysql
整体的步骤是:
- 安装JDK支持
- 安装mySQL数据库
- 安装SonarQube
一:安装JDK
(1)打开http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html 选择Linux x64 159.97 MB jdk-8u112-linux-x64.rpm,下载至windows系统的下载目录
(2)将rpm文件通过WinSCP(远程复制文件工具)复制至/java文件夹
(3)使用命令为rpm文件加入权限
cd /home/azrlnx04/java/
chmod 777 jdk-8u111-linux-x64.rpm
(4)使用命令安装rpm文件
sudo rpm -ivh jdk-8u111-linux-x64.rpm
(5)使用命令检查jdk
java -version
如果出现了版本号,则是成功的
[azrlnx04@azrlnx04 ~]$ java -version
java version "1.8.0_111"
Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
Java HotSpot(TM) -Bit Server VM (build 25.111-b14, mixed mode)
[azrlnx04@azrlnx04 ~]$
(6)加入至环境变量中,虽然能够正常的使用命令,则还需要加入用户的环境变量中,参考文章http://www.cnblogs.com/samcn/archive/2011/03/16/1986248.html
因权限的问题,当前用户只有部分权限,所以使用第二种方法(操作和修改.bash_profile文件)这样可以将权限加入控制在用户级别
在用户的主目录,使用命令 vi .bash_profile可以打开文件,按下Insert键可以进行操作
修改前
export PATH
修改后
export PATH
export JAVA_HOME=/usr/bin/java
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=./$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
关于怎么得到jdk的地址,我们可以使用命令 whereis java即可以得到地址,修改文件后,按Esc键,加入命令:wq再回车,即可保存当前修改
(7)测试文件,用文本编辑器在windows下新建一个Test.java文件,输入以下代码并保存再复制至当前系统中
public class test {
public static void main(String args[]) {
System.out.println("A new jdk test !");
}
}
使用命令,如果系统能够打印出“A new jdk test !”这个文本则是成功的
javac test.java
java test
二:安装mysql
参考mysql官方文档 http://dev.mysql.com/doc/refman/5.7/en/linux-installation-yum-repo.html
(1)http://dev.mysql.com/downloads/repo/yum/下载 Red Hat Enterprise Linux 7 / Oracle Linux 7 (Architecture Independent), RPM Package(mysql57-community-release-el7-9.noarch.rpm) , rpm文档很小,也是下载至Windows系统本地目录
(2)将下载的mysql57-community-release-el7-9.noarch.rpm复制至/mysql中
(3)运行命令为文件加入权限
chmod 777 mysql57-community-release-el7-9.noarch.rpm
(4)运行安装文件
sudo yum localinstall mysql57-community-release-el7-9.noarch.rpm
服务器回应
[azrlnx04@azrlnx04 mysql]$ sudo yum localinstall mysql57-community-release-el7-.noarch.rpm
[sudo] password for azrlnx04:
Loaded plugins: fastestmirror, langpacks
Examining mysql57-community-release-el7-.noarch.rpm: mysql57-community-release-el7-.noarch
Marking mysql57-community-release-el7-.noarch.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package mysql57-community-release.noarch :el7- will be installed
--> Finished Dependency Resolution Dependencies Resolved ================================================================================================================================================================
Package Arch Version Repository Size
================================================================================================================================================================
Installing:
mysql57-community-release noarch el7- /mysql57-community-release-el7-.noarch 8.6 k Transaction Summary
================================================================================================================================================================
Install Package Total size: 8.6 k
Installed size: 8.6 k
Is this ok [y/d/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : mysql57-community-release-el7-.noarch /
Verifying : mysql57-community-release-el7-.noarch / Installed:
mysql57-community-release.noarch :el7- Complete!
(5)使用yum命令查看mysql,应该可以查看至很多关于mysql的包可供安装
yum repolist all | grep mysql
服务器回应
[azrlnx04@azrlnx04 mysql]$ yum list | grep mysql
mysql-community-client.x86_64 5.7.-.el7 @mysql57-community
mysql-community-common.x86_64 5.7.-.el7 @mysql57-community
mysql-community-devel.x86_64 5.7.-.el7 @mysql57-community
mysql-community-libs.x86_64 5.7.-.el7 @mysql57-community
mysql-community-libs-compat.x86_64 5.7.-.el7 @mysql57-community
mysql-community-server.x86_64 5.7.-.el7 @mysql57-community
mysql57-community-release.noarch el7- @/mysql57-community-release-el7-.noarch
akonadi-mysql.x86_64 1.9.-.el7 base
apr-util-mysql.x86_64 1.5.-.el7 base
dovecot-mysql.x86_64 :2.2.-.el7 base
freeradius-mysql.x86_64 3.0.-.el7 base
libdbi-dbd-mysql.x86_64 0.8.-.el7 base
mysql-community-client.i686 5.7.-.el7 mysql57-community
mysql-community-common.i686 5.7.-.el7 mysql57-community
mysql-community-devel.i686 5.7.-.el7 mysql57-community
mysql-community-embedded.i686 5.7.-.el7 mysql57-community
mysql-community-embedded.x86_64 5.7.-.el7 mysql57-community
mysql-community-embedded-compat.i686 5.7.-.el7 mysql57-community
mysql-community-embedded-compat.x86_64 5.7.-.el7 mysql57-community
mysql-community-embedded-devel.i686 5.7.-.el7 mysql57-community
mysql-community-embedded-devel.x86_64 5.7.-.el7 mysql57-community
mysql-community-libs.i686 5.7.-.el7 mysql57-community
mysql-community-libs-compat.i686 5.7.-.el7 mysql57-community
mysql-community-release.noarch el7- mysql57-community
mysql-community-test.x86_64 5.7.-.el7 mysql57-community
mysql-connector-java.noarch :5.1.-.el7 base
mysql-connector-odbc.x86_64 5.3.-.el7 mysql-connectors-community
mysql-connector-odbc-debuginfo.x86_64 5.3.-.el7 mysql-connectors-community
mysql-connector-odbc-setup.x86_64 5.3.-.el7 mysql-connectors-community
mysql-connector-python.noarch 2.0.-.el7 mysql-connectors-community
mysql-connector-python.x86_64 2.1.-.el7 mysql-connectors-community
mysql-connector-python-cext.x86_64 2.1.-.el7 mysql-connectors-community
mysql-connector-python-debuginfo.x86_64 2.1.-.el7 mysql-connectors-community
mysql-router.x86_64 2.0.-.el7 mysql-tools-community
mysql-router-debuginfo.x86_64 2.0.-.el7 mysql-tools-community
mysql-utilities.noarch 1.6.-.el7 mysql-tools-community
mysql-utilities-extra.noarch 1.5.-.el7 mysql-tools-community
mysql-workbench-community.x86_64 6.3.-.el7 mysql-tools-community
mysql-workbench-community-debuginfo.x86_64 6.3.-.el7 mysql-tools-community
(6)安装mysql,我们这里安装的是mysql 5.7.16
sudo yum install mysql-community-server
服务器回应
[azrlnx04@azrlnx04 mysql]$ sudo yum install mysql-community-server
Loaded plugins: fastestmirror, langpacks
mysql-connectors-community | 2.5 kB ::
mysql-tools-community | 2.5 kB ::
mysql57-community | 2.5 kB ::
(/): mysql-tools-community/x86_64/primary_db | kB ::
(/): mysql57-community/x86_64/primary_db | kB ::
(/): mysql-connectors-community/x86_64/primary_db | kB ::
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package mysql-community-server.x86_64 :5.7.-.el7 will be installed
--> Processing Dependency: mysql-community-common(x86-) = 5.7.-.el7 for package: mysql-community-server-5.7.-.el7.x86_64
--> Processing Dependency: mysql-community-client(x86-) >= 5.7. for package: mysql-community-server-5.7.-.el7.x86_64
--> Running transaction check
---> Package mariadb.x86_64 :5.5.-.el7_2 will be obsoleted
---> Package mysql-community-client.x86_64 :5.7.-.el7 will be obsoleting
--> Processing Dependency: mysql-community-libs(x86-) >= 5.7. for package: mysql-community-client-5.7.-.el7.x86_64
---> Package mysql-community-common.x86_64 :5.7.-.el7 will be installed
--> Running transaction check
---> Package mariadb-libs.x86_64 :5.5.-.el7_2 will be obsoleted
--> Processing Dependency: libmysqlclient.so.()(64bit) for package: :postfix-2.10.-.el7.x86_64
--> Processing Dependency: libmysqlclient.so.()(64bit) for package: :mariadb-devel-5.5.-.el7_2.x86_64
--> Processing Dependency: libmysqlclient.so.(libmysqlclient_18)(64bit) for package: :postfix-2.10.-.el7.x86_64
--> Processing Dependency: mariadb-libs(x86-) = :5.5.-.el7_2 for package: :mariadb-devel-5.5.-.el7_2.x86_64
---> Package mysql-community-libs.x86_64 :5.7.-.el7 will be obsoleting
--> Running transaction check
---> Package mariadb-devel.x86_64 :5.5.-.el7_2 will be obsoleted
---> Package mysql-community-devel.x86_64 :5.7.-.el7 will be obsoleting
---> Package mysql-community-libs-compat.x86_64 :5.7.-.el7 will be obsoleting
--> Finished Dependency Resolution Dependencies Resolved ================================================================================================================================================================
Package Arch Version Repository Size
================================================================================================================================================================
Installing:
mysql-community-client x86_64 5.7.-.el7 mysql57-community M
replacing mariadb.x86_64 :5.5.-.el7_2
mysql-community-devel x86_64 5.7.-.el7 mysql57-community 3.6 M
replacing mariadb-devel.x86_64 :5.5.-.el7_2
mysql-community-libs x86_64 5.7.-.el7 mysql57-community 2.1 M
replacing mariadb-libs.x86_64 :5.5.-.el7_2
mysql-community-libs-compat x86_64 5.7.-.el7 mysql57-community 2.0 M
replacing mariadb-libs.x86_64 :5.5.-.el7_2
mysql-community-server x86_64 5.7.-.el7 mysql57-community M
Installing for dependencies:
mysql-community-common x86_64 5.7.-.el7 mysql57-community k Transaction Summary
================================================================================================================================================================
Install Packages (+ Dependent package) Total download size: M
Is this ok [y/d/N]: y
Downloading packages:
warning: /var/cache/yum/x86_64//mysql57-community/packages/mysql-community-common-5.7.-.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Public key for mysql-community-common-5.7.-.el7.x86_64.rpm is not installed
(/): mysql-community-common-5.7.-.el7.x86_64.rpm | kB ::
(/): mysql-community-devel-5.7.-.el7.x86_64.rpm | 3.6 MB ::
(/): mysql-community-libs-5.7.-.el7.x86_64.rpm | 2.1 MB ::
(/): mysql-community-libs-compat-5.7.-.el7.x86_64.rpm | 2.0 MB ::
(/): mysql-community-server-5.7.-.el7.x86_64.rpm | MB ::
(/): mysql-community-client-5.7.-.el7.x86_64.rpm | MB ::
----------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 9.0 MB/s | MB ::
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
Importing GPG key 0x5072E1F5:
Userid : "MySQL Release Engineering <mysql-build@oss.oracle.com>"
Fingerprint: a4a9 76fc bd3c 70c8 8c71 8d3b e1f5
Package : mysql57-community-release-el7-.noarch (@/mysql57-community-release-el7-.noarch)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
Is this ok [y/N]: y
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : mysql-community-common-5.7.-.el7.x86_64 /
Installing : mysql-community-libs-5.7.-.el7.x86_64 /
Installing : mysql-community-client-5.7.-.el7.x86_64 /
Installing : mysql-community-server-5.7.-.el7.x86_64 /
Installing : mysql-community-libs-compat-5.7.-.el7.x86_64 /
Installing : mysql-community-devel-5.7.-.el7.x86_64 /
Erasing : :mariadb-devel-5.5.-.el7_2.x86_64 /
Erasing : :mariadb-5.5.-.el7_2.x86_64 /
Erasing : :mariadb-libs-5.5.-.el7_2.x86_64 /
Verifying : mysql-community-libs-5.7.-.el7.x86_64 /
Verifying : mysql-community-libs-compat-5.7.-.el7.x86_64 /
Verifying : mysql-community-client-5.7.-.el7.x86_64 /
Verifying : mysql-community-devel-5.7.-.el7.x86_64 /
Verifying : mysql-community-common-5.7.-.el7.x86_64 /
Verifying : mysql-community-server-5.7.-.el7.x86_64 /
Verifying : :mariadb-devel-5.5.-.el7_2.x86_64 /
Verifying : :mariadb-libs-5.5.-.el7_2.x86_64 /
Verifying : :mariadb-5.5.-.el7_2.x86_64 / Installed:
mysql-community-client.x86_64 :5.7.-.el7 mysql-community-devel.x86_64 :5.7.-.el7 mysql-community-libs.x86_64 :5.7.-.el7
mysql-community-libs-compat.x86_64 :5.7.-.el7 mysql-community-server.x86_64 :5.7.-.el7 Dependency Installed:
mysql-community-common.x86_64 :5.7.-.el7 Replaced:
mariadb.x86_64 :5.5.-.el7_2 mariadb-devel.x86_64 :5.5.-.el7_2 mariadb-libs.x86_64 :5.5.-.el7_2 Complete!
(7)启动服务
sudo service mysqld start
服务器回应
[azrlnx04@azrlnx04 mysql]$ sudo service mysqld start
Redirecting to /bin/systemctl start mysqld.service
(8)查看服务
sudo service mysqld status
服务器回应
[azrlnx04@azrlnx04 mysql]$ sudo service mysqld status
Redirecting to /bin/systemctl status mysqld.service
● mysqld.service - MySQL Server
Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
Active: active (running) since Wed -- :: UTC; 16s ago
Process: ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid $MYSQLD_OPTS (code=exited, status=/SUCCESS)
Process: ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=/SUCCESS)
Main PID: (mysqld)
CGroup: /system.slice/mysqld.service
└─ /usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid Nov :: azrlnx04 systemd[]: Starting MySQL Server...
Nov :: azrlnx04 systemd[]: Started MySQL Server.
[azrlnx04@azrlnx04 mysql]$ chkconfig --list | grep mysqld Note: This output shows SysV services only and does not include native
systemd services. SysV configuration data might be overridden by native
systemd configuration. If you want to list systemd services use 'systemctl list-unit-files'.
To see services enabled on particular target use
'systemctl list-dependencies [target]'.
(9)查看mysql默认口令
sudo grep 'temporary password' /var/log/mysqld.log
服务器回应,查看默认的口令就是 p2<yx2dd;jhO
[azrlnx04@azrlnx04 etc]$ sudo grep 'temporary password' /var/log/mysqld.log
[sudo] password for azrlnx04:
--02T04::.749910Z [Note] A temporary password is generated for root@localhost: p2<yx2dd;jhO
[azrlnx04@azrlnx04 etc]$
(10)使用root尝试登陆mysql,使用默认的口令
mysql -u root -p
服务器回应
[azrlnx04@azrlnx04 etc]$ mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is
Server version: 5.7. Copyright (c) , , Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql>
(11)修改口令
ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass4!';
服务器回应,口令不符合需要,第二次修改成功
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'Pro@#13';
ERROR (HY000): Your password does not satisfy the current policy requirements
mysql>
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'newpassword';
Query OK, rows affected (0.00 sec)
(12)使用命令查看所有DB
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| sys |
+--------------------+
rows in set (0.00 sec)
(13)其他可用的包
sudo yum --disablerepo=\* --enablerepo='mysql*-community*' list available
服务器回应
[azrlnx04@azrlnx04 etc]$ sudo yum --disablerepo=\* --enablerepo='mysql*-community*' list available
[sudo] password for azrlnx04:
Loaded plugins: fastestmirror, langpacks
mysql-connectors-community-source | 2.4 kB ::
mysql-tools-community-source | 2.4 kB ::
mysql55-community | 2.5 kB ::
mysql55-community-source | 2.4 kB ::
mysql56-community | 2.5 kB ::
mysql56-community-source | 2.4 kB ::
mysql57-community-source | 2.4 kB ::
mysql80-community | 2.5 kB ::
mysql80-community-source | 2.4 kB ::
(/): mysql55-community/x86_64/primary_db | kB ::
(/): mysql56-community/x86_64/primary_db | kB ::
(/): mysql-connectors-community-source/primary_db | 5.3 kB ::
(/): mysql55-community-source/primary_db | 7.9 kB ::
(/): mysql-tools-community-source/primary_db | 7.8 kB ::
(/): mysql57-community-source/primary_db | 5.0 kB ::
(/): mysql56-community-source/primary_db | 8.1 kB ::
(/): mysql80-community-source/primary_db | 2.4 kB ::
(/): mysql80-community/x86_64/primary_db | kB ::
Loading mirror speeds from cached hostfile
Available Packages
mysql-community-bench.x86_64 5.6.-.el7 mysql56-community
mysql-community-client.i686 8.0.-0.1.dmr.el7 mysql80-community
mysql-community-client.x86_64 8.0.-0.1.dmr.el7 mysql80-community
mysql-community-common.i686 8.0.-0.1.dmr.el7 mysql80-community
mysql-community-common.x86_64 8.0.-0.1.dmr.el7 mysql80-community
mysql-community-devel.i686 8.0.-0.1.dmr.el7 mysql80-community
mysql-community-devel.x86_64 8.0.-0.1.dmr.el7 mysql80-community
mysql-community-embedded.i686 8.0.-0.1.dmr.el7 mysql80-community
mysql-community-embedded.x86_64 8.0.-0.1.dmr.el7 mysql80-community
mysql-community-embedded-compat.i686 8.0.-0.1.dmr.el7 mysql80-community
mysql-community-embedded-compat.x86_64 8.0.-0.1.dmr.el7 mysql80-community
mysql-community-embedded-devel.i686 8.0.-0.1.dmr.el7 mysql80-community
mysql-community-embedded-devel.x86_64 8.0.-0.1.dmr.el7 mysql80-community
mysql-community-libs.i686 8.0.-0.1.dmr.el7 mysql80-community
mysql-community-libs.x86_64 8.0.-0.1.dmr.el7 mysql80-community
mysql-community-libs-compat.i686 8.0.-0.1.dmr.el7 mysql80-community
mysql-community-libs-compat.x86_64 8.0.-0.1.dmr.el7 mysql80-community
mysql-community-release.noarch el7- mysql57-community
mysql-community-server.x86_64 8.0.-0.1.dmr.el7 mysql80-community
mysql-community-test.x86_64 8.0.-0.1.dmr.el7 mysql80-community
mysql-connector-odbc.x86_64 5.3.-.el7 mysql-connectors-community
mysql-connector-odbc-debuginfo.x86_64 5.3.-.el7 mysql-connectors-community
mysql-connector-odbc-setup.x86_64 5.3.-.el7 mysql-connectors-community
mysql-connector-python.noarch 2.0.-.el7 mysql-connectors-community
mysql-connector-python.x86_64 2.1.-.el7 mysql-connectors-community
mysql-connector-python-cext.x86_64 2.1.-.el7 mysql-connectors-community
mysql-connector-python-debuginfo.x86_64 2.1.-.el7 mysql-connectors-community
mysql-router.x86_64 2.0.-.el7 mysql-tools-community
mysql-router-debuginfo.x86_64 2.0.-.el7 mysql-tools-community
mysql-utilities.noarch 1.6.-.el7 mysql-tools-community
mysql-utilities-extra.noarch 1.5.-.el7 mysql-tools-community
mysql-workbench-community.x86_64 6.3.-.el7 mysql-tools-community
mysql-workbench-community-debuginfo.x86_64 6.3.-.el7 mysql-tools-community
[azrlnx04@azrlnx04 etc]$
(14)关于其他包的安装,需要等后续使用后才能确定
三:安装sonarQube
(0)登陆mysql运行脚本
[azrlnx04@azrlnx04 etc]$ mysql -uroot -p
Enter password:
mysql> CREATE DATABASE sonar CHARACTER SET utf8 COLLATE utf8_general_ci;
mysql> CREATE USER 'sonar' IDENTIFIED BY 'sonar';
mysql> GRANT ALL ON sonar.* TO 'sonar'@'%' IDENTIFIED BY 'sonar';
mysql> GRANT ALL ON sonar.* TO 'sonar'@'localhost' IDENTIFIED BY 'sonar';
mysql> FLUSH PRIVILEGES;
运行创建用户,一定要记得尝试使用新创建的用户登陆至mysql
服务器回应
[azrlnx04@azrlnx04 etc]$ mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is
Server version: 5.7. MySQL Community Server (GPL) Copyright (c) , , Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> CREATE DATABASE sonar CHARACTER SET utf8 COLLATE utf8_general_ci;
Query OK, row affected (0.01 sec) mysql> CREATE USER 'sonar' IDENTIFIED BY 'sonar';
ERROR (HY000): Your password does not satisfy the current policy requiremen ts
mysql> GRANT ALL ON sonar.* TO 'sonar'@'%' IDENTIFIED BY 'sonar';
ERROR (HY000): Your password does not satisfy the current policy requiremen ts
mysql> GRANT ALL ON sonar.* TO 'sonar'@'localhost' IDENTIFIED BY 'sonar';
ERROR (HY000): Your password does not satisfy the current policy requiremen ts
mysql> FLUSH PRIVILEGES;
Query OK, rows affected (0.00 sec) mysql> show databases
-> ;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| sonar |
| sys |
+--------------------+
rows in set (0.00 sec) mysql>
至此,mysql会新建一个数据库sonar,以上的脚本会创建一个数据库及用户名sonar,并将用户sonar应用至sonar数据库
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| sonar |
| sys |
+--------------------+
5 rows in set (0.00 sec)
(1)将下载好的sonarqube-6.1.zip和sonar-scanner-2.8.zip通过WinSCP复制至服务器/sonar/中,或者使用命令下载文件
wget https://sonarsource.bintray.com/Distribution/sonarqube/sonarqube-6.1.zip
wget https://sonarsource.bintray.com/Distribution/sonar-scanner-cli/sonar-scanner-2.8.zip
(2)分别进入两个文件夹,对文件增加权限
chmod sonarqube-6.1.zip
chmod sonar-scanner-2.8.zip
服务器回应
[azrlnx04@azrlnx04 etc]$ cd /home/azrlnx04
[azrlnx04@azrlnx04 ~]$ ls -l
total
drwxrwxr-x. azrlnx04 azrlnx04 Nov : java
drwxrwxr-x. azrlnx04 azrlnx04 Nov : mysql
drwxrwxr-x. azrlnx04 azrlnx04 Nov : sonar
[azrlnx04@azrlnx04 ~]$ cd sonar
[azrlnx04@azrlnx04 sonar]$ ls -l
total
-rw-rw-r--. azrlnx04 azrlnx04 Oct : sonarqube-6.1.zip
-rw-rw-r--. azrlnx04 azrlnx04 Oct : sonar-scanner-2.8.zip
[azrlnx04@azrlnx04 sonar]$ chmod sonarqube-6.1.zip
[azrlnx04@azrlnx04 sonar]$ chmod sonar-scanner-2.8.zip
[azrlnx04@azrlnx04 sonar]$ ls -l
total
-rwxrwxrwx. azrlnx04 azrlnx04 Oct : sonarqube-6.1.zip
-rwxrwxrwx. azrlnx04 azrlnx04 Oct : sonar-scanner-2.8.zip
(3)解压zip文件
(3.1)进入/sonar中,使用命令解压sonarqube-6.1.zip
unzip sonarqube-6.1.zip
服务器回应太长,这里不给出了
(3.2)进入/sonar中,解压sonar-scanner-2.8.zip
unzip sonar-scanner-2.8.zip
服务器回应是很少的,因为压缩文件比较小
(4)进入至/sonar/sonarqube-6.1/conf中,使用vi命令打开sonar.properties
vi sonar.properties
并修改其中的三个节点,修改的方式只需要将行内容最前的#号删除即可
在这里特别提醒一下,原本在Windows系统中,是可以建立口令为sonar的sonar用户的,但在Linux中,其实,当在mysql中创建口令为sonar的用户时,会发生错误,但我并未在意,一直以为系统需要其他的配置
建议是,创建用户后, 使用用户登陆一下mysql看一下是否能够正常登陆,不然在运行sonar时,肯定不会成功,且你很难反应是mysql口令的原因。
sonar.jdbc.username=
sonar.jdbc.password= sonar.jdbc.url=jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformance
(5)打开文件夹
[azrlnx04@azrlnx04 sonar]$ cd sonarqube-6.1/bin/linux-x86-64/
[azrlnx04@azrlnx04 linux-x86-64]$ ls -l
服务器回应
[azrlnx04@azrlnx04 sonar]$ cd sonarqube-6.1/bin/linux-x86-64/
[azrlnx04@azrlnx04 linux-x86-64]$ ls -l
total 128
drwxr-xr-x. 2 azrlnx04 azrlnx04 26 Dec 9 2010 lib
-rwxr-xr-x. 1 azrlnx04 azrlnx04 15521 Oct 11 09:02 sonar.sh
-rwxr-xr-x. 1 azrlnx04 azrlnx04 111027 Dec 9 2010 wrapper
(6)运行命令,我们这里是使用启动服务,使用 sonar.sh start
sonar.sh start 启动服务
sonar.sh stop 停止服务
sonar.sh restart 重启服务
[azrlnx04@azrlnx04 linux-x86-64]$ sonar.sh start
-bash: sonar.sh: command not found
当出现了命令无法找到的情况,需要将sonar的目录加入至环境变量
查看环境变量,并加入新的地址,参考地址:http://unix.stackexchange.com/questions/26047/how-to-correctly-add-a-path-to-path
[azrlnx04@azrlnx04 ~]$ $PATH
-bash: /usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/azrlnx04/.local/bin:/home/azrlnx04/bin: No such file or directory
[azrlnx04@azrlnx04 ~]$ PATH=$PATH:~/sonar/sonarqube-6.1/bin/linux-x86-64/
加入SONAR_HOME和SONAR_RUNNER_HOME两个变量,和处理jdk的路径一样,并将新加的变量都加入至变量PATH中(PATH变量是整个系统用户都可以用到),在当前用户的目录打开.bash_profile文件,将变量内容加入至文件中
# .bash_profile # Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi # User specific environment and startup programs PATH=$PATH:$HOME/.local/bin:$HOME/bin export PATH
export JAVA_HOME=/usr/bin/java
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=./$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
修改后,加入颜色部分即加入的内容
# .bash_profile # Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi # User specific environment and startup programs PATH=$PATH:$HOME/.local/bin:$HOME/bin export PATH
export JAVA_HOME=/usr/bin/java
export SONAR_HOME=~/sonar/sonarqube-6.1/bin/linux-x86-64/
export SONAR_RUNNER_HOME=~/sonar/sonar-scanner-2.8/bin/
export PATH=$JAVA_HOME/bin:$SONAR_HOME:$SONAR_RUNNER_HOME:$PATH
export CLASSPATH=./$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
再次运行命令 sonar.sh start
服务器回应是非常简单的,告诉你SonarQube已经启动了
[azrlnx04@azrlnx04 ~]$ sonar.sh start
Starting SonarQube...
Started SonarQube.
与Windows不同,Windows命令窗口中会出现所有的信息,但Linux会将运行的信息都存放至sonar文件夹中的logs子文件夹,可以在其中查看sonar.log文件(有时文件太大,则会分成几个文件,文件名与日期对应),开始我一直以为不成功,其实后台有一部分的信息已经保存下来了
2016.11.07 09:10:07 INFO app[][o.s.a.AppFileSystem] Cleaning or creating temp directory /home/azrlnx04/sonar/sonarqube-6.1/temp
2016.11.07 09:10:07 INFO app[][o.s.p.m.JavaProcessLauncher] Launch process[es]: /usr/java/jdk1.8.0_111/jre/bin/java -Djava.awt.headless=true -Xmx1G -Xms256m -Xss256k -Djna.nosys=true -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+HeapDumpOnOutOfMemoryError -Djava.io.tmpdir=/home/azrlnx04/sonar/sonarqube-6.1/temp -javaagent:/usr/java/jdk1.8.0_111/jre/lib/management-agent.jar -cp ./lib/common/*:./lib/search/* org.sonar.search.SearchServer /home/azrlnx04/sonar/sonarqube-6.1/temp/sq-process4628608208409917744properties
2016.11.07 09:10:08 INFO es[][o.s.p.ProcessEntryPoint] Starting es
2016.11.07 09:10:08 INFO es[][o.s.s.EsSettings] Elasticsearch listening on /127.0.0.1:9001
2016.11.07 09:10:09 INFO es[][o.elasticsearch.node] [sonarqube] version[2.3.3], pid[30725], build[218bdf1/2016-05-17T15:40:04Z]
2016.11.07 09:10:09 INFO es[][o.elasticsearch.node] [sonarqube] initializing ...
2016.11.07 09:10:09 INFO es[][o.e.plugins] [sonarqube] modules [], plugins [], sites []
2016.11.07 09:10:09 INFO es[][o.elasticsearch.env] [sonarqube] using [1] data paths, mounts [[/ (rootfs)]], net usable_space [25.8gb], net total_space [29.9gb], spins? [unknown], types [rootfs]
2016.11.07 09:10:09 INFO es[][o.elasticsearch.env] [sonarqube] heap size [1007.3mb], compressed ordinary object pointers [true]
2016.11.07 09:10:09 WARN es[][o.elasticsearch.env] [sonarqube] max file descriptors [4096] for elasticsearch process likely too low, consider increasing to at least [65536]
2016.11.07 09:10:13 INFO es[][o.elasticsearch.node] [sonarqube] initialized
2016.11.07 09:10:13 INFO es[][o.elasticsearch.node] [sonarqube] starting ...
2016.11.07 09:10:13 INFO es[][o.e.transport] [sonarqube] publish_address {127.0.0.1:9001}, bound_addresses {127.0.0.1:9001}
2016.11.07 09:10:13 INFO es[][o.e.discovery] [sonarqube] sonarqube/VxJMhq7YTSe99uUNYRL81w
2016.11.07 09:10:16 INFO es[][o.e.cluster.service] [sonarqube] new_master {sonarqube}{VxJMhq7YTSe99uUNYRL81w}{127.0.0.1}{127.0.0.1:9001}{rack_id=sonarqube, master=true}, reason: zen-disco-join(elected_as_master, [0] joins received)
2016.11.07 09:10:16 INFO es[][o.elasticsearch.node] [sonarqube] started
2016.11.07 09:10:16 INFO es[][o.e.gateway] [sonarqube] recovered [5] indices into cluster_state
2016.11.07 09:10:19 INFO es[][o.e.c.r.allocation] [sonarqube] Cluster health status changed from [RED] to [GREEN] (reason: [shards started [[tests][0], [tests][0]] ...]).
2016.11.07 09:10:19 INFO app[][o.s.p.m.Monitor] Process[es] is up
2016.11.07 09:10:19 INFO app[][o.s.p.m.JavaProcessLauncher] Launch process[web]: /usr/java/jdk1.8.0_111/jre/bin/java -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djruby.management.enabled=false -Djruby.compile.invokedynamic=false -Xmx512m -Xms128m -XX:+HeapDumpOnOutOfMemoryError -Djava.io.tmpdir=/home/azrlnx04/sonar/sonarqube-6.1/temp -javaagent:/usr/java/jdk1.8.0_111/jre/lib/management-agent.jar -cp ./lib/common/*:./lib/server/*:/home/azrlnx04/sonar/sonarqube-6.1/lib/jdbc/mysql/mysql-connector-java-5.1.39.jar org.sonar.server.app.WebServer /home/azrlnx04/sonar/sonarqube-6.1/temp/sq-process8650920502670994045properties
2016.11.07 09:10:20 INFO web[][o.s.p.ProcessEntryPoint] Starting web
2016.11.07 09:10:21 INFO web[][o.s.s.a.TomcatContexts] Webapp directory: /home/azrlnx04/sonar/sonarqube-6.1/web
2016.11.07 09:10:21 INFO web[][o.a.c.h.Http11NioProtocol] Initializing ProtocolHandler ["http-nio-127.0.0.1-9000"]
2016.11.07 09:10:21 INFO web[][o.a.t.u.n.NioSelectorPool] Using a shared selector for servlet write/read
2016.11.07 09:10:22 INFO web[][o.e.plugins] [Jennifer Kale] modules [], plugins [], sites []
2016.11.07 09:10:24 INFO web[][o.s.s.e.EsClientProvider] Connected to local Elasticsearch: [127.0.0.1:9001]
2016.11.07 09:10:24 INFO web[][o.s.s.p.LogServerVersion] SonarQube Server / 6.1 / dc148a71a1c184ccad588b66251980c994879dff
2016.11.07 09:10:24 INFO web[][o.sonar.db.Database] Create JDBC data source for jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformance&autoReconnect=true&useSSL=false
使用命令可以在本机打开网站
curl http://localhost:9000
只要能够看到网页的HTML代码,则是成功的,如果有查看我之前的文章,在Windows中安装sonar的话,此刻应该可以通过浏览器打开http://localhost:9000了,但Linux不同,即使内部能够访问,但还需要将防火墙中打开某个端口才可以在服务器外部进行访问
(7)配置firewalld
先使用root用户
以下部分是Linux管理员给出的命令行
How to enable root access on Microsoft Azure Cloud.
. Login via ssh using your sudo user
. Now login as root user
Code: [Select]
sudo su -
. check if root access is set (LOCK means that root access is disabled)
Code: [Select]
[root@Linux ~]# grep root /etc/shadow
root:*LOCK*:::::::
. enable root access (as root user enter command passwd)
Code: [Select]
[root@Linux ~]# passwd
now enter your password and root access is enabled, you can check this by using command "grep root /etc/shadow"
先查看firewalld状态,使用系统查看,或是直接firewall-cmd 命令查看
[root@azrlnx04 ~]# systemctl status firewalld
[root@azrlnx04 ~]# firewall-cmd --state
FirewallD is not running
如未运行,则需要先让它运行,关于如何开始firewalld,参考:https://www.liquidweb.com/kb/how-to-start-and-enable-firewalld-on-centos-7/
关于详细的firewalld信息,参考:https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Security_Guide/sec-Using_Firewalls.html
[root@azrlnx04 ~]# systemctl start firewalld
[root@azrlnx04 ~]# firewall-cmd --state
running
另外关于增加端口的文章,参考:http://stackoverflow.com/questions/24729024/centos-7-open-firewall-port
[root@azrlnx04 ~]# firewall-cmd --zone=public --add-port=9000/tcp --permanent
success
[root@azrlnx04 ~]# firewall-cmd --zone=dmz --add-port=9000/tcp --permanent
success
[root@azrlnx04 ~]# firewall-cmd --reload
success
以上都没步骤(7)都有运行,但没有效果,运行步骤(8)才最终可用,现在还不能确定步骤(7)是否是多余的。
(8)如果配置的时候,查看现有的配置,当时sonarQube中设置的肯定只是监听到127.0.0.1的9000端口,而我们需要让它开放出来就可以
[root@azrlnx04 ~]# netstat -tpln | grep 9000
tcp6 0 0 :::9000 :::* LISTEN 38927/java
在sonarQube的配置文件(sonarQube6.1/conf/sonar.properties)中,节点
# Binding IP address. For servers with more than one IP address, this property specifies which
# address will be used for listening on the specified ports.
# By default, ports will be used on all IP addresses associated with the server.
sonar.web.host=127.0.0.1
修改为,意思为,之前监听的是127.0.0.1的端口,现在可以监听所有的
# Binding IP address. For servers with more than one IP address, this property specifies which
# address will be used for listening on the specified ports.
# By default, ports will be used on all IP addresses associated with the server.
sonar.web.host=*
最终才可用
写在最后,至此,Linux服务器上的sonarQube Server端已经完整安装了,但关于Scan代码的问题上,有一个很关键的问题就是,无法在Linux服务器中Scan C#的源代码。
https://groups.google.com/forum/#!topic/sonarqube/Ep_BgEF2pR0
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
2017-01-19更新
今天看到关于C#/Java/JavaScript的插件有新版本可以更新,所以就想将最新的插件安装至sonarQube系统中,但却发现更新插件后重启服务器时等了很久都不见完成,并且在等待了20分钟后再次刷新,发现sonarQube的站点无法访问了,这可点方了,因为这个是正式环境的服务器,如果不能使用将带来很大的影响,方是方,但还得解决问题不是?
下图是我打开插件中心发现的更新插件,解决问题后我只更新了C#插件,另外两个都没有进行更新。出现问题的就是Java插件(4.4)
下图就是使用Chrome浏览器刷新后无法访问的图片
我首先想到的是sonarQube出现了问题,其次是Linux防火墙出现了问题,
1.我先查看了sonarQube的日志
/sonarqube6.1/logs/sonar.log,出现问题时一般先查看该日志文件
尝试重启sonarQube服务器
[azrlnx04@azrlnx04 linux-x86-]$ sonar.sh start
Starting SonarQube...
Started SonarQube.
[azrlnx04@azrlnx04 linux-x86-]$ sonar.sh stop
Stopping SonarQube...
SonarQube was not running.
[azrlnx04@azrlnx04 linux-x86-]$ sonar.sh start
Starting SonarQube...
Started SonarQube.
[azrlnx04@azrlnx04 linux-x86-]$ sonar.sh status
SonarQube is not running.
[azrlnx04@azrlnx04 linux-x86-]$ sonar.sh start -uroot -p
Starting SonarQube...
Started SonarQube.
[azrlnx04@azrlnx04 linux-x86-]$ curl http://localhost:9000
curl: () Failed connect to localhost:; Connection refused
看起来似乎服务可以起来,但是在Linux服务器上访问却不成功,这个时候我却以为sonarQube是没有问题的,继续想着查看是否是防火墙出现了问题
2.其次查看了Linux防火墙
[azrlnx04@azrlnx04 linux-x86-]$ curl http://localhost:9000
curl: () Failed connect to localhost:; Connection refused
[azrlnx04@azrlnx04 linux-x86-]$ curl http://localhost:9000
curl: () Failed connect to localhost:; Connection refused
[root@azrlnx04 ~]# netstat -tpln | grep
tcp6 ::: :::* LISTEN /java
[root@azrlnx04 ~]# curl http://localhost:9000
在重启了sonarQube服务一会儿是在正常监听9000端口的,但过一会儿又不行了,这应该问题还是出现在sonarQube,查看日志
2017.01. :: INFO ce[AVmz8ClrQiyNdwo6POOW][o.s.s.c.t.CeWorkerCallableImpl] Execute task | project=Instantnoodle.Workbench | type=REPORT | id=AVmz8ClrQiyNdwo6POOW | submitter=admin
2017.01. :: INFO ce[AVmz8ClrQiyNdwo6POOW][o.s.s.c.t.CeWorkerCallableImpl] Executed task | project=Instantnoodle.Workbench | type=REPORT | id=AVmz8ClrQiyNdwo6POOW | submitter=admin | time=71933ms
2017.01. :: ERROR web[][o.s.s.w.WebServiceEngine] Fail to process request http://10.10.5.9:9000/api/plugins/update
org.sonar.api.utils.SonarException: Fail to download the plugin (java, version 4.4) from https://sonarsource.bintray.com/Distribution/sonar-java-plugin/sonar-java-plugin-4.4.0.8066.jar (error is : Source '/home/azrlnx04/sonar/sonarqube-6.1/extensions/downloads/sonar-java-plugin-4.4.0.8066.jar.tmp' does not exist)
at org.sonar.server.plugins.PluginDownloader.download(PluginDownloader.java:) ~[sonar-server-6.1.jar:na]
at org.sonar.server.plugins.ws.UpdateAction.handle(UpdateAction.java:) ~[sonar-server-6.1.jar:na]
at org.sonar.server.ws.WebServiceEngine.execute(WebServiceEngine.java:) ~[sonar-server-6.1.jar:na]
at org.sonar.server.ws.WebServiceFilter.doFilter(WebServiceFilter.java:) [sonar-server-6.1.jar:na]
at org.sonar.server.platform.web.MasterServletFilter$GodFilterChain.doFilter(MasterServletFilter.java:) [sonar-server-6.1.jar:na]
at org.sonar.server.platform.web.MasterServletFilter.doFilter(MasterServletFilter.java:) [sonar-server-6.1.jar:na]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:) [tomcat-embed-core-8.0..jar:8.0.]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:) [tomcat-embed-core-8.0..jar:8.0.]
at org.sonar.server.user.UserSessionFilter.doFilter(UserSessionFilter.java:) [sonar-server-6.1.jar:na]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:) [tomcat-embed-core-8.0..jar:8.0.]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:) [tomcat-embed-core-8.0..jar:8.0.]
at org.sonar.server.platform.web.RoutesFilter.doFilter(RoutesFilter.java:) [sonar-server-6.1.jar:na]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:) [tomcat-embed-core-8.0..jar:8.0.]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:) [tomcat-embed-core-8.0..jar:8.0.]
at org.sonar.server.platform.web.RootFilter.doFilter(RootFilter.java:) [sonar-server-6.1.jar:na]
at org.sonar.server.platform.web.RootFilter.doFilter(RootFilter.java:) [sonar-server-6.1.jar:na]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:) [tomcat-embed-core-8.0..jar:8.0.]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:) [tomcat-embed-core-8.0..jar:8.0.]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:) [tomcat-embed-core-8.0..jar:8.0.]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:) [tomcat-embed-core-8.0..jar:8.0.]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:) [tomcat-embed-core-8.0..jar:8.0.]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:) [tomcat-embed-core-8.0..jar:8.0.]
at ch.qos.logback.access.tomcat.LogbackValve.invoke(LogbackValve.java:) [logback-access-1.1..jar:na]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:) [tomcat-embed-core-8.0..jar:8.0.]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:) [tomcat-embed-core-8.0..jar:8.0.]
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:) [tomcat-embed-core-8.0..jar:8.0.]
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:) [tomcat-embed-core-8.0..jar:8.0.]
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:) [tomcat-embed-core-8.0..jar:8.0.]
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:) [tomcat-embed-core-8.0..jar:8.0.]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:) [na:1.8.0_111]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:) [na:1.8.0_111]
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:) [tomcat-embed-core-8.0..jar:8.0.]
at java.lang.Thread.run(Thread.java:) [na:1.8.0_111]
Caused by: java.io.FileNotFoundException: Source '/home/azrlnx04/sonar/sonarqube-6.1/extensions/downloads/sonar-java-plugin-4.4.0.8066.jar.tmp' does not exist
at org.apache.commons.io.FileUtils.copyFile(FileUtils.java:) ~[commons-io-2.4.jar:2.4]
at org.apache.commons.io.FileUtils.copyFile(FileUtils.java:) ~[commons-io-2.4.jar:2.4]
at org.sonar.server.plugins.PluginDownloader.downloadRelease(PluginDownloader.java:) ~[sonar-server-6.1.jar:na]
at org.sonar.server.plugins.PluginDownloader.download(PluginDownloader.java:) ~[sonar-server-6.1.jar:na]
... common frames omitted
2017.01. :: INFO web[][o.s.s.p.w.RestartAction] SonarQube restart requested by admin
2017.01. :: INFO app[][o.s.p.m.Monitor] Process [web] requested restart
2017.01. :: INFO app[][o.s.p.m.Monitor] Process[ce] is stopping
2017.01. :: INFO ce[][o.s.p.StopWatcher] Stopping process
2017.01. :: INFO ce[][o.s.ce.app.CeServer] Compute Engine shutting down...
2017.01. :: INFO app[][o.s.p.m.Monitor] Process[ce] is stopped
2017.01. :: INFO app[][o.s.p.m.Monitor] Process[web] is stopping
2017.01. :: INFO web[][o.s.p.StopWatcher] Stopping process
2017.01. :: INFO web[][o.a.c.h.Http11NioProtocol] Pausing ProtocolHandler ["http-nio-9000"]
2017.01. :: INFO web[][o.s.s.n.NotificationDaemon] Notification service stopped
2017.01. :: WARN web[][o.a.c.l.WebappClassLoaderBase] The web application [ROOT] appears to have started a thread named [Abandoned connection cleanup thread] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
java.lang.Object.wait(Native Method)
java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:)
com.mysql.jdbc.AbandonedConnectionCleanupThread.run(AbandonedConnectionCleanupThread.java:)
2017.01. :: INFO web[][o.a.c.h.Http11NioProtocol] Stopping ProtocolHandler ["http-nio-9000"]
2017.01. :: INFO web[][o.a.c.h.Http11NioProtocol] Destroying ProtocolHandler ["http-nio-9000"]
2017.01. :: INFO web[][o.s.s.a.TomcatAccessLog] Web server is stopped
2017.01. :: INFO app[][o.s.p.m.Monitor] Process[web] is stopped
2017.01. :: INFO app[][o.s.p.m.Monitor] Process[es] is stopping
2017.01. :: INFO es[][o.s.p.StopWatcher] Stopping process
2017.01. :: INFO es[][o.elasticsearch.node] [sonarqube] stopping ...
2017.01. :: INFO es[][o.elasticsearch.node] [sonarqube] stopped
2017.01. :: INFO es[][o.elasticsearch.node] [sonarqube] closing ...
2017.01. :: INFO es[][o.elasticsearch.node] [sonarqube] closed
2017.01. :: INFO app[][o.s.p.m.Monitor] Process[es] is stopped
2017.01. :: INFO app[][o.s.a.AppFileSystem] Cleaning or creating temp directory /home/azrlnx04/sonar/sonarqube-6.1/temp
2017.01. :: INFO app[][o.s.p.m.JavaProcessLauncher] Launch process[es]: /usr/java/jdk1..0_111/jre/bin/java -Djava.awt.headless=true -Xmx1G -Xms256m -Xss256k -Djna.nosys=true -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction= -XX:+UseCMSInitiatingOccupancyOnly -XX:+HeapDumpOnOutOfMemoryError -Djava.io.tmpdir=/home/azrlnx04/sonar/sonarqube-6.1/temp -javaagent:/usr/java/jdk1..0_111/jre/lib/management-agent.jar -cp ./lib/common/*:./lib/search/* org.sonar.search.SearchServer /home/azrlnx04/sonar/sonarqube-6.1/temp/sq-process200122875469733762properties
2017.01.19 09:11:28 INFO es[][o.s.p.ProcessEntryPoint] Starting es
2017.01.19 09:11:28 INFO es[][o.s.s.EsSettings] Elasticsearch listening on /127.0.0.1:9001
2017.01.19 09:11:28 INFO es[][o.elasticsearch.node] [sonarqube] version[2.3.3], pid[46460], build[218bdf1/2016-05-17T15:40:04Z]
2017.01.19 09:11:28 INFO es[][o.elasticsearch.node] [sonarqube] initializing ...
2017.01.19 09:11:28 INFO es[][o.e.plugins] [sonarqube] modules [], plugins [], sites []
2017.01.19 09:11:28 INFO es[][o.elasticsearch.env] [sonarqube] using [1] data paths, mounts [[/ (rootfs)]], net usable_space [25.5gb], net total_space [29.9gb], spins? [unknown], types [rootfs]
2017.01.19 09:11:28 INFO es[][o.elasticsearch.env] [sonarqube] heap size [1007.3mb], compressed ordinary object pointers [true]
2017.01.19 09:11:28 WARN es[][o.elasticsearch.env] [sonarqube] max file descriptors [4096] for elasticsearch process likely too low, consider increasing to at least [65536]
2017.01.19 09:11:32 INFO es[][o.elasticsearch.node] [sonarqube] initialized
2017.01.19 09:11:32 INFO es[][o.elasticsearch.node] [sonarqube] starting ...
2017.01.19 09:11:32 INFO es[][o.e.transport] [sonarqube] publish_address {127.0.0.1:9001}, bound_addresses {127.0.0.1:9001}
2017.01.19 09:11:32 INFO es[][o.e.discovery] [sonarqube] sonarqube/a7_9U6plQ-OP56_1wxxEvA
2017.01.19 09:11:36 INFO es[][o.e.cluster.service] [sonarqube] new_master {sonarqube}{a7_9U6plQ-OP56_1wxxEvA}{127.0.0.1}{127.0.0.1:9001}{rack_id=sonarqube, master=true}, reason: zen-disco-join(elected_as_master, [0] joins received)
2017.01.19 09:11:36 INFO es[][o.elasticsearch.node] [sonarqube] started
2017.01.19 09:11:36 INFO es[][o.e.gateway] [sonarqube] recovered [5] indices into cluster_state
2017.01.19 09:11:38 INFO es[][o.e.c.r.allocation] [sonarqube] Cluster health status changed from [RED] to [GREEN] (reason: [shards started [[rules][0], [tests][4], [tests][4], [rules][0]] ...]).
2017.01.19 09:11:39 INFO app[][o.s.p.m.Monitor] Process[es] is up
2017.01.19 09:11:39 INFO app[][o.s.p.m.JavaProcessLauncher] Launch process[web]: /usr/java/jdk1.8.0_111/jre/bin/java -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djruby.management.enabled=false -Djruby.compile.invokedynamic=false -Xmx512m -Xms128m -XX:+HeapDumpOnOutOfMemoryError -Djava.io.tmpdir=/home/azrlnx04/sonar/sonarqube-6.1/temp -javaagent:/usr/java/jdk1.8.0_111/jre/lib/management-agent.jar -cp ./lib/common/*:./lib/server/*:/home/azrlnx04/sonar/sonarqube-6.1/lib/jdbc/mysql/mysql-connector-java-5.1.39.jar org.sonar.server.app.WebServer /home/azrlnx04/sonar/sonarqube-6.1/temp/sq-process8182427158650393272properties
2017.01.19 09:11:40 INFO web[][o.s.p.ProcessEntryPoint] Starting web
2017.01.19 09:11:41 INFO web[][o.s.s.a.TomcatContexts] Webapp directory: /home/azrlnx04/sonar/sonarqube-6.1/web
2017.01.19 09:11:42 INFO web[][o.a.c.h.Http11NioProtocol] Initializing ProtocolHandler ["http-nio-9000"]
2017.01.19 09:11:42 INFO web[][o.a.t.u.n.NioSelectorPool] Using a shared selector for servlet write/read
2017.01.19 09:11:43 INFO web[][o.e.plugins] [Serpentina] modules [], plugins [], sites []
2017.01.19 09:11:44 INFO web[][o.s.s.e.EsClientProvider] Connected to local Elasticsearch: [127.0.0.1:9001]
2017.01.19 09:11:44 INFO web[][o.s.s.p.LogServerVersion] SonarQube Server / 6.1 / dc148a71a1c184ccad588b66251980c994879dff
2017.01.19 09:11:44 INFO web[][o.sonar.db.Database] Create JDBC data source for jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformance&autoReconnect=true&useSSL=false
2017.01.19 09:11:47 INFO web[][o.s.s.p.ServerFileSystemImpl] SonarQube home: /home/azrlnx04/sonar/sonarqube-6.1
2017.01.19 09:11:48 INFO web[][o.s.s.p.ServerPluginRepository] Plugin JavaScript [javascript] updated to version 2.19.0.3866
2017.01.19 09:11:48 INFO web[][o.s.s.p.ServerPluginRepository] Plugin Java [java] updated to version 4.4.0.8066
2017.01.19 09:11:48 INFO web[][o.s.s.p.ServerPluginRepository] Plugin C# [csharp] updated to version 5.5.2.537
2017.01.19 09:11:48 INFO web[][o.s.s.p.ServerPluginRepository] Plugin CSS / Less [css] updated to version 2.4
2017.01.19 09:11:48 INFO web[][o.s.s.p.ServerPluginRepository] Deploy plugin C# / 5.5.2.537 / a4f663cf02cdcc88c221aaae7e7156fa4d176c07
2017.01.19 09:11:48 INFO web[][o.s.s.p.ServerPluginRepository] Deploy plugin CSS / Less / 2.4 / 5ac876d69f61a2c5fce597f3243bae45b8cd8f5f
2017.01.19 09:11:48 INFO web[][o.s.s.p.ServerPluginRepository] Deploy plugin Findbugs / 3.4.3 /
2017.01.19 09:11:48 INFO web[][o.s.s.p.ServerPluginRepository] Deploy plugin FxCop / 1.0
2017.01.19 09:11:48 INFO web[][o.s.s.p.ServerPluginRepository] Deploy plugin Git / 1.2 / a713dd64daf8719ba4e7f551f9a1966c62690c17
2017.01.19 09:11:48 INFO web[][o.s.s.p.ServerPluginRepository] Deploy plugin GitHub / 1.3 / a329b577298d259741a3098a80651a59fa180a2e
2017.01.19 09:11:48 INFO web[][o.s.s.p.ServerPluginRepository] Deploy plugin Java / 4.4.0.8066 / 2703cce280bb210cffe8f8ac918df5f2c4d770f2
2017.01.19 09:11:48 INFO web[][o.s.s.p.ServerPluginRepository] Deploy plugin JavaScript / 2.19.0.3866 / 97832288f366dae27584956414242e18dc96bca3
2017.01.19 09:11:48 INFO web[][o.s.s.p.ServerPluginRepository] Deploy plugin SVN / 1.3 / aff503d48bc77b07c2b62abf93249d0a20bd355c
2017.01.19 09:11:48 INFO web[][o.s.s.p.ServerPluginRepository] Deploy plugin TFVC / 2.1.2 / 93aaaec5d7246e257dc6d7ebb6b66f5e2ece2a83
2017.01.19 09:11:49 ERROR web[][o.a.c.c.C.[.[.[/]] Exception sending context initialized event to listener instance of class org.sonar.server.platform.web.PlatformServletContextListener
java.lang.IllegalStateException: Fail to unzip plugin [java] /home/azrlnx04/sonar/sonarqube-6.1/extensions/plugins/sonar-java-plugin-4.4.0.8066.jar to /home/azrlnx04/sonar/sonarqube-6.1/data/web/deploy/plugins/java
at org.sonar.server.plugins.ServerPluginJarExploder.explode(ServerPluginJarExploder.java:62) ~[sonar-server-6.1.jar:na]
at org.sonar.core.platform.PluginLoader.defineClassloaders(PluginLoader.java:91) ~[sonar-core-6.1.jar:na]
at org.sonar.core.platform.PluginLoader.load(PluginLoader.java:71) ~[sonar-core-6.1.jar:na]
at org.sonar.server.plugins.ServerPluginRepository.loadInstances(ServerPluginRepository.java:288) ~[sonar-server-6.1.jar:na]
at org.sonar.server.plugins.ServerPluginRepository.start(ServerPluginRepository.java:117) ~[sonar-server-6.1.jar:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_111]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_111]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_111]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_111]
at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.invokeMethod(ReflectionLifecycleStrategy.java:110) ~[picocontainer-2.15.jar:na]
at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.start(ReflectionLifecycleStrategy.java:89) ~[picocontainer-2.15.jar:na]
at org.sonar.core.platform.ComponentContainer$1.start(ComponentContainer.java:320) ~[sonar-core-6.1.jar:na]
at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.start(AbstractInjectionFactory.java:84) ~[picocontainer-2.15.jar:na]
at org.picocontainer.behaviors.AbstractBehavior.start(AbstractBehavior.java:169) ~[picocontainer-2.15.jar:na]
at org.picocontainer.behaviors.Stored$RealComponentLifecycle.start(Stored.java:132) ~[picocontainer-2.15.jar:na]
at org.picocontainer.behaviors.Stored.start(Stored.java:110) ~[picocontainer-2.15.jar:na]
at org.picocontainer.DefaultPicoContainer.potentiallyStartAdapter(DefaultPicoContainer.java:1016) ~[picocontainer-2.15.jar:na]
at org.picocontainer.DefaultPicoContainer.startAdapters(DefaultPicoContainer.java:1009) ~[picocontainer-2.15.jar:na]
at org.picocontainer.DefaultPicoContainer.start(DefaultPicoContainer.java:767) ~[picocontainer-2.15.jar:na]
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:141) ~[sonar-core-6.1.jar:na]
at org.sonar.server.platform.platformlevel.PlatformLevel.start(PlatformLevel.java:88) ~[sonar-server-6.1.jar:na]
at org.sonar.server.platform.Platform.start(Platform.java:216) ~[sonar-server-6.1.jar:na]
at org.sonar.server.platform.Platform.startLevel2Container(Platform.java:182) ~[sonar-server-6.1.jar:na]
at org.sonar.server.platform.Platform.init(Platform.java:91) ~[sonar-server-6.1.jar:na]
at org.sonar.server.platform.web.PlatformServletContextListener.contextInitialized(PlatformServletContextListener.java:44) ~[sonar-server-6.1.jar:na]
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4812) [tomcat-embed-core-8.0.32.jar:8.0.32]
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5255) [tomcat-embed-core-8.0.32.jar:8.0.32]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147) [tomcat-embed-core-8.0.32.jar:8.0.32]
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408) [tomcat-embed-core-8.0.32.jar:8.0.32]
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398) [tomcat-embed-core-8.0.32.jar:8.0.32]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_111]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_111]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_111]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_111]
Caused by: java.io.EOFException: Unexpected end of ZLIB input stream
at java.util.zip.ZipFile$ZipFileInflaterInputStream.fill(ZipFile.java:417) ~[na:1.8.0_111]
at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:158) ~[na:1.8.0_111]
at java.io.FilterInputStream.read(FilterInputStream.java:107) ~[na:1.8.0_111]
at org.sonar.api.internal.apachecommons.io.IOUtils.copyLarge(IOUtils.java:1792) ~[sonar-plugin-api-6.1.jar:na]
at org.sonar.api.internal.apachecommons.io.IOUtils.copyLarge(IOUtils.java:1769) ~[sonar-plugin-api-6.1.jar:na]
at org.sonar.api.internal.apachecommons.io.IOUtils.copy(IOUtils.java:1744) ~[sonar-plugin-api-6.1.jar:na]
at org.sonar.api.utils.ZipUtils.copy(ZipUtils.java:147) ~[sonar-plugin-api-6.1.jar:na]
at org.sonar.api.utils.ZipUtils.unzip(ZipUtils.java:121) ~[sonar-plugin-api-6.1.jar:na]
at org.sonar.server.plugins.ServerPluginJarExploder.explode(ServerPluginJarExploder.java:59) ~[sonar-server-6.1.jar:na]
... 33 common frames omitted
2017.01.19 09:11:49 ERROR web[][o.a.c.c.StandardContext] One or more listeners failed to start. Full details will be found in the appropriate container log file
2017.01.19 09:11:49 ERROR web[][o.a.c.c.StandardContext] Context [] startup failed due to previous errors
2017.01.19 09:11:49 WARN web[][o.a.c.l.WebappClassLoaderBase] The web application [ROOT] appears to have started a thread named [Abandoned connection cleanup thread] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
java.lang.Object.wait(Native Method)
java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:143)
com.mysql.jdbc.AbandonedConnectionCleanupThread.run(AbandonedConnectionCleanupThread.java:43)
2017.01.19 09:11:49 INFO web[][o.a.c.h.Http11NioProtocol] Starting ProtocolHandler ["http-nio-9000"]
2017.01.19 09:11:49 INFO web[][o.s.s.a.TomcatAccessLog] Web server is started
2017.01.19 09:11:49 INFO web[][o.s.s.a.EmbeddedTomcat] HTTP connector enabled on port 9000
2017.01.19 09:11:49 WARN web[][o.s.p.ProcessEntryPoint] Fail to start web
java.lang.IllegalStateException: Webapp did not start
at org.sonar.server.app.EmbeddedTomcat.isUp(EmbeddedTomcat.java:84) ~[sonar-server-6.1.jar:na]
at org.sonar.server.app.WebServer.isUp(WebServer.java:46) [sonar-server-6.1.jar:na]
at org.sonar.process.ProcessEntryPoint.launch(ProcessEntryPoint.java:105) ~[sonar-process-6.1.jar:na]
at org.sonar.server.app.WebServer.main(WebServer.java:67) [sonar-server-6.1.jar:na]
2017.01.19 09:11:49 INFO web[][o.a.c.h.Http11NioProtocol] Pausing ProtocolHandler ["http-nio-9000"]
2017.01.19 09:11:50 INFO web[][o.a.c.h.Http11NioProtocol] Stopping ProtocolHandler ["http-nio-9000"]
2017.01.19 09:11:50 INFO web[][o.a.c.h.Http11NioProtocol] Destroying ProtocolHandler ["http-nio-9000"]
2017.01.19 09:11:50 INFO web[][o.s.s.a.TomcatAccessLog] Web server is stopped
2017.01.19 09:11:50 INFO app[][o.s.p.m.Monitor] Process[es] is stopping
2017.01.19 09:11:51 INFO es[][o.s.p.StopWatcher] Stopping process
2017.01.19 09:11:51 INFO es[][o.elasticsearch.node] [sonarqube] stopping ...
2017.01.19 09:11:51 INFO es[][o.elasticsearch.node] [sonarqube] stopped
2017.01.19 09:11:51 INFO es[][o.elasticsearch.node] [sonarqube] closing ...
2017.01.19 09:11:51 INFO es[][o.elasticsearch.node] [sonarqube] closed
2017.01.19 09:11:51 INFO app[][o.s.p.m.Monitor] Process[es] is stopped
<-- Wrapper Stopped
--> Wrapper Started as Daemon
Launching a JVM...
Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
Copyright 1999-2006 Tanuki Software, Inc. All Rights Reserved.
问题出在其中的Java插件,原因可能是没有下载完成Java插件,导致解压失败,从而导致整个sonarQube启动失败。
尝试办法1:将Java插件先改名,再重新启动sonarQube
结果1:sonarQube还是认到原有下载未完成的Java插件,无法解决该问题
尝试办法2:将Java插件完全删除,再重新启动sonarQube
结果2:sonarQube没有插件还是无法启动sonarQube,启动几秒后服务还是会死掉
尝试办法3:从windows系统下载Java插件最新版本,并复制至Linux机器上,再重新启动sonarQube
未知结果3:因为在复制插件文件的过程中,老是会中断,导致文件复制老是失败,就放弃了该方法
尝试办法4:将原sonarQube文件改名,并将原sonarQube压缩包重新解压缩生成sonarQube文件夹,只是将原有的配置文件替换新的配置文件
结果4:因为新的sonarQube是使用原来的文件夹名称,原来已经进行过相应的配置,确实能够解决该问题,但不是最好的方法,个人认为比较好的方法就是使用办法3
结论:当插件更新时发生了错误,应该与Linux机器没有太大关系,需要的是及时查看日志文件,查看错误
Linux安装sonarQube的更多相关文章
- Linux下SonarQube代码质量平台的安装和使用方法
Sonar简介: Sonar是一个用于代码质量管理的开源平台,用于管理源代码的质量,可以从七个维度检测代码质量 通过插件形式,可以支持包括java,C#,C/C++,PL/SQL,Cobol,Java ...
- SonarQube系列一、Linux安装与部署
[前言] 随着项目团队规模日益壮大,项目代码量也越来越多.且不说团队成员编码水平层次不齐,即便是老手,也难免因为代码量的增加和任务的繁重而忽略代码的质量,最终的问题便是bug的增多和代码债务的堆积.因 ...
- sonarqube linux安装总结,集成jenkins
第一条建议,安装sonarqube首先看好版本号,不同版本号的安装配置可能不同,如果你想走捷径,看官网对应发布的安装使用教程.https://www.sonarqube.org/downloads/ ...
- SonarQube学习(一)- 使用Docker安装SonarQube(亲测可用)
一.前言 不得不吐槽下,现在的博客写的真太扯淡了,就网上写的使用docker安装SonarQube而言,搜到十篇文章,最少9篇照着操作配置都不可用,卡在SonarQube无法启动.自然,我也是被折磨的 ...
- 安装Sonarqube到CentOS(YUM)
SonarQube 是一个用于代码质量管理的开源平台,用于管理源代码的质量. 通过插件形式,可以支持包括 java, C#, C/C++, PL/SQL, Cobol, JavaScrip, Groo ...
- 搜狗输入法linux安装 以及 12个依赖包下载链接分享
搜狗输入法linux安装版,先安装各种依赖包,大概12个依赖,可能中途还需要其他依赖,可以效仿解决依赖问题.如图这12个文件要是手动点击下载,那也太笨点了,我们要用shell命令批量下载.命令如下:w ...
- linux安装php
接上篇:linux安装apache 一.安装php 先安装libxml2库 [root@ctxsdhy package]# yum -y install libxml2-devel 最新地址在:htt ...
- linux安装oracle11g
准备oracle安装文件 Oracle11gR2包含两个文件linux_11gR2_database_1of2.zip和linux_11gR2_database_2of2.zip,将这两个文件通过SS ...
- TODO:Linux安装PHP MongoDB驱动
TODO:Linux安装PHP MongoDB驱动 PHP利于学习,使用广泛,主要适用于Web开发领域. MongoDB的主要目标是在键/值存储方式(提供了高性能和高度伸缩性)以及传统的RDBMS系统 ...
随机推荐
- JSONP技术原理及实现
跨域问题一直是前端中常见的问题,每当说到跨域,第一浮现的技术必然就是JSONP JSONP在我的理解,它并不是ajax,它是在文档中插入一个script标签,创建_callback方法,通过服务器配合 ...
- angular 跳转页面时传参
首先,你需要已经配置过你的rout,比如: $stateProvider .state('firstPage',{ url:'/Page/firstPage', templateUrl: 'Page/ ...
- js 默认的参数、可变的参数、变量作用域
可以通过arguments对象来实现可变的参数 在函数代码中,使用特殊对象 arguments,开发者无需明确指出参数名,就能访问它们. arguments是一个数组对象,可以通过下标来实别参数的位置 ...
- Ajax请求ashx一般处理程序实现文件下载
具体功能为,在文件数据列表中选择一行,点击表格上方的下载按钮,下载文件.由于表格中不包含文件路径,只能取到在数据库表中的ID,所以具体实现就是这样:首先点击一行,获取点击的一行数据的ID,用Ajax传 ...
- 为什么这么多Python框架
原文:http://bitworking.org/news/Why_so_many_Python_web_frameworks BitWorking This is Joe Gregorio's wr ...
- bzoj 1051: [HAOI2006]受欢迎的牛 tarjan缩点
1051: [HAOI2006]受欢迎的牛 Time Limit: 10 Sec Memory Limit: 162 MBSubmit: 2092 Solved: 1096[Submit][Sta ...
- BZOJ 3122 随机数生成器
http://www.lydsy.com/JudgeOnline/problem.php?id=3122 题意:给出p,a,b,x1,t 已知xn=a*xn-1+b%p,求最小的n令xn=t 首先,若 ...
- 利用IKVM在C#中调Java程序
原文转自:http://luanxiyuan.iteye.com/blog/1937081 IKVM.NET是一个针对Mono和微软.net框架的java实现,其设计目的是在.NET平台上运行java ...
- 利用 Apache Synapse 模拟 Web 服务
Apache Synapse 是一个简单.轻量级的高性能企业服务总线 (ESB),它是在 Apache Software Foundation 的 Apache License Version 2.0 ...
- leetcode面试准备:Count Complete Tree Nodes
1 题目 Given a complete binary tree, count the number of nodes. In a complete binary tree every level, ...