Sonar 无法连接到 mysql on mac EI Caption

Sonar fails to connect to mysql on mac EI Caption

我的声纳配置如下所示:

sonar.jdbc.username=sonar
sonar.jdbc.password=sonar
sonar.jdbc.url=jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncod$
sonar.jdbc.driverClassName=com.mysql.jdbc.Driver
sonar.jdbc.validationQuery=select 1

Mysql 服务器成功 运行.

我已经开始声纳了:

./sonar.sh start

控制台看起来像:

Starting SonarQube...
Started SonarQube.

但是http://localhost:9000给我如图所示的错误:

声纳与 mysql 的连接是否缺少任何东西?

这是我来自 sonar.logs 的日志:

--> 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.

2015.11.21 17:03:21 INFO  app[o.s.p.m.JavaProcessLauncher] Launch process[search]: /Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home/jre/bin/java -Djava.awt.headless=true -Xmx1G -Xms256m -Xss256k -Djava.net.preferIPv4Stack=true -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+HeapDumpOnOutOfMemoryError -Djava.io.tmpdir=/usr/local/Cellar/sonar/5.2/libexec/temp -cp ./lib/common/*:./lib/search/* org.sonar.search.SearchServer /var/folders/cg/fg6j4gpd2jvg76y22fhnr_f00000gn/T/sq-process4013461511666170063properties
2015.11.21 17:03:21 INFO   es[o.s.p.ProcessEntryPoint]  Starting search
2015.11.21 17:03:21 INFO   es[o.s.s.SearchSettings]  Elasticsearch listening on 127.0.0.1:9001
2015.11.21 17:03:22 INFO   es[o.elasticsearch.node]  [sonar-1448107401111] version[1.7.2], pid[1741], build[e43676b/2015-09-14T09:49:53Z]
2015.11.21 17:03:22 INFO   es[o.elasticsearch.node]  [sonar-1448107401111] initializing ...
2015.11.21 17:03:22 INFO   es[o.e.plugins]  [sonar-1448107401111] loaded [], sites []
2015.11.21 17:03:22 INFO   es[o.elasticsearch.env]  [sonar-1448107401111] using [1] data paths, mounts [[/ (/dev/disk0s2)]], net usable_space [278.3gb], net total_space [371.8gb], types [hfs]
2015.11.21 17:03:23 WARN   es[o.e.bootstrap]  JNA not found. native methods will be disabled.
2015.11.21 17:03:23 INFO   es[o.elasticsearch.node]  [sonar-1448107401111] initialized
2015.11.21 17:03:23 INFO   es[o.elasticsearch.node]  [sonar-1448107401111] starting ...
2015.11.21 17:03:23 INFO   es[o.e.transport]  [sonar-1448107401111] bound_address {inet[/127.0.0.1:9001]}, publish_address {inet[/127.0.0.1:9001]}
2015.11.21 17:03:23 INFO   es[o.e.discovery]  [sonar-1448107401111] sonarqube/wE-3adbvTRKj14FKn6iMIA
2015.11.21 17:03:26 INFO   es[o.e.cluster.service]  [sonar-1448107401111] new_master [sonar-1448107401111][wE-3adbvTRKj14FKn6iMIA][Muhammads-MBP][inet[/127.0.0.1:9001]]{rack_id=sonar-1448107401111}, reason: zen-disco-join (elected_as_master)
2015.11.21 17:03:26 INFO   es[o.elasticsearch.node]  [sonar-1448107401111] started
2015.11.21 17:03:26 INFO   es[o.e.gateway]  [sonar-1448107401111] recovered [0] indices into cluster_state
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=160m; support was removed in 8.0
2015.11.21 17:03:27 INFO  app[o.s.p.m.Monitor] Process[search] is up
2015.11.21 17:03:27 INFO  app[o.s.p.m.JavaProcessLauncher] Launch process[web]: /Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home/jre/bin/java -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djruby.management.enabled=false -Djruby.compile.invokedynamic=false -Xmx768m -Xms256m -XX:MaxPermSize=160m -XX:+HeapDumpOnOutOfMemoryError -Djava.net.preferIPv4Stack=true -Djava.io.tmpdir=/usr/local/Cellar/sonar/5.2/libexec/temp -cp ./lib/common/*:./lib/server/*:/usr/local/Cellar/sonar/5.2/libexec/lib/jdbc/h2/h2-1.3.176.jar org.sonar.server.app.WebServer /var/folders/cg/fg6j4gpd2jvg76y22fhnr_f00000gn/T/sq-process4839778306314254109properties
2015.11.21 17:03:27 INFO  web[o.s.p.ProcessEntryPoint] Starting web
2015.11.21 17:03:28 INFO  web[o.s.s.app.Webapp] Webapp directory: /usr/local/Cellar/sonar/5.2/libexec/web
2015.11.21 17:03:28 INFO  web[o.a.c.h.Http11NioProtocol] Initializing ProtocolHandler ["http-nio-0.0.0.0-9000"]
2015.11.21 17:03:28 INFO  web[o.a.t.u.n.NioSelectorPool] Using a shared selector for servlet write/read
2015.11.21 17:03:29 INFO  web[o.e.plugins] [sonar-1448107401111] loaded [], sites []
2015.11.21 17:03:30 INFO  web[o.s.s.p.ServerImpl] SonarQube Server / 5.2 / f045be98be3ba032b6b19d71574038eeeb91803b
2015.11.21 17:03:30 INFO  web[o.s.s.d.EmbeddedDatabase] Starting embedded database on port 9092 with url jdbc:h2:tcp://localhost:9092/sonar
2015.11.21 17:03:30 INFO  web[o.s.s.d.EmbeddedDatabase] Embedded database started. Data stored in: /usr/local/Cellar/sonar/5.2/libexec/data
2015.11.21 17:03:30 INFO  web[o.sonar.db.Database] Create JDBC data source for jdbc:h2:tcp://localhost:9092/sonar
2015.11.21 17:03:30 WARN  web[o.s.d.DatabaseChecker] H2 database should be used for evaluation purpose only
2015.11.21 17:03:32 INFO  web[o.s.s.p.DefaultServerFileSystem] SonarQube home: /usr/local/Cellar/sonar/5.2/libexec
2015.11.21 17:03:32 INFO   es[o.e.cluster.metadata]  [sonar-1448107401111] [rules] creating index, cause [api], templates [], shards [1]/[0], mappings []
2015.11.21 17:03:32 INFO   es[o.e.cluster.metadata]  [sonar-1448107401111] [rules] create_mapping [rule]
2015.11.21 17:03:32 INFO   es[o.e.cluster.metadata]  [sonar-1448107401111] [rules] create_mapping [activeRule]
2015.11.21 17:03:33 INFO  web[o.s.s.p.ServerPluginRepository] Plugin Java [java] installed
2015.11.21 17:03:33 INFO  web[o.s.s.p.ServerPluginRepository] Plugin Git [scmgit] installed
2015.11.21 17:03:33 INFO  web[o.s.s.p.ServerPluginRepository] Plugin SVN [scmsvn] installed
2015.11.21 17:03:33 INFO  web[o.s.s.p.ServerPluginRepository] Deploy plugin Git / 1.0 / 9ce9d330c313c296fab051317cc5ad4b26319e07
2015.11.21 17:03:33 INFO  web[o.s.s.p.ServerPluginRepository] Deploy plugin Java / 3.6 / 88ff47a7574edcc4472ff495c15b6f94d8dbd98f
2015.11.21 17:03:33 INFO  web[o.s.s.p.ServerPluginRepository] Deploy plugin SVN / 1.2 / d04c3cdb21f48905dd8300d1129ec90281aa6db2
2015.11.21 17:03:33 INFO  web[o.s.s.d.m.DatabaseMigrator] Create database
2015.11.21 17:03:34 INFO  web[o.s.s.p.RailsAppsDeployer] Deploying Ruby on Rails applications
2015.11.21 17:03:35 INFO  web[o.s.s.p.UpdateCenterClient] Update center: http://update.sonarsource.org/update-center.properties (no proxy)
2015.11.21 17:03:35 INFO  web[o.s.s.e.IndexCreator] Create index tests
2015.11.21 17:03:35 INFO   es[o.e.cluster.metadata]  [sonar-1448107401111] [tests] creating index, cause [api], templates [], shards [5]/[0], mappings []
2015.11.21 17:03:35 INFO  web[o.s.s.e.IndexCreator] Create type tests/test
2015.11.21 17:03:35 INFO   es[o.e.cluster.metadata]  [sonar-1448107401111] [tests] create_mapping [test]
2015.11.21 17:03:35 INFO  web[o.s.s.e.IndexCreator] Create index activities
2015.11.21 17:03:35 INFO   es[o.e.cluster.metadata]  [sonar-1448107401111] [activities] creating index, cause [api], templates [], shards [5]/[0], mappings []
2015.11.21 17:03:35 INFO  web[o.s.s.e.IndexCreator] Create type activities/activity
2015.11.21 17:03:35 INFO   es[o.e.cluster.metadata]  [sonar-1448107401111] [activities] create_mapping [activity]
2015.11.21 17:03:35 INFO  web[o.s.s.e.IndexCreator] Create index issues
2015.11.21 17:03:36 INFO   es[o.e.cluster.metadata]  [sonar-1448107401111] [issues] creating index, cause [api], templates [], shards [5]/[0], mappings []
2015.11.21 17:03:36 INFO  web[o.s.s.e.IndexCreator] Create type issues/authorization
2015.11.21 17:03:36 INFO   es[o.e.cluster.metadata]  [sonar-1448107401111] [issues] create_mapping [authorization]
2015.11.21 17:03:36 INFO  web[o.s.s.e.IndexCreator] Create type issues/issue
2015.11.21 17:03:36 INFO   es[o.e.cluster.metadata]  [sonar-1448107401111] [issues] create_mapping [issue]
2015.11.21 17:03:36 INFO  web[o.s.s.e.IndexCreator] Create index users
2015.11.21 17:03:36 INFO   es[o.e.cluster.metadata]  [sonar-1448107401111] [users] creating index, cause [api], templates [], shards [5]/[0], mappings []
2015.11.21 17:03:36 INFO  web[o.s.s.e.IndexCreator] Create type users/user
2015.11.21 17:03:36 INFO   es[o.e.cluster.metadata]  [sonar-1448107401111] [users] create_mapping [user]
2015.11.21 17:03:36 INFO  web[o.s.s.e.IndexCreator] Create index views
2015.11.21 17:03:36 INFO   es[o.e.cluster.metadata]  [sonar-1448107401111] [views] creating index, cause [api], templates [], shards [5]/[0], mappings []
2015.11.21 17:03:36 INFO  web[o.s.s.e.IndexCreator] Create type views/view
2015.11.21 17:03:36 INFO   es[o.e.cluster.metadata]  [sonar-1448107401111] [views] create_mapping [view]
2015.11.21 17:03:36 INFO  web[o.s.s.n.NotificationService] Notification service started (delay 60 sec.)
2015.11.21 17:03:36 INFO  web[o.s.s.s.IndexSynchronizer] Index rules
2015.11.21 17:03:37 INFO  web[o.s.s.s.IndexSynchronizer] Index activeRules
2015.11.21 17:03:37 INFO  web[o.s.s.s.RegisterMetrics] Register metrics
2015.11.21 17:03:37 INFO  web[o.s.s.s.RegisterDebtModel] Register technical debt model
2015.11.21 17:03:37 INFO  web[o.s.s.r.RegisterRules] Register rules
2015.11.21 17:03:43 INFO  web[o.s.s.q.RegisterQualityProfiles] Register quality profiles
2015.11.21 17:03:44 INFO  web[o.s.s.q.RegisterQualityProfiles] Register profile {lang=java, name=Sonar way}
2015.11.21 17:03:46 INFO  web[o.s.s.q.RegisterQualityProfiles] Set default java profile: Sonar way
2015.11.21 17:03:46 INFO  web[o.s.s.s.RegisterNewMeasureFilters] Register measure filters
2015.11.21 17:03:46 INFO  web[o.s.s.s.RegisterNewMeasureFilters] Register measure filter: Projects
2015.11.21 17:03:46 INFO  web[o.s.s.s.RegisterNewMeasureFilters] Register measure filter: My favourites
2015.11.21 17:03:46 INFO  web[o.s.s.s.RegisterDashboards] Register dashboards
2015.11.21 17:03:46 INFO  web[o.s.s.s.RegisterDashboards] Register dashboard: Dashboard
2015.11.21 17:03:46 INFO  web[o.s.s.s.RegisterDashboards] Register dashboard: Home
2015.11.21 17:03:46 INFO  web[o.s.s.s.RegisterDashboards] Register dashboard: Issues
2015.11.21 17:03:46 INFO  web[o.s.s.s.RegisterDashboards] Register dashboard: TimeMachine
2015.11.21 17:03:46 INFO  web[o.s.s.s.RegisterPermissionTemplates] Register permission templates
2015.11.21 17:03:46 INFO  web[o.s.s.s.RenameDeprecatedPropertyKeys] Rename deprecated property keys
2015.11.21 17:03:46 INFO  web[o.s.s.s.RenameIssueWidgets] Replacing issue related widgets with issue filter widgets
2015.11.21 17:03:46 INFO  web[o.s.s.s.IndexSynchronizer] Index activities
2015.11.21 17:03:46 INFO   es[o.e.cluster.metadata]  [sonar-1448107401111] [activities] update_mapping [activity] (dynamic)
2015.11.21 17:03:46 INFO  web[o.s.s.s.IndexSynchronizer] Index issues
2015.11.21 17:03:47 INFO  web[o.s.s.s.IndexSynchronizer] Index tests
2015.11.21 17:03:47 INFO  web[o.s.s.s.IndexSynchronizer] Index users
2015.11.21 17:03:47 INFO  web[o.s.s.s.IndexSynchronizer] Index views
2015.11.21 17:03:47 INFO  web[o.s.s.c.q.PurgeCeActivities] Delete the Compute Engine tasks created before Mon May 25 17:03:47 PKT 2015
2015.11.21 17:03:47 INFO  web[jruby.rack] jruby 1.7.9 (ruby-1.8.7p370) 2013-12-06 87b108a on Java HotSpot(TM) 64-Bit Server VM 1.8.0_65-b17 [darwin-x86_64]
2015.11.21 17:03:47 INFO  web[jruby.rack] using a shared (threadsafe!) runtime
2015.11.21 17:03:58 INFO  web[jruby.rack] keeping custom (config.logger) Rails logger instance
2015.11.21 17:03:58 INFO  web[o.a.c.h.Http11NioProtocol] Starting ProtocolHandler ["http-nio-0.0.0.0-9000"]
2015.11.21 17:03:58 INFO  web[o.s.s.a.TomcatAccessLog] Web server is started
2015.11.21 17:03:58 INFO  web[o.s.s.a.EmbeddedTomcat] HTTP connector enabled on port 9000
2015.11.21 17:03:59 INFO  app[o.s.p.m.Monitor] Process[web] is up
WARNING: while creating new bindings for class org.jruby.rack.RackInput,
found an existing binding; you may want to run a clean build.
WARNING: while creating new bindings for class org.jruby.rack.RackInput,
found an existing binding; you may want to run a clean build.
2015.11.21 17:03:59 ERROR web[o.s.s.ui.JRubyFacade] Fail to render: http://localhost:9000/
"en-US" is not a valid locale
    /Users/muhammadsoorage/.rvm/gems/ruby-2.2.1/gems/i18n-0.7.0/lib/i18n.rb:284:in `enforce_available_locales!'
    /Users/muhammadsoorage/.rvm/gems/ruby-2.2.1/gems/i18n-0.7.0/lib/i18n/config.rb:13:in `locale='
    /Users/muhammadsoorage/.rvm/gems/ruby-2.2.1/gems/i18n-0.7.0/lib/i18n.rb:43:in `locale='
    /usr/local/Cellar/sonar/5.2/libexec/web/WEB-INF/app/controllers/application_controller.rb:99:in `set_user_session'
    org/jruby/RubyKernel.java:2223:in `send'
    /usr/local/Cellar/sonar/5.2/libexec/web/WEB-INF/gems/gems/activesupport-2.3.15/lib/active_support/callbacks.rb:178:in `evaluate_method'
    /usr/local/Cellar/sonar/5.2/libexec/web/WEB-INF/gems/gems/activesupport-2.3.15/lib/active_support/callbacks.rb:166:in `call'
    /usr/local/Cellar/sonar/5.2/libexec/web/WEB-INF/gems/gems/actionpack-2.3.15/lib/action_controller/filters.rb:225:in `call'
    /usr/local/Cellar/sonar/5.2/libexec/web/WEB-INF/gems/gems/actionpack-2.3.15/lib/action_controller/filters.rb:629:in `run_before_filters'
    /usr/local/Cellar/sonar/5.2/libexec/web/WEB-INF/gems/gems/actionpack-2.3.15/lib/action_controller/filters.rb:615:in `call_filters'
    /usr/local/Cellar/sonar/5.2/libexec/web/WEB-INF/gems/gems/actionpack-2.3.15/lib/action_controller/filters.rb:610:in `perform_action_with_filters'
    /usr/local/Cellar/sonar/5.2/libexec/web/WEB-INF/gems/gems/actionpack-2.3.15/lib/action_controller/benchmarking.rb:68:in `perform_action_with_benchmark'
    /usr/local/Cellar/sonar/5.2/libexec/web/WEB-INF/gems/gems/activesupport-2.3.15/lib/active_support/core_ext/benchmark.rb:17:in `ms'
    jar:file:/usr/local/Cellar/sonar/5.2/libexec/lib/server/jruby-complete-1.7.9.jar!/META-INF/jruby.home/lib/ruby/1.8/benchmark.rb:308:in `realtime'
    /usr/local/Cellar/sonar/5.2/libexec/web/WEB-INF/gems/gems/activesupport-2.3.15/lib/active_support/core_ext/benchmark.rb:17:in `ms'
    /usr/local/Cellar/sonar/5.2/libexec/web/WEB-INF/gems/gems/actionpack-2.3.15/lib/action_controller/benchmarking.rb:68:in `perform_action_with_benchmark'
    /usr/local/Cellar/sonar/5.2/libexec/web/WEB-INF/gems/gems/actionpack-2.3.15/lib/action_controller/rescue.rb:160:in `perform_action_with_rescue'
    /usr/local/Cellar/sonar/5.2/libexec/web/WEB-INF/gems/gems/actionpack-2.3.15/lib/action_controller/flash.rb:151:in `perform_action_with_flash'
    org/jruby/RubyKernel.java:2223:in `send'
    /usr/local/Cellar/sonar/5.2/libexec/web/WEB-INF/gems/gems/actionpack-2.3.15/lib/action_controller/base.rb:532:in `process'
    /usr/local/Cellar/sonar/5.2/libexec/web/WEB-INF/gems/gems/actionpack-2.3.15/lib/action_controller/filters.rb:606:in `process_with_filters'
    /usr/local/Cellar/sonar/5.2/libexec/web/WEB-INF/gems/gems/actionpack-2.3.15/lib/action_controller/base.rb:391:in `process'
    /usr/local/Cellar/sonar/5.2/libexec/web/WEB-INF/gems/gems/actionpack-2.3.15/lib/action_controller/base.rb:386:in `call'
    /usr/local/Cellar/sonar/5.2/libexec/web/WEB-INF/gems/gems/actionpack-2.3.15/lib/action_controller/routing/route_set.rb:450:in `call'
    /usr/local/Cellar/sonar/5.2/libexec/web/WEB-INF/gems/gems/actionpack-2.3.15/lib/action_controller/dispatcher.rb:87:in `dispatch'
    /usr/local/Cellar/sonar/5.2/libexec/web/WEB-INF/gems/gems/actionpack-2.3.15/lib/action_controller/dispatcher.rb:121:in `_call'
    /usr/local/Cellar/sonar/5.2/libexec/web/WEB-INF/gems/gems/actionpack-2.3.15/lib/action_controller/dispatcher.rb:130:in `build_middleware_stack'
    org/jruby/RubyProc.java:290:in `call'
    org/jruby/RubyProc.java:224:in `call'
    /usr/local/Cellar/sonar/5.2/libexec/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/query_cache.rb:29:in `call'
    /usr/local/Cellar/sonar/5.2/libexec/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache'
    /usr/local/Cellar/sonar/5.2/libexec/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/query_cache.rb:9:in `cache'
    /usr/local/Cellar/sonar/5.2/libexec/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/query_cache.rb:28:in `call'
    /usr/local/Cellar/sonar/5.2/libexec/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call'
    /usr/local/Cellar/sonar/5.2/libexec/web/WEB-INF/config/environment.rb:67:in `call'
    /usr/local/Cellar/sonar/5.2/libexec/web/WEB-INF/gems/gems/actionpack-2.3.15/lib/action_controller/string_coercion.rb:25:in `call'
    /usr/local/Cellar/sonar/5.2/libexec/web/WEB-INF/gems/gems/rack-1.1.6/lib/rack/head.rb:9:in `call'
    /usr/local/Cellar/sonar/5.2/libexec/web/WEB-INF/gems/gems/rack-1.1.6/lib/rack/methodoverride.rb:24:in `call'
    /usr/local/Cellar/sonar/5.2/libexec/web/WEB-INF/gems/gems/actionpack-2.3.15/lib/action_controller/params_parser.rb:15:in `call'
    file:/usr/local/Cellar/sonar/5.2/libexec/lib/server/jruby-rack-1.1.13.2.jar!/jruby/rack/session_store.rb:70:in `context'
    /usr/local/Cellar/sonar/5.2/libexec/web/WEB-INF/gems/gems/rack-1.1.6/lib/rack/session/abstract/id.rb:58:in `call'
    /usr/local/Cellar/sonar/5.2/libexec/web/WEB-INF/gems/gems/actionpack-2.3.15/lib/action_controller/failsafe.rb:26:in `call'
    /usr/local/Cellar/sonar/5.2/libexec/web/WEB-INF/gems/gems/actionpack-2.3.15/lib/action_controller/dispatcher.rb:106:in `call'
    file:/usr/local/Cellar/sonar/5.2/libexec/lib/server/jruby-rack-1.1.13.2.jar!/rack/adapter/rails.rb:34:in `serve_rails'
    file:/usr/local/Cellar/sonar/5.2/libexec/lib/server/jruby-rack-1.1.13.2.jar!/rack/adapter/rails.rb:39:in `call'
    file:/usr/local/Cellar/sonar/5.2/libexec/lib/server/jruby-rack-1.1.13.2.jar!/rack/handler/servlet.rb:22:in `call'

请查看此 GitHub 问题:Mac OS We're sorry, but something went wrong

根本原因可能是:您机器上安装的某些 Ruby gem 与 SonarQube 平台之间似乎存在冲突

解决方案:rvm use system

解决方案

打开启动文件/$SONAR_HOME/bin/xxxx/sonar.sh其中xxxx是系统特定的,然后在这个文件的顶部添加unset GEM_PATH,重启sonar。