我的 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 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
我错过了一些东西,但不知道是什么。
此时,在将grails/mongo应用程序部署到cloudfoundry时,最好使用以下描述的方法Cloud Foundry 服务 - 将 MongoDB 与 Grails 结合使用 http://docs.cloudfoundry.com/services/mongodb/grails-mongodb.html而不是使用吗啡。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)