我遇到了奇怪的情况,我正在使用版本11.11播放2.5.1。我的应用程序与本地mongodb工作正常。当我在AWS或Google计算机上启动应用程序时,它会在collection.find期间卡住,因为事实上任何类型的集合操作都会被卡住。我已经在实例本身安装了mongodb local,我可以通过shell连接并添加到mongodb的集合。
同样在数字海洋上工作得很好
有人可以帮我解决可能出现的问题
配置
mongodb.uri = "mongodb://"${?MONGO_HOST}":"${?MONGO_PORT}"/service_collection"
mongo-async-driver {
akka {
loggers = ["akka.event.slf4j.Slf4jLogger"]
loglevel = DEBUG
}
}
以下内容来自我的构建和插件文件。
"org.reactivemongo" %% "play2-reactivemongo" % "0.11.11"
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.5.1")
日志 反应性mongo日志
[info] application - ReactiveMongoApi starting...
[info] application - ReactiveMongoApi successfully configured with DB 'service_collection'! Servers:
[127.0.0.1:27017]
在mongodb方面,这些是以下日志,我没有看到任何从日志到达mongodb的查询。
Mongodb记录
Sat Apr 9 01:20:25.891 [initandlisten] opening db: local
Sat Apr 9 01:20:25.892 [initandlisten] enter repairDatabases (to check pdfile version #)
Sat Apr 9 01:20:25.892 [initandlisten] local
Sat Apr 9 01:20:25.892 [initandlisten] service_collection
Sat Apr 9 01:20:25.892 [initandlisten] opening db: service_collection
Sat Apr 9 01:20:25.893 [initandlisten] done repairDatabases
Sat Apr 9 01:20:25.893 [initandlisten] run command local.$cmd { create: "startup_log", size: 10485760, capped: true }
Sat Apr 9 01:20:25.893 [initandlisten] opening db: local
Sat Apr 9 01:20:25.893 [initandlisten] create collection local.startup_log { create: "startup_log", size: 10485760, capped: true }
Sat Apr 9 01:20:25.893 [initandlisten] command local.$cmd command: { create: "startup_log", size: 10485760, capped: true } ntoreturn:1 keyUpdates:0 reslen:75 0ms
Sat Apr 9 01:20:25.893 [initandlisten] insert local.startup_log ninserted:1 keyUpdates:0 0ms
Sat Apr 9 01:20:25.893 [initandlisten] fd limit hard:64000 soft:64000 max conn: 51200
Sat Apr 9 01:20:25.893 [initandlisten] waiting for connections on port 27017
Sat Apr 9 01:20:25.893 BackgroundJob starting: TTLMonitor
Sat Apr 9 01:20:25.893 BackgroundJob starting: PeriodicTask::Runner
Sat Apr 9 01:20:25.893 BackgroundJob starting: ClientCursorMonitor
Sat Apr 9 01:20:25.893 [websvr] fd limit hard:64000 soft:64000 max conn: 51200
Sat Apr 9 01:20:25.894 [websvr] admin web console waiting for connections on port 28017
Sat Apr 9 01:20:25.894 BackgroundJob starting: snapshot
Sat Apr 9 01:20:33.471 [initandlisten] connection accepted from 127.0.0.1:58316 #1 (1 connection now open)
Sat Apr 9 01:20:33.473 [initandlisten] connection accepted from 127.0.0.1:58317 #2 (2 connections now open)
Sat Apr 9 01:20:33.473 [initandlisten] connection accepted from 127.0.0.1:58318 #3 (3 connections now open)
Sat Apr 9 01:20:33.475 [initandlisten] connection accepted from 127.0.0.1:58319 #4 (4 connections now open)
Sat Apr 9 01:20:33.475 [initandlisten] connection accepted from 127.0.0.1:58320 #5 (5 connections now open)
Sat Apr 9 01:20:33.475 [initandlisten] connection accepted from 127.0.0.1:58321 #6 (6 connections now open)
Sat Apr 9 01:20:33.477 [initandlisten] connection accepted from 127.0.0.1:58322 #7 (7 connections now open)
Sat Apr 9 01:20:33.477 [initandlisten] connection accepted from 127.0.0.1:58323 #8 (8 connections now open)
Sat Apr 9 01:20:33.477 [initandlisten] connection accepted from 127.0.0.1:58324 #9 (9 connections now open)
Sat Apr 9 01:20:33.477 [initandlisten] connection accepted from 127.0.0.1:58325 #10 (10 connections now open)