[SERVER-1611] Allow localhost in replicaset addshard if all setting is localhost only Created: 18/Aug/10  Updated: 12/Jul/16  Resolved: 27/Aug/10

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 1.6.2, 1.7.0

Type: Bug Priority: Minor - P4
Reporter: Alberto Lerner Assignee: Alberto Lerner
Resolution: Done Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: ALL
Participants:

 Description   

-----------------------------------------------
MongoDB shell version: 1.6.0
Linux local 2.6.31-20-generic #58-Ubuntu SMP Fri Mar 12 04:38:19 UTC
2010 x86_64 GNU/Linux

./bin/mongod --noprealloc -vvvvv --rest --replSet rep0/localhost:10001
--shardsvr --dbpath ./db/dbshard.0/rep0 --port 10000
./bin/mongod --noprealloc -vvvvv --rest --replSet rep0/localhost:10000
--shardsvr --dbpath ./db/dbshard.0/rep1 --port 10001
./bin/mongod --noprealloc -vvvvv --rest --replSet rep1/localhost:10011
--shardsvr --dbpath ./db/dbshard.1/rep0 --port 10010
./bin/mongod --noprealloc -vvvvv --rest --replSet rep1/localhost:10010
--shardsvr --dbpath ./db/dbshard.1/rep1 --port 10011

./bin/mongod --noprealloc -vvvvv --configsvr --dbpath ./db/config –
port 20000
./bin/mongos -vvvvv --configdb localhost:20000 --chunkSize 11
===============
./bin/mongo localhost:10000

config = {_id: 'rep0', members: [
{_id: 0, host: 'localhost:10000'},
{_id: 1, host: 'localhost:10001'}]
}
rs.initiate(config);

./bin/mongo localhost:10010

config = {_id: 'rep1', members: [
{_id: 0, host: 'localhost:10010'},
{_id: 1, host: 'localhost:10011'}]
}
rs.initiate(config);
========================

./bin/mongo
use admin
switched to db admin
> db.runCommand(

{ addshard : "rep0/localhost:10000,localhost:10001", allowLocal:1,maxSize:11 }

);
{
"ok" : 0,
"errmsg" : "can't use localhost as a shard since all shards
need to
communicate. either use all shards and configdbs in localhost or all
in actual IPs "
}



 Comments   
Comment by auto [ 31/Aug/10 ]

Author:

{'login': 'alerner', 'name': 'Alberto Lerner', 'email': 'alerner@10gen.com'}

Message: SERVER-1611 allow localhost in a replica-set-based shard
http://github.com/mongodb/mongo/commit/9ff3ddc94431010bda13547efde375a81fc11bf4

Comment by auto [ 27/Aug/10 ]

Author:

{'login': 'alerner', 'name': 'Alberto Lerner', 'email': 'alerner@10gen.com'}

Message: SERVER-1611 allow localhost in a replica-set-based shard
http://github.com/mongodb/mongo/commit/0206ce9041d5cbba2cd6ffec210356043747d404

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