Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3667352
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T01:59:23+00:00 2026-05-19T01:59:23+00:00

When i am trying to enable the shard… I am getting following errors…….. use

  • 0

When i am trying to enable the shard… I am getting following errors……..

use admin
switched to db admin
> db.runCommand( { enablesharding : "sgserver" } )
{ "ok" : 1 }
> db.runCommand( { shardcollection : "sgserver.block_seek_pos", key : {fileGUID : 1} } )

"ok" : 0,
"errmsg" : "please create an index over the sharding key before sharding."

> db.sgserver.ensureIndex({"fileGUID": 1})
> db.runCommand( { shardcollection : "sgserver.block_seek_pos", key : {fileGUID : 1} } )

"ok" : 0,
"errmsg" : "please create an index over the sharding key before sharding."

Its insisting that I create an index, but if I try to create an index I am getting the above mentioned error.

Can anyone help me out with this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T01:59:24+00:00Added an answer on May 19, 2026 at 1:59 am

    Is the sgserver collection inside of the admin database?

    I don’t see the command where you switch to the correct database before you do ensureIndex(). The code should probably look like this:

    db.runCommand( { enablesharding : "sgserver" } );
    use sgserver;
    db.sgserver.ensureIndex({"fileGUID": 1});
    db.runCommand( { shardcollection : "sgserver.block_seek_pos", key : {fileGUID : 1} } )
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to use page methods in my asp.net page. I have enable
I am trying to enable Full-text indexing in SQL Server 2005 Express. I am
I'm trying to enable SqlCacheDependency through my StructureMap IoC, I'm using LinqToSql I have
I am trying to enable these debugging preferences (NSShowAllViews, NSShowAllDrawing) as shown here: http://developer.apple.com/technotes/tn2004/tn2124.html#SECAPPKITVIEWS
I have a number of custom controls that I am trying to enable designer
I'm trying to iterate all the controls on a form and enable ClearType font
I'm trying to use rvm to install Ruby 1.9.2 on my Mac running Snow
I am trying to load Linq on my .Net 3.5 enabled web server by
I'm trying to follow a simple example of AJAX-enabled WCF Service like: http://www.pluralsight.com/community/blogs/fritz/archive/2008/01/31/50121.aspx I'm
I am trying to rewrite URLs using mod_rewrite. It is enabled in httpd.conf and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.