10gen / mongo-orchestration

Apache License 2.0
7 stars 11 forks source link

Cannot create a sharded cluster with multiple config servers with MongoDB > 3.3.2 #220

Closed ShaneHarvey closed 8 years ago

ShaneHarvey commented 8 years ago

The sharded cluster config server logic does not allow more than one config server for MongoDB > 3.3.2. For example, trying to launch 3.4.0-rc0 with 3 config servers:

{
    "configsvrs": [{"port": 27020}, {"port": 27021}, {"port": 27022}],
    "routers": [ {"port": 27017}],
    "shards": [
        {
            "id": "demo-set-0",
            "shardParams": {
                "members": [
                    {
                        "procParams": {"port": 27018}
                    }
                ]
            }
        },
        {
            "id": "demo-set-1",
            "shardParams": {
                "members": [
                    {
                        "procParams": {"port": 27019}
                    }
                ]
            }
        }
    ],
    "version": "3.4.0-rc0"
}

Results in the following exception:

Traceback (most recent call last):
  File "/Users/shane/git/mongo-orchestration/mongo_orchestration/apps/__init__.py", line 62, in wrap
    return f(*arg, **kwd)
  File "/Users/shane/git/mongo-orchestration/mongo_orchestration/apps/sharded_clusters.py", line 68, in sh_create
    result = _sh_create(data)
  File "/Users/shane/git/mongo-orchestration/mongo_orchestration/apps/sharded_clusters.py", line 44, in _sh_create
    cluster_id = ShardedClusters().create(params)
  File "/Users/shane/git/mongo-orchestration/mongo_orchestration/sharded_clusters.py", line 465, in create
    cluster = ShardedCluster(params)
  File "/Users/shane/git/mongo-orchestration/mongo_orchestration/sharded_clusters.py", line 74, in __init__
    'mongos >= 3.3.2 requires the config database to be backed by '
mongo_orchestration.errors.ShardedClusterError: mongos >= 3.3.2 requires the config database to be backed by a replica set.
bjori commented 8 years ago

The error is legit.

mongos >= 3.3.2 requires the config database to be backed by a replica set.
ShaneHarvey commented 8 years ago

I thought mongo-orchestration was supposed to interpret "configsvrs": [{"port": 27020}, {"port": 27021}, {"port": 27022}] as a 3 node replica set. If that's not true then I guess this is indeed a non-issue.