[SERVER-18886] Cannot shard database DCU using id as hash shard key Created: 09/Jun/15  Updated: 09/Jun/15  Resolved: 09/Jun/15

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

Type: Question Priority: Critical - P2
Reporter: Van Pham Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:

 Description   

I ran the following :

sh.shardCollection(“DCU.UserData", { "id": "hashed" } )

and I simply cannot shard based on that key. Why ? This is a new production server we are setting up in AWS.

mongos> sh.shardCollection(“DCU.UserData", { "id": "hashed" } )
2015-06-08T17:09:28.921-0700 E QUERY    SyntaxError: Unexpected token ILLEGAL
mongos> sh.shardCollection( “DCU.UserData", {  id: "hashed" } )
2015-06-08T17:13:18.759-0700 E QUERY    SyntaxError: Unexpected token ILLEGAL
mongos> sh.shardCollection( “DCU.UserData", { id: "hashed" } )
2015-06-08T17:14:41.012-0700 E QUERY    SyntaxError: Unexpected token ILLEGAL



 Comments   
Comment by Van Pham [ 09/Jun/15 ]

Perfect, it was MS words that put the extra charater at the end of the line and screw up my work. Thank you.

Comment by Kaloian Manassiev (Personal) [ 09/Jun/15 ]

The message is not very descriptive, but is it possible that it's due to the quote-looking symbol that's actually not an opening quote?

Try this:

sh.shardCollection( "DCU.UserData",

{ id: "hashed" }

);

Comment by Michael O'Brien [ 09/Jun/15 ]

Hi Van,
It looks like the first quote character before DCU is the wrong one. try

sh.shardCollection( "DCU.UserData",{ id: "hashed" })

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