如何为 cf.org 示例 spring 引导应用程序修复 bosh-lite 上的 mysql 连接问题?

How to fix mysql connectivity issues on bosh-lite for a cf.org sample spring boot app?

我在 运行 mvn package 之后尝试 cf push 来自 this github 回购的代码,但应用程序部署失败。

自从 cleardb 以来,我已经为 mysql 创建了一个用户定义的服务 在我的 bosh-lite 本地虚拟机上不可用。我创建了 mysql 服务并将其命名为 'mysql' 并由 this 指导。

此 spring 引导应用程序中的 application.yml 指向本地主机。如果不更正 jdbc url,即使对于本地(非 cf)构建也不起作用。 Here 是当我尝试 cf push 这个应用程序并使用 cf logs springpong --recent.

读取日志时来自 bosh-lite 虚拟机的堆栈跟踪

此外,为什么我们需要同时提供数据库详细信息的 manifest.ymlapplication.yml

vagrant@vagrant-ubuntu-trusty-64:~$ cat pong_matcher_spring/src/main/resources/application.yml
---
spring:
  datasource:
    driverClassName: com.mysql.jdbc.Driver
    url: jdbc:mysql://localhost/pong_matcher_spring_development
    username: springpong
    password: springpong
  jpa:
    hibernate.ddl-auto: none
    show_sql: false
vagrant@vagrant-ubuntu-trusty-64:~$ cat pong_matcher_spring/manifest.yml
---
applications:
  - name: springpong
    buildpack: java_buildpack
    path: target/pong-matcher-spring-1.0.0.BUILD-SNAPSHOT.jar
    services:
      - mysql
vagrant@vagrant-ubuntu-trusty-64:~$

有人可以帮我解决这个问题吗?
TIA

发生这种情况是因为 security groups 未设置为允许网络访问。可以在这里看到命令的示例要点 -> https://gist.github.com/menicosia/2e9c414430138064f945

警告:这 用于 bosh-lite 和开发目的。