Sonarqube从5.6.3升级到6.7

时间:2017-12-07 11:05:39

标签: sonarqube

我正在尝试将我们的环境从5.6.3(LTS)升级到6.7(LTS)版本。它是我们目前正在使用的H2数据库(POC),因此实际数据不会妨碍。我根据升级要求进行了所有更改。

1)插件被移动到新实例

2)H2 db与部分实际数据相同

3)sonar.conf和wrapper.conf已根据需要进行了更改。

当我尝试在6.7版本上启动服务时。我们在sonar.properties中提到了以下值。

sonar.search.javaOpts=-Xmx1G -Xms256m -Xss256k -Djava.net.preferIPv4Stack=true \
-XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 \
  -XX:+UseCMSInitiatingOccupancyOnly -XX:+HeapDumpOnOutOfMemoryError

当我给出6.7的上述值时,我得到如下问题:

jvm 1    | org.sonar.process.MessageException: a JVM option can't overwrite mand
atory JVM options. The following JVM options defined by property 'sonar.search.j
avaOpts' are invalid: -Xss256k overwrites -Xss1m
jvm 1    | 2017.12.07 10:53:38 INFO  app[][o.s.a.SchedulerImpl] Process [es] is
stopped
jvm 1    | 2017.12.07 10:53:38 INFO  app[][o.s.a.SchedulerImpl] SonarQube is sto
pped
jvm 1    |
jvm 1    | WrapperSimpleApp: Encountered an error running main: org.sonar.proces
s.MessageException: a JVM option can't overwrite mandatory JVM options. The foll
owing JVM options defined by property 'sonar.search.javaOpts' are invalid: -Xss2
56k overwrites -Xss1m
jvm 1    | org.sonar.process.MessageException: a JVM option can't overwrite mand
atory JVM options. The following JVM options defined by property 'sonar.search.j
avaOpts' are invalid: -Xss256k overwrites -Xss1m

当我没有给出价值时,我会得到以下问题

    2017.12.07 10:04:39 INFO  app[][o.s.a.AppFileSystem] Cleaning or creating temp directory E:\Apps\sonarqube-6.7\temp
2017.12.07 10:04:39 INFO  app[][o.s.a.es.EsSettings] Elasticsearch listening on /127.0.0.1:9001
2017.12.07 10:04:39 INFO  app[][o.s.a.p.ProcessLauncherImpl] Launch process[[key='es', ipcIndex=1, logFilenamePrefix=es]] from [E:\Apps\sonarqube-6.7\elasticsearch]: E:\Apps\JRE\8u91\jre\bin\java -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+AlwaysPreTouch -server -Xss1m -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djna.nosys=true -Djdk.io.permissionsUseCanonicalPath=true -Dio.netty.noUnsafe=true -Dio.netty.noKeySetOptimization=true -Dio.netty.recycler.maxCapacityPerThread=0 -Dlog4j.shutdownHookEnabled=false -Dlog4j2.disable.jmx=true -Dlog4j.skipJansi=true -Xms512m -Xmx512m -XX:+HeapDumpOnOutOfMemoryError -Delasticsearch -Des.path.home=E:\Apps\sonarqube-6.7\elasticsearch -cp lib/* org.elasticsearch.bootstrap.Elasticsearch -Epath.conf=E:\Apps\sonarqube-6.7\temp\conf\es
2017.12.07 10:04:39 INFO  app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
2017.12.07 10:04:41 INFO  app[][o.e.p.PluginsService] no modules loaded
2017.12.07 10:04:41 INFO  app[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
2017.12.07 10:04:41 WARN  app[][o.s.a.p.AbstractProcessMonitor] Process exited with exit value [es]: 1

如果我遗漏了某些内容,请告诉我

谢谢&此致

1 个答案:

答案 0 :(得分:6)

首先,H2数据库的迁移不支持:迁移不会在H2数据库中触发。 您必须使用专用数据库(Postgresql,Oracle,MySQL或Microsoft SQL Server)来触发迁移。

无论如何,SonarQube没有启动,因为你被覆盖了一个它不再被授权的财产。要修复它,只需从sonar.properties中删除属性[HttpPost] public HttpResponseMessage Default() { try { NameValueCollection collection = Request.Content.IsFormData() ? Request.Content.ReadAsFormDataAsync().Result : GetCollection(Request.Content.ReadAsAsync<IDictionary<string, object>>().Result); var parameters = ServiceAgentParameters.From(collection); var agent = new ScriptingAgentClient(); var response = agent.Run(parameters); if (response.Error) return Request.CreateResponse(HttpStatusCode.BadRequest, new { ErrorMessage = response.ErrorMessage, Exception = response.Exception }); if (response.Data != null && response.Data.Count == 1) //result.Data is List<byte[]> { //TODO: use the right Serializer var resultString = Encoding.UTF8.GetString(result.Data[0]); var serializer = new JavaScriptSerializer(); var dict = serializer.Deserialize<Dictionary<string, string>>(resultString); return Request.CreateResponse(HttpStatusCode.OK, dict); } return Request.CreateResponse(HttpStatusCode.BadRequest, new { ErrorMessage = "Unknown error" }); } catch (Exception ex) { Logger.Error("Error handling request", ex); return Request.CreateResponse(HttpStatusCode.BadRequest, new { ErrorMessage = ex.Unwrap().Message }); } } 上的-Xss256k。