2

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

我将 mongodb 服务绑定到我的应用程序,但它仍然无法连接?

barry-alexanders-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

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

4

1 回答 1

1

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

于 2012-09-06T23:15:34.047 回答