SollmoStudio / beyond

Beyond: The Scalable Game Server Framework
http://www.beyondframework.com
Apache License 2.0
25 stars 9 forks source link

Implement MongoDB config server launcher. #193

Closed hatashiro closed 9 years ago

hatashiro commented 9 years ago

The first commit is to separate some configs of MongoDB into a separated object, because there will be more settings that will be added and they will make the original configuration complicated.

The other commit is to implement a launcher to launch a MongoDB config server.

hatashiro commented 9 years ago

BTW, when tested in my environment, it keeps printing the following message.

[error] r.api.Failover - 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) ~[reactivemongo_2.10-0.10.5.akka23-SNAPSHOT.jar:0.10.5.akka23-SNAPSHOT]
        at reactivemongo.core.actors.MongoDBSystem$$anonfun$pickChannel$4.apply(actors.scala:508) ~[reactivemongo_2.10-0.10.5.akka23-SNAPSHOT.jar:0.10.5.akka23-SNAPSHOT]
        at reactivemongo.core.actors.MongoDBSystem$$anonfun$pickChannel$4.apply(actors.scala:508) ~[reactivemongo_2.10-0.10.5.akka23-SNAPSHOT.jar:0.10.5.akka23-SNAPSHOT]
        at scala.Option.getOrElse(Option.scala:120) ~[scala-library.jar:na]
        at reactivemongo.core.actors.MongoDBSystem.pickChannel(actors.scala:508) ~[reactivemongo_2.10-0.10.5.akka23-SNAPSHOT.jar:0.10.5.akka23-SNAPSHOT]

I couldn't find where the error comes from. I think ReactiveMongo is not needed to be turned on for config servers, so I'd like to turn it off but I can't find out how to turn it off.

Any idea?

hatashiro commented 9 years ago

Cause it works only in production mode, you can manually test it with the following command:

activator run -Dbeyond.mongodb.type="config" -Dbeyond.standalone-mode=true -Dbeyond.mongodb.config.dbpath="data/dev/mongo/configsvr" -Dbeyond.mongodb.config.port="27019"
sgkim126 commented 9 years ago

Why do you using 'svr' instead of 'server'? Do you has a reason for using abbreviation?

hatashiro commented 9 years ago

No specific reason. Just it's used in mongod as well like --configsvr. Would it be better to change it to server?

sgkim126 commented 9 years ago

I prefer to avoid abbreviation if there is no significant reason. So I want to use server even if the option is --configsvr. But it's just my flavor. If you want to use svr I'll not care about it.

The others are LGTM.

hatashiro commented 9 years ago

I'll change them to server. Btw, I've found a problem in the implementation about port. It must be a address:port format, cause they will be used by mongoss.

I'll modify a little bit and upload this again till tmr.

hatashiro commented 9 years ago

nvm. I think port must be enough for the manual version. I've updated this PR.