[SERVER-7713] WIll mongos work with a replica-set (without sharding)? Created: 19/Nov/12  Updated: 06/Apr/23  Resolved: 19/Nov/12

Status: Closed
Project: Core Server
Component/s: Replication
Affects Version/s: 2.2.1
Fix Version/s: None

Type: Question Priority: Minor - P4
Reporter: Brian Konash Assignee: Scott Hernandez (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

staging


Participants:

 Description   

re: SERVER-1594

Will mongos work with a replica-set (without sharding)?

Env:

mongos> use admin
switched to db admin
mongos> db.runCommand(

{ listShards : 1 }

);
{
"shards" : [

{ "_id" : "sshard1ReplSet", "host" : "sshard1ReplSet/nyc-smongodb02.sta.peer1.squarespace.net:27017,nyc-smongodb03.sta.peer1.squarespace.net:27017,sdbm075:27017" }

],
"ok" : 1
}
mongos>



 Comments   
Comment by Brian Konash [ 19/Nov/12 ]

Thanks Scott. Please close.

Comment by Scott Hernandez (Inactive) [ 19/Nov/12 ]

Yes, this is a sharded cluster with one shard, and no sharded collections; it is a fine configuration.

Comment by Brian Konash [ 19/Nov/12 ]

This is what staging looks like. We just want to use mongo-s as a proxy for now.

mongos> use config
switched to db config
mongos> db.databases.find()

{ "_id" : "admin", "partitioned" : false, "primary" : "config" } { "_id" : "SquarespaceEvents", "partitioned" : false, "primary" : "sshard1ReplSet" } { "_id" : "Squarespace", "partitioned" : false, "primary" : "sshard1ReplSet" } { "_id" : "AccountLifecycleEvents", "partitioned" : false, "primary" : "sshard1ReplSet" } { "_id" : "test", "partitioned" : false, "primary" : "sshard1ReplSet" }

mongos> use admin
switched to db admin
mongos> db.runCommand(

{ listShards : 1 }

)
{
"shards" : [

{ "_id" : "sshard1ReplSet", "host" : "sshard1ReplSet/nyc-smongodb02.sta.peer1.squarespace.net:27017,nyc-smongodb03.sta.peer1.squarespace.net:27017,sdbm075:27017" }

],
"ok" : 1
}
mongos>

Comment by Brian Konash [ 19/Nov/12 ]

So I can enable sharding on the DB and I can wait on sharding the collections? I realize this is not standard. We're trying to just test the mongo-s part while we get our shard keys decided.

Comment by Scott Hernandez (Inactive) [ 19/Nov/12 ]

The sharding part we are talking in the other issue is the config servers and config database.

You can use mongos (with config db/servers) and one shard without sharding any collections if that is what you are asking. This seems to be your setup.

Generated at Thu Feb 08 03:15:23 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.