SonarQube升级

本文档详细介绍了SonarQube的升级步骤,包括阅读更新日志、停止服务、下载新版本、迁移配置、拷贝插件、处理JDBC驱动以及备份数据库。特别指出,在升级过程中,需要手动管理Java插件的更新,并确保数据库中所有表使用InnoDB引擎。
摘要由CSDN通过智能技术生成

1.阅读SonarQube更新日志:

http://docs.codehaus.org/display/SONAR/Upgrading#Upgrading-ReleaseUpgradeNotes


2.停止SonarQube服务:

bin/<SYSTEM>/sonar stop

3.下载新版本的SonarQube及SonarQube Runner,并解压至新的目录NEW_SONARQUBE_HOME

http://www.sonarqube.org/downloads/


4.更新NEW_SONARQUBE_HOME/conf下sonar.properties与wrapper.conf文件里的内容,文件内容参照OLD_SONARQUBE_HOME/conf下相应配置文件的内容,但切记千万不要直接将原来的配置文件拷贝覆盖,因为新的sonar.properties与wrapper.conf文件还包含新版本的一些配置项。


5.拷贝OLD_SONARQUBE_HOME/extensions/plugins中的插件至NEW_SONARQUBE_HOME/extensions/plugins


6.如果使用的是自定义的JDBC驱动,将其拷贝至NEW_SONARQUBE_HOME/extensions/jdbc-driver/<dialect>


7.备份数据库:MySQL:

/usr/local/mysql# mysqldump -u sonar -p sonar>sonar.sql
8.启动SonarQube:
bin/<SYSTEM>/sonar stop
9.用浏览器访问http://localhost:9000/setup (注意:不再是直接访问localhost:9000),根据提示升级

10.根据实际情况修改系统中或持续集成中所有涉及SONAR_HOME和SONAR_RUNNER_HOME环境变量

11.使用新版SonarQube Runner分析项目


可能遇到的问题:
一、分析项目时报插件兼容性错误
解决:登录http://localhost:9000 WEB中配置——更新中心,将plugins都更新至最新版本
注:更新Java Plugin时将会有个警告,
  • Version 2.4 moves Java from being an "ecosystem" of multiple plugins to a single, stand-along plugin that encompasses most of the functionality formerly contained in the ecosystem. Unfortunately, SonarQube's update center cannot handle the switch gracefully. You may use the update center to download the new version of the plugin. However,you must manually remove the Surefire, JaCoCo, and Squid for Java plugins from $SONARQUBE_HOME/extensions/plugins.
因此,在更新中心中下载新版本Java Plugin后,需要将 $SONARQUBE_HOME/extensions/plugins下老的Surefire, JaCoCo, and Squid插件jar包删除,并重启服务

二、Impossible to upgrade database
Migration failed: An error has occurred, all later migrations canceled: ActiveRecord::JDBCError: Specified key was too long; max key length is 1000 bytes: CREATE UNIQUE INDEX `rules_repo_key` ON `rules` (`plugin_name`, `plugin_rule_key`) .
Please check logs.

原因:Sonar在MySQL中对表建立索引时,key的长度超过1000 bytes了,由于MySQL使用MyISAM engine时会有key长度
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值