axlfu | 25 Mar 08:56 2011
Picon

A problem when updating mongod from Non-Sharded System

First, I create a sharding env ,see http://www.mongodb.org/display/DOCS/A+Sample+Configuration+Session
Then startup a new mongod localhost:10002, and want to add this mongod
to sharding,
> db.runCommand( { addshard : "localhost:10002"})
{
        "ok" : 0,
        "errmsg" : "can't add shard localhost:10002 because a local
database 'te
st' exists in another shard0000:localhost:10000"

why? The page http://www.mongodb.org/display/DOCS/Upgrading+from+a+Non-Sharded+System
says:
All the databases of your mongod-process-turned-shard can be chunked
and balanced among the cluster's shards. The commands and examples to
do so are listed at the Configuring Sharding page

Eliot Horowitz | 25 Mar 12:56 2011
Picon

Re: A problem when updating mongod from Non-Sharded System

What version are you trying this with?

On Fri, Mar 25, 2011 at 3:56 AM, axlfu <freesearch81@...> wrote:
> First, I create a sharding env ,see http://www.mongodb.org/display/DOCS/A+Sample+Configuration+Session
> Then startup a new mongod localhost:10002, and want to add this mongod
> to sharding,
>> db.runCommand( { addshard : "localhost:10002"})
> {
>        "ok" : 0,
>        "errmsg" : "can't add shard localhost:10002 because a local
> database 'te
> st' exists in another shard0000:localhost:10000"
>
> why? The page http://www.mongodb.org/display/DOCS/Upgrading+from+a+Non-Sharded+System
> says:
> All the databases of your mongod-process-turned-shard can be chunked
> and balanced among the cluster's shards. The commands and examples to
> do so are listed at the Configuring Sharding page
>
> --
> You received this message because you are subscribed to the Google Groups "mongodb-user" group.
> To post to this group, send email to mongodb-user@...
> To unsubscribe from this group, send email to mongodb-user+unsubscribe <at> googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.
>
>

--

-- 
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To post to this group, send email to mongodb-user@...
(Continue reading)

axlfu | 25 Mar 16:41 2011
Picon

Re: A problem when updating mongod from Non-Sharded System

1.8.0

On Mar 25, 11:56 am, Eliot Horowitz <eliothorow...@...> wrote:
> What version are you trying this with?
>
> On Fri, Mar 25, 2011 at 3:56 AM, axlfu <freesearc...@...> wrote:
> > First, I create a sharding env ,seehttp://www.mongodb.org/display/DOCS/A+Sample+Configuration+Session
> > Then startup a new mongod localhost:10002, and want to add this mongod
> > to sharding,
> >> db.runCommand( { addshard : "localhost:10002"})
> > {
> >        "ok" : 0,
> >        "errmsg" : "can't add shard localhost:10002 because a local
> > database 'te
> > st' exists in another shard0000:localhost:10000"
>
> > why? The pagehttp://www.mongodb.org/display/DOCS/Upgrading+from+a+Non-Sharded+System
> > says:
> > All the databases of your mongod-process-turned-shard can be chunked
> > and balanced among the cluster's shards. The commands and examples to
> > do so are listed at the Configuring Sharding page
>
> > --
> > You received this message because you are subscribed to the Google Groups "mongodb-user" group.
> > To post to this group, send email to mongodb-user@...
> > To unsubscribe from this group, send email to mongodb-user+unsubscribe <at> googlegroups.com.
> > For more options, visit this group athttp://groups.google.com/group/mongodb-user?hl=en.

--

-- 
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
(Continue reading)

axlfu | 25 Mar 16:43 2011
Picon

Re: A problem when updating mongod from Non-Sharded System

1.8.0
windows xp

On Mar 25, 11:56 am, Eliot Horowitz <eliothorow...@...> wrote:
> What version are you trying this with?
>
> On Fri, Mar 25, 2011 at 3:56 AM, axlfu <freesearc...@...> wrote:
> > First, I create a sharding env ,seehttp://www.mongodb.org/display/DOCS/A+Sample+Configuration+Session
> > Then startup a new mongod localhost:10002, and want to add this mongod
> > to sharding,
> >> db.runCommand( { addshard : "localhost:10002"})
> > {
> >        "ok" : 0,
> >        "errmsg" : "can't add shard localhost:10002 because a local
> > database 'te
> > st' exists in another shard0000:localhost:10000"
>
> > why? The pagehttp://www.mongodb.org/display/DOCS/Upgrading+from+a+Non-Sharded+System
> > says:
> > All the databases of your mongod-process-turned-shard can be chunked
> > and balanced among the cluster's shards. The commands and examples to
> > do so are listed at the Configuring Sharding page
>
> > --
> > You received this message because you are subscribed to the Google Groups "mongodb-user" group.
> > To post to this group, send email to mongodb-user@...
> > To unsubscribe from this group, send email to mongodb-user+unsubscribe <at> googlegroups.com.
> > For more options, visit this group athttp://groups.google.com/group/mongodb-user?hl=en.

--

-- 
(Continue reading)

Eliot Horowitz | 25 Mar 16:45 2011
Picon

Re: Re: A problem when updating mongod from Non-Sharded System

Oh, sorry, I read your original email wrong.

It seems you have a "test" database on the shard.
You need to remove that database before adding it since you had a test
database on a previous shard.

On Fri, Mar 25, 2011 at 11:43 AM, axlfu <freesearch81@...> wrote:
> 1.8.0
> windows xp
>
> On Mar 25, 11:56 am, Eliot Horowitz <eliothorow...@...> wrote:
>> What version are you trying this with?
>>
>> On Fri, Mar 25, 2011 at 3:56 AM, axlfu <freesearc...@...> wrote:
>> > First, I create a sharding env ,seehttp://www.mongodb.org/display/DOCS/A+Sample+Configuration+Session
>> > Then startup a new mongod localhost:10002, and want to add this mongod
>> > to sharding,
>> >> db.runCommand( { addshard : "localhost:10002"})
>> > {
>> >        "ok" : 0,
>> >        "errmsg" : "can't add shard localhost:10002 because a local
>> > database 'te
>> > st' exists in another shard0000:localhost:10000"
>>
>> > why? The pagehttp://www.mongodb.org/display/DOCS/Upgrading+from+a+Non-Sharded+System
>> > says:
>> > All the databases of your mongod-process-turned-shard can be chunked
>> > and balanced among the cluster's shards. The commands and examples to
>> > do so are listed at the Configuring Sharding page
>>
(Continue reading)

axlfu | 25 Mar 17:46 2011
Picon

Re: A problem when updating mongod from Non-Sharded System

But http://www.mongodb.org/display/DOCS/Configuring+Sharding
It's said that

Once you've added one or more shards, you can enable sharding on a
database. This is an important step; without it, all data in the
database will be stored on the same shard.

> db.runCommand( { enablesharding : "<dbname>" } );
Once enabled, mongos will place new collections on the primary shard
for that database. Existing collections within the database will stay
on the original shard.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To enable real partitioning of data, we have to shard an individual
collection.

As you say ,if existing collections, it cannot be added as s shard

On Mar 25, 3:45 pm, Eliot Horowitz <eliothorow...@...> wrote:
> Oh, sorry, I read your original email wrong.
>
> It seems you have a "test" database on the shard.
> You need to remove that database before adding it since you had a test
> database on a previous shard.
>
> On Fri, Mar 25, 2011 at 11:43 AM, axlfu <freesearc...@...> wrote:
> > 1.8.0
> > windows xp
>
> > On Mar 25, 11:56 am, Eliot Horowitz <eliothorow...@...> wrote:
(Continue reading)

Eliot Horowitz | 25 Mar 19:56 2011
Picon

Re: Re: A problem when updating mongod from Non-Sharded System

You get that error if you have the same database on 2 different shards.
That obviously cannot work since you don't know which one is the real one.

On Fri, Mar 25, 2011 at 12:46 PM, axlfu <freesearch81@...> wrote:
> But http://www.mongodb.org/display/DOCS/Configuring+Sharding
> It's said that
>
> Once you've added one or more shards, you can enable sharding on a
> database. This is an important step; without it, all data in the
> database will be stored on the same shard.
>
>> db.runCommand( { enablesharding : "<dbname>" } );
> Once enabled, mongos will place new collections on the primary shard
> for that database. Existing collections within the database will stay
> on the original shard.
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> To enable real partitioning of data, we have to shard an individual
> collection.
>
> As you say ,if existing collections, it cannot be added as s shard
>
>
> On Mar 25, 3:45 pm, Eliot Horowitz <eliothorow...@...> wrote:
>> Oh, sorry, I read your original email wrong.
>>
>> It seems you have a "test" database on the shard.
>> You need to remove that database before adding it since you had a test
>> database on a previous shard.
>>
(Continue reading)

axlfu | 26 Mar 03:02 2011
Picon

Re: A problem when updating mongod from Non-Sharded System

Yes , I see.
Maybe it should be written on the page as a note, the shard nodes
can't have same name database except the database is empty

 Horowitz <eliothorow...@...> wrote:
> You get that error if you have the same database on 2 different shards.
> That obviously cannot work since you don't know which one is the real one.
>
> On Fri, Mar 25, 2011 at 12:46 PM, axlfu <freesearc...@...> wrote:
> > Buthttp://www.mongodb.org/display/DOCS/Configuring+Sharding
> > It's said that
>
> > Once you've added one or more shards, you can enable sharding on a
> > database. This is an important step; without it, all data in the
> > database will be stored on the same shard.
>
> >> db.runCommand( { enablesharding : "<dbname>" } );
> > Once enabled, mongos will place new collections on the primary shard
> > for that database. Existing collections within the database will stay
> > on the original shard.
>
> > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > To enable real partitioning of data, we have to shard an individual
> > collection.
>
> > As you say ,if existing collections, it cannot be added as s shard
>
> > On Mar 25, 3:45 pm, Eliot Horowitz <eliothorow...@...> wrote:
> >> Oh, sorry, I read your original email wrong.
>
(Continue reading)


Gmane