SollmoStudio / beyond

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

Add argv for sharding and stuff #179

Closed hatashiro closed 9 years ago

hatashiro commented 9 years ago

Concerning #167.

The first patch is to add use-sharding option for MongoDB. Sharding itself hasn't been added yet.

The other is to separate a common part of MongoDBStandaloneLauncher into MongoDBLauncher, as it can be used in another MongoDB instance launchers.

@sgkim126 @murmur76 @kimchoco, please review this.

sgkim126 commented 9 years ago

Do we need mongodb.use-sharding? I think we treat it as a standalone if there is only one server in mongodb.servers. Is there the case that we use only one mongos except standalone mode?

hatashiro commented 9 years ago

mongos and shards are different. mongos is just a routing server and shards are mongod instances. There can be a situation where we have only one mongos with several shards.

sgkim126 commented 9 years ago

I think I choose wrong words. I'll ask you again.

As I know there is no use case that uses single mongos and multiple mongod, because mongos becomes single point of failure. And also there is no use case that uses multiple mongos and single mongod, because it's not meaningful. In this reason we use single mngod and single mongos for test, and multiple mongod and multiple mongos for deploy. I think we can treat it's deploy mode and has to start mongod only if it has multiple mongos server, isn't it?

hatashiro commented 9 years ago

Fair enough. I've understood we don't need the config variable and thought about it a bit more. How about the design like below?

I think anyway we should have some way to tell which instance we should turn on. Any idea?

sgkim126 commented 9 years ago

Your proposal looks good.

hatashiro commented 9 years ago

Then I'll change the design as I explained in the comment.

hatashiro commented 9 years ago

I've just given a quick look to Scala and Play documentations, but I can't figure out how to get command line arguments in Play. Is there any easy way to do this?

Added: I've found some information here, but there's only a way which is using something like --Dbeyond.some.config=value. We may be able to use a configuration like --Dbeyond.mongodb.type=config, but then Beyond should keep and compare the config as a string and I think it's not very good idea. If you have any suggestion, pls tell me.

hatashiro commented 9 years ago

PR updated.

I couldn't find a way to get Java command line args in Play, so I've just implemented a patch using --Dbeyond.mongodb.type. By that, inevitably I used a config val again. If there's any better way, please feel free to comment here.

sgkim126 commented 9 years ago

LGTM

hatashiro commented 9 years ago

Merged.