[SERVER-2086] Prevent creating collections on the 'admin' database and sharding them Created: 09/Nov/10 Updated: 12/Jul/16 Resolved: 31/Mar/11 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Sharding |
| Affects Version/s: | None |
| Fix Version/s: | 1.9.0 |
| Type: | Bug | Priority: | Trivial - P5 |
| Reporter: | Alberto Lerner | Assignee: | Eliot Horowitz (Inactive) |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Operating System: | ALL |
| Participants: |
| Description |
|
1.I'm running shard server ./mongod --shardsvr --dbpath /data/r1/ --port 10000 2.Configuration server ./mongod --configsvr --dbpath /data/db/config/ --port 20000 3.mongos server 4.client ./mongo localhost:30000/admin Here I'm creating collection table and insert with 1 key called and then i performing these steps to add and enable sharding > db.runCommand( { addshard : "localhost:10000" }); { "shardAdded" : "shard0000", "ok" : 1 }> db.runCommand( { enablesharding : "admin" }) { "ok" : 1 }>db.table1.ensureIndex( { name: 1 }); > db.runCommand( { shardcollection : "admin.table1",key : {name : 1},unique:true }); { "collectionsharded" : "admin.table1", "ok" : 1 }>db.printShardingStatus() — Sharding Status — shards: { "_id" : "shard0000", "host" : "localhost:10000" }databases: { "_id" : "admin", "partitioned" : true, "primary" : "config" } admin.table1 chunks: } -->> { "name" : { $maxKey : 1 } } on : when i want to see the collection items it's showing like this > db.table1.find(); |
| Comments |
| Comment by auto [ 31/Mar/11 ] |
|
Author: {u'login': u'erh', u'name': u'Eliot Horowitz', u'email': u'eliot@10gen.com'}Message: don't allow sharding admin db |