Sharding Not Enabled

521 views
Skip to first unread message

Stan

unread,
Jan 20, 2012, 12:56:20 PM1/20/12
to mongodb-user
MongoDB version 2.02. printShardingStatus() shows my databases as
enabled for sharding and the command
db.adminCommand({enableSharding:"policydb"}) returns { "ok" : 0,
"errmsg" : "already enabled" }. However, the command
db.adminCommand({shardCollection:"policydb:policies", key : {"_yymm":
1,"u":1}}) returns { "ok" : 0, "errmsg" : "sharding not enabled for
db" }.

This database was imported from another server that was enabled for
sharding (using mongodump and mongorestore).

Is there any way short of dropping the database and starting over to
shard my collections?

Scott Hernandez

unread,
Jan 20, 2012, 1:01:02 PM1/20/12
to mongod...@googlegroups.com
I believe you want db.adminCommand({shardCollection:"policydb.policies" ...

Note that you had a ":" in there before.

> --
> You received this message because you are subscribed to the Google Groups "mongodb-user" group.
> To post to this group, send email to mongod...@googlegroups.com.
> To unsubscribe from this group, send email to mongodb-user...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.
>

Stan McQueen

unread,
Jan 20, 2012, 1:04:50 PM1/20/12
to mongod...@googlegroups.com
Oh, duh! That's what I get for switching between editing Erlang source
and running javascript commands!

Thanks for spotting that.

Stan

Stan

unread,
Jan 20, 2012, 1:05:42 PM1/20/12
to mongodb-user
Yep, thanks very much. That's what I get for switching between editing
Erlang source and running MongoDB commands!

Steve Strong

unread,
Jan 20, 2012, 1:12:45 PM1/20/12
to mongod...@googlegroups.com, mongodb-user
and if you're anything like me, you keep using full stops instead of semicolons in the mongo shell :)

Sent from my iPhone

Scott Hernandez

unread,
Jan 24, 2012, 9:26:16 AM1/24/12
to mongod...@googlegroups.com
Yes, sometimes the little things matter.

Adewole Ogunyadeka

unread,
May 19, 2015, 11:14:27 AM5/19/15
to mongod...@googlegroups.com
Dear all,

I have installed Mongodb using the instructions given on https://jujucharms.com/mongodb/precise/40 and http://blog.xtremeghost.com/2012/11/lets-shard-something.html. After setting it up, I can see all my services exposed but I still get the message: this db does not have sharding enabled ... when I run the sh.status() command. I do not know how to go about resolving the problem. 

I have 5 nodes. I use node 1 as my mongos, and node 2 as my config server (running 3 instances). The configuration for  node 3, 4, and 5 are as follows: Node 3: shard1/0, shard2/1, shard3/2. Node 4: shard2/0, shard3/1, shard1/2 and Node 5 shard3/0,shard1/1, shard2/1.

What could be the problem.

Asya Kamsky

unread,
May 20, 2015, 1:20:05 AM5/20/15
to mongodb-user
I don't know where these instructions came from, I'm pretty sure if
you follow the tutorials at docs.mongodb.org for sharding you would
end up executing all the steps necessary to get your cluster running.

http://docs.mongodb.org/manual/administration/sharded-clusters/

Btw, please start a new conversation with a new topic rather than
replying to a thread from many years ago - makes it easier to follow
conversations.

Asya
> For other MongoDB technical support options, see:
> http://www.mongodb.org/about/support/.
> ---
> You received this message because you are subscribed to the Google Groups
> "mongodb-user" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mongodb-user...@googlegroups.com.
> To post to this group, send email to mongod...@googlegroups.com.
> Visit this group at http://groups.google.com/group/mongodb-user.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/mongodb-user/c238b26b-a445-4023-bb01-9a7b540d0785%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
MongoDB World is back! June 1-2 in NYC. Use code ASYA for 25% off!

Adewole Ogunyadeka

unread,
May 20, 2015, 6:06:33 AM5/20/15
to mongod...@googlegroups.com
Thank you Asya, The problem is that I installed Mongodb Shard in a cloud environment called juju charms https://jujucharms.com/ . This does not give me the flexibility to follow the steps on the website.
Reply all
Reply to author
Forward
0 new messages