【问题标题】:grails mongodb connection refusedgrails mongodb连接被拒绝
【发布时间】:2012-08-28 03:34:08
【问题描述】:

我的 grails 应用程序可以连接到我的本地 mongodb 并且工作正常,但是当我部署到 Cloud Foundry 时,尝试连接到 cf. 上的 mongodb 时出现连接被拒绝错误。

我绑定了一个 mongodb 服务到我的应用,但它仍然无法连接?

barryalexanders-MacBook-Pro:~ barryalexander$ vmc 应用程序

+-------------+----+---------+-------------------------+-----------------+
| Application | #  | Health  | URLS                    | Services        |
+-------------+----+---------+-------------------------+-----------------+
| RelCal      | 1  | RUNNING | relcal.cloudfoundry.com | mongodb-a77900c |
| barry       | 1  | STOPPED | barry.cloudfoundry.com  |                 |
+-------------+----+---------+-------------------------+-----------------+

这是在http://relcal.cloudfoundry.com/release/calendar 访问我的应用程序后的堆栈跟踪



        Line | Method
    ->> 228 | _open    in com.mongodb.DBPort
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
    |   112 | go       in     ''
    |    79 | call . . in     ''
    |   218 | call     in com.mongodb.DBTCPConnector
    |   305 | __find . in com.mongodb.DBApiLayer$MyCollection
    |   369 | _check   in com.mongodb.DBCursor
    |   498 | _hasNext in     ''
    |   523 | hasNext  in     ''
    |    40 | hasNext  in com.google.code.morphia.query.MorphiaIterator
    |   258 | asList   in com.google.code.morphia.query.QueryImpl
    |    20 | doCall . in com.gap.release.calendar.RelCalRestController$_closure1
    ^   662 | run      in java.lang.Thread

我错过了一些东西,但不知道是什么。

【问题讨论】:

  • 如果您在 support.cloudfoundry.com 打开私人票并将您的应用程序发送给我们,我们将尝试重现您的问题。
  • 开启私下问题#102548 Mongodb服务连接问题

标签: mongodb grails cloud-foundry


【解决方案1】:

此时,在将 grails/mongo 应用程序部署到 cloudfoundry 时,最好使用Cloud Foundry Services - Using MongoDB with Grails 中描述的方法,而不是使用 morphia。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-05-12
    • 1970-01-01
    • 1970-01-01
    • 2019-12-13
    • 2014-09-14
    • 2020-06-21
    • 2016-11-12
    • 1970-01-01
    相关资源
    最近更新 更多