stuck of start mongoDB - mongodb

2017-03-01T00:51:32.863-0500 I CONTROL [initandlisten]
2017-03-01T00:51:33.271-0500 I FTDC [initandlisten] Initializing full-time diagnostic data capture with directory 'D:/mongo/data/diagnostic.data'
2017-03-01T00:51:33.284-0500 I NETWORK [thread1] waiting for connections on port 27017
2017-03-01T00:51:33.391-0500 I NETWORK [thread1] connection accepted from 127.0.0.1:50501 #1 (1 connection now open)
2017-03-01T00:51:33.394-0500 I NETWORK [thread1] connection accepted from 127.0.0.1:50502 #2 (2 connections now open)
2017-03-01T00:51:33.399-0500 I NETWORK [thread1] connection accepted from 127.0.0.1:50503 #3 (3 connections now open)
2017-03-01T00:51:33.401-0500 I NETWORK [thread1] connection accepted from 127.0.0.1:50504 #4 (4 connections now open)
2017-03-01T00:51:33.406-0500 I NETWORK [thread1] connection accepted from 127.0.0.1:50505 #5 (5 connections now open)
2017-03-01T00:51:33.418-0500 I NETWORK [thread1] connection accepted from 127.0.0.1:50506 #6 (6 connections now open)
When I start the mongoDB, the command line pop up these things, how could I fix it? I have tried delete the data folder...

Related

MongoDB server will be disconnected

My service works fine on other devices,it's the same device.
This is my mongod.log
2022-06-30T14:44:14.347+0800 I NETWORK [conn88] DBException handling request, closing client connection: Location18634: Not enough data to read
2022-06-30T14:44:14.347+0800 I NETWORK [conn88] end connection 127.0.0.1:51541 (32 connections now open)
2022-06-30T14:44:15.348+0800 I NETWORK [listener] connection accepted from 127.0.0.1:59194 #96 (33 connections now open)
2022-06-30T14:44:17.263+0800 I NETWORK [conn95] Error receiving request from client: SSLHandshakeFailed: SSL handshake received but server is started without SSL support. Ending connection from 127.0.0.1:58946 (connection id: 95)
2022-06-30T14:44:17.263+0800 I NETWORK [conn95] end connection 127.0.0.1:58946 (32 connections now open)
2022-06-30T14:44:18.265+0800 I NETWORK [listener] connection accepted from 127.0.0.1:59537 #97 (33 connections now open)
2022-06-30T14:44:20.281+0800 I NETWORK [conn91] DBException handling request, closing client connection: Location18634: Not enough data to read
2022-06-30T14:44:20.281+0800 I NETWORK [conn91] end connection 127.0.0.1:55184 (32 connections now open)
2022-06-30T14:44:21.283+0800 I NETWORK [listener] connection accepted from 127.0.0.1:59906 #98 (33 connections now open)
2022-06-30T14:44:24.681+0800 I NETWORK [listener] connection accepted from 127.0.0.1:60331 #99 (34 connections now open)
2022-06-30T14:44:26.410+0800 E - [conn99] Assertion: Location34348: cannot translate opcode 1701052416 C:\data\mci\214e16655a8f0c90de17c5af422670e3\src\src\mongo/rpc/message.h 118
2022-06-30T14:44:26.410+0800 I NETWORK [conn99] DBException handling request, closing client connection: Location34348: cannot translate opcode 1701052416
2022-06-30T14:44:26.410+0800 I NETWORK [conn99] end connection 127.0.0.1:60331 (33 connections now open)
2022-06-30T14:44:34.161+0800 I NETWORK [conn48] DBException handling request, closing client connection: Location18634: Not enough data to read
2022-06-30T14:44:34.161+0800 I NETWORK [conn48] end connection 127.0.0.1:56380 (32 connections now open)
What does "Not enough data to read" mean.
I also have "SSLHandshakeFailed" error.

MongoDB log file shows connection accepted & end connection constantly

I'm trying to install MongoDb server in Redhat 7 GCE
After starting Mongod process with replication, the mongolog shows an error log..
`2017-12-29T20:51:12.853+0530 I NETWORK [initandlisten] connection accepted
from 10.142.0.2:38130 #53 (1 connection now open)
2017-12-29T20:51:42.861+0530 I NETWORK [conn53] end connection
10.142.0.2:38130 (0 connections now open)
2017-12-29T20:51:42.862+0530 I NETWORK [initandlisten] connection accepted
from 10.142.0.2:38136 #54 (1 connection now open)
2017-12-29T20:52:12.868+0530 I NETWORK [conn54] end connection
10.142.0.2:38136 (0 connections now open)
2017-12-29T20:52:12.869+0530 I NETWORK [initandlisten] connection accepted
from 10.142.0.2:38144 #55 (1 connection now open)
2017-12-29T20:52:42.877+0530 I NETWORK [conn55] end connection
10.142.0.2:38144 (0 connections now open)
2017-12-29T20:52:42.877+0530 I NETWORK [initandlisten] connection accepted
from 10.142.0.2:38150 #56 (1 connection now open)
2017-12-29T20:53:12.883+0530 I NETWORK [conn56] end connection
10.142.0.2:38150 (0 connections now open)
2017-12-29T20:53:12.883+0530 I NETWORK [initandlisten] connection accepted
from 10.142.0.2:38156 #57 (1 connection now open)
2017-12-29T20:53:42.891+0530 I NETWORK [conn57] end connection
10.142.0.2:38156 (0 connections now open)
2017-12-29T20:53:42.892+0530 I NETWORK [initandlisten] connection accepted
from 10.142.0.2:38162 #58 (1 connection now open)
2017-12-29T20:54:12.900+0530 I NETWORK [conn58] end connection
10.142.0.2:38162 (0 connections now open)
2017-12-29T20:54:12.900+0530 I NETWORK [initandlisten] connection accepted
from 10.142.0.2:38170 #59 (1 connection now open)
2017-12-29T20:54:42.908+0530 I NETWORK [conn59] end connection
10.142.0.2:38170 (0 connections now open)
2017-12-29T20:54:42.908+0530 I NETWORK [initandlisten] connection accepted
from 10.142.0.2:38174 #60 (1 connection now open)
2017-12-29T20:55:12.917+0530 I NETWORK [conn60] end connection
10.142.0.2:38174 (0 connections now open)
`
I can connect from the redhat shell as
mongo --port 34672
but when i try to connect from an external ip it fails.
i was not able to find the reason for this error after checking all the error logs and searching in the web.
These log entries to not indicate an error. It is simply reporting connections. As for the reason for the connections, there could be several:
If you have an application using MongoDB, these connections are likely coming from that application.
If you have monitoring such as Stackdriver Monitoring installed, these could be connections from the monitoring to fetch statistics from MongoDB.
If you are using a cluster of MongoDB servers, this could be connections or health-checking between them.
I think (2) or (3) are especially likely, given that they are coming from internal IP addresses are are spaced exactly 30 seconds apart.
I believe your issue connecting externally is unrelated to these messages. If that is what you are really concerned about, I suggest you open a new question about that.

Strange MongoError (with ReactiveMongo) when Play reloads application

Very often, when Play reloads the application after a code change, I receive the following error:
MongoError['The node set can not be reached! Please check your network
connectivity.']
The MongoDB log looks like this:
2016-09-06T18:51:22.609+0200 I NETWORK [initandlisten] waiting for connections on port 27017
2016-09-06T18:53:49.916+0200 I NETWORK [initandlisten] connection accepted from 127.0.0.1:60559 #1 (1 connection now open)
2016-09-06T18:53:51.185+0200 I NETWORK [initandlisten] connection accepted from 127.0.0.1:60561 #2 (2 connections now open)
2016-09-06T18:53:51.196+0200 I NETWORK [initandlisten] connection accepted from 127.0.0.1:60562 #3 (3 connections now open)
2016-09-06T18:53:51.206+0200 I NETWORK [initandlisten] connection accepted from 127.0.0.1:60563 #4 (4 connections now open)
2016-09-06T18:53:51.217+0200 I NETWORK [initandlisten] connection accepted from 127.0.0.1:60564 #5 (5 connections now open)
2016-09-06T18:53:51.227+0200 I NETWORK [initandlisten] connection accepted from 127.0.0.1:60565 #6 (6 connections now open)
2016-09-06T18:53:51.237+0200 I NETWORK [initandlisten] connection accepted from 127.0.0.1:60566 #7 (7 connections now open)
2016-09-06T18:53:51.248+0200 I NETWORK [initandlisten] connection accepted from 127.0.0.1:60567 #8 (8 connections now open)
2016-09-06T18:53:51.258+0200 I NETWORK [initandlisten] connection accepted from 127.0.0.1:60568 #9 (9 connections now open)
2016-09-06T18:53:51.269+0200 I NETWORK [initandlisten] connection accepted from 127.0.0.1:60569 #10 (10 connections now open)
2016-09-06T18:53:59.533+0200 I NETWORK [initandlisten] connection accepted from 127.0.0.1:60577 #11 (11 connections now open)
2016-09-06T18:53:59.546+0200 I NETWORK [initandlisten] connection accepted from 127.0.0.1:60578 #12 (12 connections now open)
2016-09-06T18:53:59.557+0200 I NETWORK [initandlisten] connection accepted from 127.0.0.1:60579 #13 (13 connections now open)
2016-09-06T18:53:59.568+0200 I NETWORK [initandlisten] connection accepted from 127.0.0.1:60580 #14 (14 connections now open)
2016-09-06T18:53:59.579+0200 I NETWORK [initandlisten] connection accepted from 127.0.0.1:60581 #15 (15 connections now open)
2016-09-06T18:53:59.589+0200 I NETWORK [initandlisten] connection accepted from 127.0.0.1:60582 #16 (16 connections now open)
2016-09-06T18:53:59.600+0200 I NETWORK [initandlisten] connection accepted from 127.0.0.1:60583 #17 (17 connections now open)
2016-09-06T18:53:59.610+0200 I NETWORK [initandlisten] connection accepted from 127.0.0.1:60584 #18 (18 connections now open)
2016-09-06T18:53:59.620+0200 I NETWORK [initandlisten] connection accepted from 127.0.0.1:60585 #19 (19 connections now open)
2016-09-06T19:37:21.594+0200 I NETWORK [conn11] end connection 127.0.0.1:60577 (18 connections now open)
2016-09-06T19:37:21.596+0200 I NETWORK [conn1] end connection 127.0.0.1:60559 (17 connections now open)
2016-09-06T19:37:21.597+0200 I NETWORK [conn15] end connection 127.0.0.1:60581 (16 connections now open)
2016-09-06T19:37:21.597+0200 I NETWORK [conn13] end connection 127.0.0.1:60579 (15 connections now open)
2016-09-06T19:37:21.597+0200 I NETWORK [conn16] end connection 127.0.0.1:60582 (14 connections now open)
2016-09-06T19:37:21.598+0200 I NETWORK [conn12] end connection 127.0.0.1:60578 (13 connections now open)
2016-09-06T19:37:21.598+0200 I NETWORK [conn19] end connection 127.0.0.1:60585 (13 connections now open)
2016-09-06T19:37:21.599+0200 I NETWORK [conn17] end connection 127.0.0.1:60583 (11 connections now open)
2016-09-06T19:37:21.599+0200 I NETWORK [conn14] end connection 127.0.0.1:60580 (11 connections now open)
2016-09-06T19:37:21.600+0200 I NETWORK [conn18] end connection 127.0.0.1:60584 (9 connections now open)
2016-09-06T19:37:21.607+0200 I NETWORK [conn5] end connection 127.0.0.1:60564 (9 connections now open)
2016-09-06T19:37:21.607+0200 I NETWORK [conn9] end connection 127.0.0.1:60568 (9 connections now open)
2016-09-06T19:37:21.608+0200 I NETWORK [conn6] end connection 127.0.0.1:60565 (9 connections now open)
2016-09-06T19:37:21.608+0200 I NETWORK [conn10] end connection 127.0.0.1:60569 (9 connections now open)
2016-09-06T19:37:21.609+0200 I NETWORK [conn2] end connection 127.0.0.1:60561 (9 connections now open)
2016-09-06T19:37:21.609+0200 I NETWORK [conn7] end connection 127.0.0.1:60566 (9 connections now open)
2016-09-06T19:37:21.610+0200 I NETWORK [conn3] end connection 127.0.0.1:60562 (9 connections now open)
2016-09-06T19:37:21.611+0200 I NETWORK [conn4] end connection 127.0.0.1:60563 (4 connections now open)
2016-09-06T19:37:21.612+0200 I NETWORK [conn8] end connection 127.0.0.1:60567 (0 connections now open)
2016-09-06T19:37:22.326+0200 I NETWORK [initandlisten] connection accepted from 127.0.0.1:62077 #20 (1 connection now open)
2016-09-06T19:37:22.333+0200 I NETWORK [initandlisten] connection accepted from 127.0.0.1:62078 #21 (2 connections now open)
2016-09-06T19:37:22.333+0200 I NETWORK [initandlisten] connection accepted from 127.0.0.1:62079 #22 (3 connections now open)
2016-09-06T19:37:22.343+0200 I NETWORK [initandlisten] connection accepted from 127.0.0.1:62080 #23 (4 connections now open)
2016-09-06T19:37:22.344+0200 I NETWORK [initandlisten] connection accepted from 127.0.0.1:62081 #24 (5 connections now open)
2016-09-06T19:37:22.344+0200 I NETWORK [initandlisten] connection accepted from 127.0.0.1:62082 #25 (6 connections now open)
2016-09-06T19:37:22.344+0200 I NETWORK [initandlisten] connection accepted from 127.0.0.1:62083 #26 (7 connections now open)
2016-09-06T19:37:22.344+0200 I NETWORK [initandlisten] connection accepted from 127.0.0.1:62084 #27 (8 connections now open)
2016-09-06T19:37:22.354+0200 I NETWORK [initandlisten] connection accepted from 127.0.0.1:62085 #28 (9 connections now open)
2016-09-06T19:37:22.355+0200 I NETWORK [initandlisten] connection accepted from 127.0.0.1:62086 #29 (10 connections now open)
2016-09-06T19:37:32.348+0200 I NETWORK [initandlisten] connection accepted from 127.0.0.1:62105 #30 (11 connections now open)
2016-09-06T19:37:32.359+0200 I NETWORK [initandlisten] connection accepted from 127.0.0.1:62106 #31 (12 connections now open)
2016-09-06T19:37:32.393+0200 I NETWORK [initandlisten] connection accepted from 127.0.0.1:62107 #32 (13 connections now open)
2016-09-06T19:37:32.399+0200 I NETWORK [initandlisten] connection accepted from 127.0.0.1:62108 #33 (14 connections now open)
2016-09-06T19:37:32.399+0200 I NETWORK [initandlisten] connection accepted from 127.0.0.1:62109 #34 (15 connections now open)
2016-09-06T19:37:32.399+0200 I NETWORK [initandlisten] connection accepted from 127.0.0.1:62110 #35 (16 connections now open)
2016-09-06T19:37:32.399+0200 I NETWORK [initandlisten] connection accepted from 127.0.0.1:62111 #36 (17 connections now open)
2016-09-06T19:37:32.401+0200 I NETWORK [initandlisten] connection accepted from 127.0.0.1:62112 #37 (18 connections now open)
2016-09-06T19:37:32.401+0200 I NETWORK [initandlisten] connection accepted from 127.0.0.1:62113 #38 (19 connections now open)
Sometimes there's also this exception:
[warn] r.c.a.MongoDBSystem - The entire node set is unreachable, is there a network problem?
[warn] r.c.a.MongoDBSystem - The entire node set is unreachable, is there a network problem?
[error] r.api.Failover2 - Got an error, no more attempts to do. Completing with a failure...
reactivemongo.core.actors.Exceptions$PrimaryUnavailableException$: MongoError['No primary node is available!']
at reactivemongo.core.actors.Exceptions$PrimaryUnavailableException$.<clinit>(actors.scala)
at reactivemongo.core.actors.MongoDBSystem$$anonfun$reactivemongo$core$actors$MongoDBSystem$$pickChannel$4.apply(actors.scala:748)
at reactivemongo.core.actors.MongoDBSystem$$anonfun$reactivemongo$core$actors$MongoDBSystem$$pickChannel$4.apply(actors.scala:748)
at scala.Option.getOrElse(Option.scala:121)
at reactivemongo.core.actors.MongoDBSystem$class.reactivemongo$core$actors$MongoDBSystem$$pickChannel(actors.scala:748)
at reactivemongo.core.actors.MongoDBSystem$$anonfun$4.applyOrElse(actors.scala:340)
at scala.PartialFunction$OrElse.applyOrElse(PartialFunction.scala:170)
at akka.actor.Actor$class.aroundReceive(Actor.scala:482)
at reactivemongo.core.actors.LegacyDBSystem.aroundReceive(actors.scala:896)
at akka.actor.ActorCell.receiveMessage(ActorCell.scala:526)
[error] r.api.Failover2 - Got an error, no more attempts to do. Completing with a failure...
reactivemongo.core.actors.Exceptions$PrimaryUnavailableException$: MongoError['No primary node is available!']
at reactivemongo.core.actors.Exceptions$PrimaryUnavailableException$.<clinit>(actors.scala)
at reactivemongo.core.actors.MongoDBSystem$$anonfun$reactivemongo$core$actors$MongoDBSystem$$pickChannel$4.apply(actors.scala:748)
at reactivemongo.core.actors.MongoDBSystem$$anonfun$reactivemongo$core$actors$MongoDBSystem$$pickChannel$4.apply(actors.scala:748)
at scala.Option.getOrElse(Option.scala:121)
at reactivemongo.core.actors.MongoDBSystem$class.reactivemongo$core$actors$MongoDBSystem$$pickChannel(actors.scala:748)
at reactivemongo.core.actors.MongoDBSystem$$anonfun$4.applyOrElse(actors.scala:340)
at scala.PartialFunction$OrElse.applyOrElse(PartialFunction.scala:170)
at akka.actor.Actor$class.aroundReceive(Actor.scala:482)
at reactivemongo.core.actors.LegacyDBSystem.aroundReceive(actors.scala:896)
at akka.actor.ActorCell.receiveMessage(ActorCell.scala:526)
[error] r.api.Failover2 - Got an error, no more attempts to do. Completing with a failure...
reactivemongo.core.actors.Exceptions$PrimaryUnavailableException$: MongoError['No primary node is available!']
at reactivemongo.core.actors.Exceptions$PrimaryUnavailableException$.<clinit>(actors.scala)
at reactivemongo.core.actors.MongoDBSystem$$anonfun$reactivemongo$core$actors$MongoDBSystem$$pickChannel$4.apply(actors.scala:748)
at reactivemongo.core.actors.MongoDBSystem$$anonfun$reactivemongo$core$actors$MongoDBSystem$$pickChannel$4.apply(actors.scala:748)
at scala.Option.getOrElse(Option.scala:121)
at reactivemongo.core.actors.MongoDBSystem$class.reactivemongo$core$actors$MongoDBSystem$$pickChannel(actors.scala:748)
at reactivemongo.core.actors.MongoDBSystem$$anonfun$4.applyOrElse(actors.scala:340)
at scala.PartialFunction$OrElse.applyOrElse(PartialFunction.scala:170)
at akka.actor.Actor$class.aroundReceive(Actor.scala:482)
at reactivemongo.core.actors.LegacyDBSystem.aroundReceive(actors.scala:896)
at akka.actor.ActorCell.receiveMessage(ActorCell.scala:526)
When I completely kill the process and execute activator run again, everything works like before.
Here's how I use ReactiveMongo:
val collection: Future[JSONCollection] = reactiveMongoApi.database.map(_.collection[JSONCollection](collectionName))
Used versions:
MongoDB: v3.2.4
Scala: 2.11.8
Play 2.5
play2-reactivemongo: 0.11.13
reactivemongo-play-json: 0.11.14
As developing like this takes forever, I would appreciate any help to fix this issue! :-)
I faced this issue as well; every time I reloaded my Play application (including hot reloads), I received hundreds of connection errors. After trying a couple times, my application would run fine until the next reload. This only started happening after I upgraded from ReactiveMongo 0.x to 1.x. I've tried running MongoDB (versions 3.2 through 4.0) locally, as both a native install and in a Docker container.
I "solved" it by adding the following connection options:
MongoConnectionOptions(maxIdleTimeMS = 100000, heartbeatFrequencyMS = 100)
The full connection looks like this:
private val driver = new reactivemongo.api.AsyncDriver
val connection: Future[MongoConnection] = driver.connect(List("localhost"), MongoConnectionOptions(maxIdleTimeMS = 100000, heartbeatFrequencyMS = 100))
I don't know why these values seem to work, or whether they're optimal. And I probably wouldn't recommend running a heartbeat of 100ms in production. However, it's working for my development needs, so I figured I'd share.

Reactivemongo leaking connections during Play hot-reload

I have a Scala-based Play app that uses ReactiveMongo. When in development mode and a hot-reload occurs, ReactiveMongo leaks connections. For example, here is a snippet of Mongo's log files; I added a line break in the logs to indicate each time a hot-reload occurred (i.e. I made a trivial change the app and reloaded a page in the browser)
2015-09-26T09:43:43.353-0700 I NETWORK [initandlisten] connection accepted from 127.0.0.1:58612 #1 (1 connection now open)
2015-09-26T09:43:43.725-0700 I NETWORK [initandlisten] connection accepted from 127.0.0.1:58613 #2 (2 connections now open)
2015-09-26T09:43:43.725-0700 I NETWORK [initandlisten] connection accepted from 127.0.0.1:58614 #3 (3 connections now open)
2015-09-26T09:43:43.725-0700 I NETWORK [initandlisten] connection accepted from 127.0.0.1:58615 #4 (4 connections now open)
2015-09-26T09:43:43.725-0700 I NETWORK [initandlisten] connection accepted from 127.0.0.1:58616 #5 (5 connections now open)
2015-09-26T09:43:43.726-0700 I NETWORK [initandlisten] connection accepted from 127.0.0.1:58617 #6 (6 connections now open)
2015-09-26T09:43:43.726-0700 I NETWORK [initandlisten] connection accepted from 127.0.0.1:58618 #7 (7 connections now open)
2015-09-26T09:43:43.726-0700 I NETWORK [initandlisten] connection accepted from 127.0.0.1:58619 #8 (8 connections now open)
2015-09-26T09:43:43.726-0700 I NETWORK [initandlisten] connection accepted from 127.0.0.1:58620 #9 (9 connections now open)
2015-09-26T09:43:43.726-0700 I NETWORK [initandlisten] connection accepted from 127.0.0.1:58621 #10 (10 connections now open)
2015-09-26T09:43:43.810-0700 I INDEX [conn1] build index on: sma.destination properties: { v: 1, unique: true, key: { id: 1 }, name: "idx_destination_id", ns: "sma.destination" }
2015-09-26T09:43:43.810-0700 I INDEX [conn1] building index using bulk method
2015-09-26T09:43:57.164-0700 I NETWORK [initandlisten] connection accepted from 127.0.0.1:58640 #11 (11 connections now open)
2015-09-26T09:43:57.169-0700 I NETWORK [conn11] end connection 127.0.0.1:58640 (10 connections now open)
2015-09-26T09:43:57.431-0700 I NETWORK [initandlisten] connection accepted from 127.0.0.1:58641 #12 (11 connections now open)
2015-09-26T09:43:57.435-0700 I NETWORK [initandlisten] connection accepted from 127.0.0.1:58642 #13 (12 connections now open)
2015-09-26T09:43:57.436-0700 I NETWORK [initandlisten] connection accepted from 127.0.0.1:58643 #14 (13 connections now open)
2015-09-26T09:43:57.436-0700 I NETWORK [initandlisten] connection accepted from 127.0.0.1:58644 #15 (14 connections now open)
2015-09-26T09:43:57.437-0700 I NETWORK [initandlisten] connection accepted from 127.0.0.1:58645 #16 (15 connections now open)
2015-09-26T09:43:57.437-0700 I NETWORK [initandlisten] connection accepted from 127.0.0.1:58646 #17 (16 connections now open)
2015-09-26T09:43:57.437-0700 I NETWORK [initandlisten] connection accepted from 127.0.0.1:58647 #18 (17 connections now open)
2015-09-26T09:43:57.437-0700 I NETWORK [initandlisten] connection accepted from 127.0.0.1:58648 #19 (18 connections now open)
2015-09-26T09:43:57.437-0700 I NETWORK [initandlisten] connection accepted from 127.0.0.1:58649 #20 (19 connections now open)
2015-09-26T09:43:57.437-0700 I NETWORK [initandlisten] connection accepted from 127.0.0.1:58650 #21 (20 connections now open)
2015-09-26T09:43:57.487-0700 I INDEX [conn14] build index on: sma.destination properties: { v: 1, unique: true, key: { id: 1 }, name: "idx_destination_id", ns: "sma.destination" }
2015-09-26T09:43:57.487-0700 I INDEX [conn14] building index using bulk method
2015-09-26T09:44:16.559-0700 I NETWORK [initandlisten] connection accepted from 127.0.0.1:58677 #22 (21 connections now open)
2015-09-26T09:44:16.560-0700 I NETWORK [conn22] end connection 127.0.0.1:58677 (20 connections now open)
2015-09-26T09:44:16.766-0700 I NETWORK [initandlisten] connection accepted from 127.0.0.1:58678 #23 (21 connections now open)
2015-09-26T09:44:16.770-0700 I NETWORK [initandlisten] connection accepted from 127.0.0.1:58679 #24 (22 connections now open)
2015-09-26T09:44:16.771-0700 I NETWORK [initandlisten] connection accepted from 127.0.0.1:58680 #25 (23 connections now open)
2015-09-26T09:44:16.771-0700 I NETWORK [initandlisten] connection accepted from 127.0.0.1:58681 #26 (24 connections now open)
2015-09-26T09:44:16.771-0700 I NETWORK [initandlisten] connection accepted from 127.0.0.1:58682 #27 (25 connections now open)
2015-09-26T09:44:16.772-0700 I NETWORK [initandlisten] connection accepted from 127.0.0.1:58683 #28 (26 connections now open)
2015-09-26T09:44:16.772-0700 I NETWORK [initandlisten] connection accepted from 127.0.0.1:58684 #29 (27 connections now open)
2015-09-26T09:44:16.772-0700 I NETWORK [initandlisten] connection accepted from 127.0.0.1:58685 #30 (28 connections now open)
2015-09-26T09:44:16.772-0700 I NETWORK [initandlisten] connection accepted from 127.0.0.1:58686 #31 (29 connections now open)
2015-09-26T09:44:16.772-0700 I NETWORK [initandlisten] connection accepted from 127.0.0.1:58687 #32 (30 connections now open)
2015-09-26T09:44:16.791-0700 I INDEX [conn24] build index on: sma.destination properties: { v: 1, unique: true, key: { id: 1 }, name: "idx_destination_id", ns: "sma.destination" }
2015-09-26T09:44:16.792-0700 I INDEX [conn24] building index using bulk method
You can see that ReactiveMongo creates a pool of 10 connections each time a hot-reload occurs; the previous 10 connections don't get cleaned up. Eventually it gets to the max number of connections (currently ~ 200), and then mongo becomes inaccessible until I restart.
Presumably this wouldn't happen in prod, but I'm a little unnerved by it happening in dev in the first place. Is there any way I can close those connections when the app hot-reloads?
Had the same problem following slightly outdated tutorials (using Play 2.6)
From the docs:
http://reactivemongo.org/releases/0.12/documentation/tutorial/play.html
/*
* Get a JSONCollection (a Collection implementation that is designed to work
* with JsObject, Reads and Writes.)
* Note that the `collection` is not a `val`, but a `def`. We do _not_ store
* the collection reference to avoid potential problems in development with
* Play hot-reloading.
*/
def collection: Future[JSONCollection] = database.map(
_.collection[JSONCollection]("persons"))
In my case, replacing: val collection: JSonCollection to the format above solved my problem.
Now when reloading, it closes and reopens all the connections:
2017-08-15T15:32:50.991-0300 I - [conn2] end connection 127.0.0.1:58489 (10 connections now open)
2017-08-15T15:32:50.992-0300 I - [conn9] end connection 127.0.0.1:58496 (9 connections now open)
2017-08-15T15:32:50.992-0300 I - [conn4] end connection 127.0.0.1:58491 (8 connections now open)
2017-08-15T15:32:50.993-0300 I - [conn5] end connection 127.0.0.1:58492 (7 connections now open)
2017-08-15T15:32:50.994-0300 I - [conn6] end connection 127.0.0.1:58493 (6 connections now open)
and so on...

Mongodb : I used db.shutdownServer() but connections increased

In my terminal, I used db.shutdownServer() to restart the server.( and I also tried Ctrl+C to terminate.)
but after when I typed "sudo mongod", last connections are still alived and even more increased.
Like this...
0.1:63292 #46 (46 connections now open)
2015-06-23T20:49:25.249+0900 I NETWORK [initandlisten] connection accepted from 127.0.0.1:63293 #47 (47 connections now open)
2015-06-23T20:49:25.250+0900 I NETWORK [conn47] end connection 127.0.0.1:63293 (46 connections now open)
2015-06-23T20:49:25.253+0900 I NETWORK [initandlisten] connection accepted from 127.0.0.1:63294 #48 (47 connections now open)
2015-06-23T20:49:25.254+0900 I NETWORK [initandlisten] connection accepted from 127.0.0.1:63295 #49 (48 connections now open)
2015-06-23T20:49:25.254+0900 I NETWORK [initandlisten] connection accepted from 127.0.0.1:63296 #50 (49 connections now open)
2015-06-23T20:49:25.254+0900 I NETWORK [initandlisten] connection accepted from 127.0.0.1:63297 #51 (50 connections now open)
2015-06-23T20:49:25.254+0900 I NETWORK [initandlisten] connection accepted from 127.0.0.1:63298 #52 (51 connections now open)
2015-06-23T20:49:36.257+0900 I NETWORK [initandlisten] connection accepted from 127.0.0.1:63300 #53 (52 connections now open)
what is the problem?? Please let me know the reason. Thank you !