[SERVER-1666] --replSet not assuming default port Created: 24/Aug/10  Updated: 19/May/14  Resolved: 17/Nov/10

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: 1.6.1
Fix Version/s: None

Type: Bug Priority: Minor - P4
Reporter: David Mytton Assignee: Kristina Chodorow (Inactive)
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

mongodb-linux-x86_64-1.6.1


Operating System: ALL
Participants:

 Description   

If you start mongod up as a shardsvr and specify the replSet without any ports, it should assume the default shardsvr port 27018, but it does not.

mongodb-linux-x86_64-1.6.1/bin/mongod --dbpath /root/data --fork --logpath log.log --shardsvr --replSet set2/ip-10-194-11-207.ec2.internal
> use admin
switched to db admin
> rs.initiate()
{
"startupStatus" : 4,
"info" : "set1/ip-10-245-118-48.ec2.internal",
"errmsg" : "all members and seeds must be reachable to initiate set",
"ok" : 0
}

mongodb-linux-x86_64-1.6.1/bin/mongod --dbpath /root/data --fork --logpath log.log --shardsvr --replSet set2/ip-10-194-11-207.ec2.internal:27018
> use admin
switched to db admin
> rs.initiate()
{
"info2" : "no configuration explicitly specified – making one",
"info" : "Config now saved locally. Should come online in about a minute.",
"ok" : 1
}



 Comments   
Comment by Kristina Chodorow (Inactive) [ 17/Nov/10 ]

It can't infer the port because it doesn't know who you're talking about when you give it a command line seed: you could legitimately be trying to add ip-10-194-11-207.ec2.internal:27017 as a seed. mongod can't know that you're trying to refer to itself.

You can avoid this by not giving a seed:

mongodb-linux-x86_64-1.6.1/bin/mongod --dbpath /root/data --fork --logpath log.log --shardsvr --replSet set2

Then rs.initiate() will figure out what's going on correctly.

Generated at Thu Feb 08 02:57:41 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.