Closed hatashiro closed 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?
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.
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?
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?
mongod
--mongo-configsvr
argv -> mongod --configsvr
--mongo-shard
argv -> mongod --replSet
--mongo-routing
argv -> mongos
I think anyway we should have some way to tell which instance we should turn on. Any idea?
Your proposal looks good.
Then I'll change the design as I explained in the comment.
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.
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.
LGTM
Merged.
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
intoMongoDBLauncher
, as it can be used in another MongoDB instance launchers.@sgkim126 @murmur76 @kimchoco, please review this.