Jon | 23 Aug 15:06 2010
Picon

configserver setup question

Hi,

I'm using a two node setup (alpha01/alpha02) for some testing, and i'm
having some confusion i was hoping somebody could help me clear up.
(the two nodes are sharded replica sets).  I wanted to be able to
knock down one of my two nodes and see if it continued to function.

In the docs -> http://www.mongodb.org/display/DOCS/Sharding+and+Failover
it says "A production shard cluster will have three config server
processes, each existing on a separate machine. "

i realize i'm tryin to fudge things with just two, but should i be
trying to replicate the configsvr process?  i gave it a shot, and it
won't let me configure it,

mongod --fork --replSet pok --configsvr --dbpath /data/db/config --
port 20000 --logpath /var/log/mongodb/mongo.log
> rs.initiate(config);
	"errmsg" : "couldn't initiate : member alpha02.mdc.gameloft.org:20000
has data already, cannot initiate set.  All members except initiator
must be empty.",
	"ok" : 0

If i try and setup my environment without replicated config servers (1
per server), as below..
using 1.6.1
SERVER 1
 9472 ?        Sl    33:51 mongod --replSet foo --shardsvr --dbpath /
data/db/shard00 --port 10000 --logpath /var/log/mongodb/mongo.log --
fork
(Continue reading)

Kristina Chodorow | 23 Aug 15:10 2010

Re: configserver setup question

The config servers will sync themselves.  Just start up three without the replSet option and start a mongos with

./mongos --configdb config1,config2,config3

(where configN is the host/port of each config server).  It'll work itself out.


On Mon, Aug 23, 2010 at 9:06 AM, Jon <not.jon.taylor-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
Hi,

I'm using a two node setup (alpha01/alpha02) for some testing, and i'm
having some confusion i was hoping somebody could help me clear up.
(the two nodes are sharded replica sets).  I wanted to be able to
knock down one of my two nodes and see if it continued to function.

In the docs -> http://www.mongodb.org/display/DOCS/Sharding+and+Failover
it says "A production shard cluster will have three config server
processes, each existing on a separate machine. "

i realize i'm tryin to fudge things with just two, but should i be
trying to replicate the configsvr process?  i gave it a shot, and it
won't let me configure it,

mongod --fork --replSet pok --configsvr --dbpath /data/db/config --
port 20000 --logpath /var/log/mongodb/mongo.log
> rs.initiate(config);
       "errmsg" : "couldn't initiate : member alpha02.mdc.gameloft.org:20000
has data already, cannot initiate set.  All members except initiator
must be empty.",
       "ok" : 0


If i try and setup my environment without replicated config servers (1
per server), as below..
using 1.6.1
SERVER 1
 9472 ?        Sl    33:51 mongod --replSet foo --shardsvr --dbpath /
data/db/shard00 --port 10000 --logpath /var/log/mongodb/mongo.log --
fork
 9562 ?        Sl    32:59 mongod --replSet foo2 --shardsvr --dbpath /
data/db/shard01 --port 10001 --logpath /var/log/mongodb/mongo.log --
fork
29364 ?        Sl     0:00 mongod --fork --configsvr --dbpath /data/db/
config --port 20000 --logpath /var/log/mongodb/mongo.log
29381 ?        Sl     0:00 mongos --fork --configdb
alpha01.mdc.gameloft.org:20000 --chunkSize 1 --logpath /var/log/
mongodb/mongos.log
SERVER 2
 872 ?        Sl     0:00 mongod --fork --configsvr --dbpath /data/db/
config --port 20000 --logpath /var/log/mongodb/mongo.log
 881 ?        Sl     0:00 mongos --fork --configdb
alpha02.mdc.gameloft.org:20000 --chunkSize 1 --logpath /var/log/
mongodb/mongos.log
 2725 ?        Sl    95:36 mongod --replSet foo --shardsvr --dbpath /
data/db/shard00 --port 10000 --logpath /var/log/mongodb/mongo.log --
fork
 2835 ?        Sl    91:31 mongod --replSet foo2 --shardsvr --dbpath /
data/db/shard01 --port 10001 --logpath /var/log/mongodb/mongo.log --
fork

when i connect to mongo on the 2nd server..
[root <at> alpha01 ~]# mongo mydb
MongoDB shell version: 1.6.1
connecting to: mydb
> show collections;
mycollection
system.indexes
>

[root <at> alpha02 db]# mongo mydb
MongoDB shell version: 1.6.1
connecting to: mydb
> show collections;
Mon Aug 23 13:02:02 uncaught exception: error: { "$err" : "can't find
a shard to put new db on", "code" : 10185 }
>

If i kill the mongos process on alpha02, and point it to alpha01, i
can connect fine, which makes sense.. but if alpha01 goes down, i've
effectively lost my database.

How do i sync the configurations between servers?

Thanks for any help.

--
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To unsubscribe from this group, send email to mongodb-user+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
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.
Jon | 23 Aug 15:44 2010
Picon

Re: configserver setup question

Hi,

thanks for the quick response,  got a follow up question tho...

my log file says :
Mon Aug 23 13:33:19 need either 1 or 3 configdbs

my understanding is the config db part is done by the configsvr
process (mongod).  and that the mongos process just points to all the
config servers.  so in my case, i can't have two, because of the 1 or
3 limitation. (any way to bypass this?)   which prevents me from
having a 2 node redundant system.  so in order to have a redundant
mongo system, i need a minimum of 3 pieces of hardware?  I can't seem
to run 2nd one on the same server because of the lock file.

On Aug 23, 9:10 am, Kristina Chodorow <krist...@...> wrote:
> The config servers will sync themselves.  Just start up three without the
> replSet option and start a mongos with
>
> ./mongos --configdb config1,config2,config3
>
> (where configN is the host/port of each config server).  It'll work itself
> out.
>
> On Mon, Aug 23, 2010 at 9:06 AM, Jon <not.jon.tay...@...> wrote:
> > Hi,
>
> > I'm using a two node setup (alpha01/alpha02) for some testing, and i'm
> > having some confusion i was hoping somebody could help me clear up.
> > (the two nodes are sharded replica sets).  I wanted to be able to
> > knock down one of my two nodes and see if it continued to function.
>
> > In the docs ->http://www.mongodb.org/display/DOCS/Sharding+and+Failover
> > it says "A production shard cluster will have three config server
> > processes, each existing on a separate machine. "
>
> > i realize i'm tryin to fudge things with just two, but should i be
> > trying to replicate the configsvr process?  i gave it a shot, and it
> > won't let me configure it,
>
> > mongod --fork --replSet pok --configsvr --dbpath /data/db/config --
> > port 20000 --logpath /var/log/mongodb/mongo.log
> > > rs.initiate(config);
> >        "errmsg" : "couldn't initiate : member
> > alpha02.mdc.gameloft.org:20000
> > has data already, cannot initiate set.  All members except initiator
> > must be empty.",
> >        "ok" : 0
>
> > If i try and setup my environment without replicated config servers (1
> > per server), as below..
> > using 1.6.1
> > SERVER 1
> >  9472 ?        Sl    33:51 mongod --replSet foo --shardsvr --dbpath /
> > data/db/shard00 --port 10000 --logpath /var/log/mongodb/mongo.log --
> > fork
> >  9562 ?        Sl    32:59 mongod --replSet foo2 --shardsvr --dbpath /
> > data/db/shard01 --port 10001 --logpath /var/log/mongodb/mongo.log --
> > fork
> > 29364 ?        Sl     0:00 mongod --fork --configsvr --dbpath /data/db/
> > config --port 20000 --logpath /var/log/mongodb/mongo.log
> > 29381 ?        Sl     0:00 mongos --fork --configdb
> > alpha01.mdc.gameloft.org:20000 --chunkSize 1 --logpath /var/log/
> > mongodb/mongos.log
> > SERVER 2
> >  872 ?        Sl     0:00 mongod --fork --configsvr --dbpath /data/db/
> > config --port 20000 --logpath /var/log/mongodb/mongo.log
> >  881 ?        Sl     0:00 mongos --fork --configdb
> > alpha02.mdc.gameloft.org:20000 --chunkSize 1 --logpath /var/log/
> > mongodb/mongos.log
> >  2725 ?        Sl    95:36 mongod --replSet foo --shardsvr --dbpath /
> > data/db/shard00 --port 10000 --logpath /var/log/mongodb/mongo.log --
> > fork
> >  2835 ?        Sl    91:31 mongod --replSet foo2 --shardsvr --dbpath /
> > data/db/shard01 --port 10001 --logpath /var/log/mongodb/mongo.log --
> > fork
>
> > when i connect to mongo on the 2nd server..
> > [root <at> alpha01 ~]# mongo mydb
> > MongoDB shell version: 1.6.1
> > connecting to: mydb
> > > show collections;
> > mycollection
> > system.indexes
>
> > [root <at> alpha02 db]# mongo mydb
> > MongoDB shell version: 1.6.1
> > connecting to: mydb
> > > show collections;
> > Mon Aug 23 13:02:02 uncaught exception: error: { "$err" : "can't find
> > a shard to put new db on", "code" : 10185 }
>
> > If i kill the mongos process on alpha02, and point it to alpha01, i
> > can connect fine, which makes sense.. but if alpha01 goes down, i've
> > effectively lost my database.
>
> > How do i sync the configurations between servers?
>
> > Thanks for any help.
>
> > --
> > 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@...<mongodb-user%2Bunsubscribe <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@...
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.

Kristina Chodorow | 23 Aug 15:49 2010

Re: Re: configserver setup question

They all have to be up to start out with.  If you take down a server, the remaining config server(s) will not be able to modify the configuration (split and migrate chunks), but it'll still work.

To avoid lock file problems, you can give them different dbpaths and ports, just like a normal mongod process.


On Mon, Aug 23, 2010 at 9:44 AM, Jon <not.jon.taylor-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
Hi,

thanks for the quick response,  got a follow up question tho...

my log file says :
Mon Aug 23 13:33:19 need either 1 or 3 configdbs

my understanding is the config db part is done by the configsvr
process (mongod).  and that the mongos process just points to all the
config servers.  so in my case, i can't have two, because of the 1 or
3 limitation. (any way to bypass this?)   which prevents me from
having a 2 node redundant system.  so in order to have a redundant
mongo system, i need a minimum of 3 pieces of hardware?  I can't seem
to run 2nd one on the same server because of the lock file.

On Aug 23, 9:10 am, Kristina Chodorow <krist...-Ot75HdpNzd8AvxtiuMwx3w@public.gmane.org> wrote:
> The config servers will sync themselves.  Just start up three without the
> replSet option and start a mongos with
>
> ./mongos --configdb config1,config2,config3
>
> (where configN is the host/port of each config server).  It'll work itself
> out.
>
> On Mon, Aug 23, 2010 at 9:06 AM, Jon <not.jon.tay... <at> gmail.com> wrote:
> > Hi,
>
> > I'm using a two node setup (alpha01/alpha02) for some testing, and i'm
> > having some confusion i was hoping somebody could help me clear up.
> > (the two nodes are sharded replica sets).  I wanted to be able to
> > knock down one of my two nodes and see if it continued to function.
>
> > In the docs ->http://www.mongodb.org/display/DOCS/Sharding+and+Failover
> > it says "A production shard cluster will have three config server
> > processes, each existing on a separate machine. "
>
> > i realize i'm tryin to fudge things with just two, but should i be
> > trying to replicate the configsvr process?  i gave it a shot, and it
> > won't let me configure it,
>
> > mongod --fork --replSet pok --configsvr --dbpath /data/db/config --
> > port 20000 --logpath /var/log/mongodb/mongo.log
> > > rs.initiate(config);
> >        "errmsg" : "couldn't initiate : member
> > alpha02.mdc.gameloft.org:20000
> > has data already, cannot initiate set.  All members except initiator
> > must be empty.",
> >        "ok" : 0
>
> > If i try and setup my environment without replicated config servers (1
> > per server), as below..
> > using 1.6.1
> > SERVER 1
> >  9472 ?        Sl    33:51 mongod --replSet foo --shardsvr --dbpath /
> > data/db/shard00 --port 10000 --logpath /var/log/mongodb/mongo.log --
> > fork
> >  9562 ?        Sl    32:59 mongod --replSet foo2 --shardsvr --dbpath /
> > data/db/shard01 --port 10001 --logpath /var/log/mongodb/mongo.log --
> > fork
> > 29364 ?        Sl     0:00 mongod --fork --configsvr --dbpath /data/db/
> > config --port 20000 --logpath /var/log/mongodb/mongo.log
> > 29381 ?        Sl     0:00 mongos --fork --configdb
> > alpha01.mdc.gameloft.org:20000 --chunkSize 1 --logpath /var/log/
> > mongodb/mongos.log
> > SERVER 2
> >  872 ?        Sl     0:00 mongod --fork --configsvr --dbpath /data/db/
> > config --port 20000 --logpath /var/log/mongodb/mongo.log
> >  881 ?        Sl     0:00 mongos --fork --configdb
> > alpha02.mdc.gameloft.org:20000 --chunkSize 1 --logpath /var/log/
> > mongodb/mongos.log
> >  2725 ?        Sl    95:36 mongod --replSet foo --shardsvr --dbpath /
> > data/db/shard00 --port 10000 --logpath /var/log/mongodb/mongo.log --
> > fork
> >  2835 ?        Sl    91:31 mongod --replSet foo2 --shardsvr --dbpath /
> > data/db/shard01 --port 10001 --logpath /var/log/mongodb/mongo.log --
> > fork
>
> > when i connect to mongo on the 2nd server..
> > [root <at> alpha01 ~]# mongo mydb
> > MongoDB shell version: 1.6.1
> > connecting to: mydb
> > > show collections;
> > mycollection
> > system.indexes
>
> > [root <at> alpha02 db]# mongo mydb
> > MongoDB shell version: 1.6.1
> > connecting to: mydb
> > > show collections;
> > Mon Aug 23 13:02:02 uncaught exception: error: { "$err" : "can't find
> > a shard to put new db on", "code" : 10185 }
>
> > If i kill the mongos process on alpha02, and point it to alpha01, i
> > can connect fine, which makes sense.. but if alpha01 goes down, i've
> > effectively lost my database.
>
> > How do i sync the configurations between servers?
>
> > Thanks for any help.
>
> > --
> > 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
> > To unsubscribe from this group, send email to
> > mongodb-user+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<mongodb-user%2Bunsubscribe <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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To unsubscribe from this group, send email to mongodb-user+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
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.
王海 | 23 Aug 17:58 2010
Picon

答复: [mongodb-user] configserver setup question

1,
There is no need to add the config server to the replica set.

2,
Have you run the command just like db.runCommand( { addshard :
"foo1/XXX.XXX.151.5:18021, XXX.XXX.151.6:18021, XXX.XXX.151.7:18021" } ) to
add the shard information ? maybe not .

You had better to read the document about the sharding and replica set
carefully again.

-----邮件原件-----
发件人: mongodb-user@... [mailto:mongodb-user <at> googlegroups.com]
代表 Jon
发送时间: 2010年8月23日 21:07
收件人: mongodb-user
主题: [mongodb-user] configserver setup question

Hi,

I'm using a two node setup (alpha01/alpha02) for some testing, and i'm
having some confusion i was hoping somebody could help me clear up.
(the two nodes are sharded replica sets).  I wanted to be able to
knock down one of my two nodes and see if it continued to function.

In the docs -> http://www.mongodb.org/display/DOCS/Sharding+and+Failover
it says "A production shard cluster will have three config server
processes, each existing on a separate machine. "

i realize i'm tryin to fudge things with just two, but should i be
trying to replicate the configsvr process?  i gave it a shot, and it
won't let me configure it,

mongod --fork --replSet pok --configsvr --dbpath /data/db/config --
port 20000 --logpath /var/log/mongodb/mongo.log
> rs.initiate(config);
	"errmsg" : "couldn't initiate : member
alpha02.mdc.gameloft.org:20000
has data already, cannot initiate set.  All members except initiator
must be empty.",
	"ok" : 0

If i try and setup my environment without replicated config servers (1
per server), as below..
using 1.6.1
SERVER 1
 9472 ?        Sl    33:51 mongod --replSet foo --shardsvr --dbpath /
data/db/shard00 --port 10000 --logpath /var/log/mongodb/mongo.log --
fork
 9562 ?        Sl    32:59 mongod --replSet foo2 --shardsvr --dbpath /
data/db/shard01 --port 10001 --logpath /var/log/mongodb/mongo.log --
fork
29364 ?        Sl     0:00 mongod --fork --configsvr --dbpath /data/db/
config --port 20000 --logpath /var/log/mongodb/mongo.log
29381 ?        Sl     0:00 mongos --fork --configdb
alpha01.mdc.gameloft.org:20000 --chunkSize 1 --logpath /var/log/
mongodb/mongos.log
SERVER 2
  872 ?        Sl     0:00 mongod --fork --configsvr --dbpath /data/db/
config --port 20000 --logpath /var/log/mongodb/mongo.log
  881 ?        Sl     0:00 mongos --fork --configdb
alpha02.mdc.gameloft.org:20000 --chunkSize 1 --logpath /var/log/
mongodb/mongos.log
 2725 ?        Sl    95:36 mongod --replSet foo --shardsvr --dbpath /
data/db/shard00 --port 10000 --logpath /var/log/mongodb/mongo.log --
fork
 2835 ?        Sl    91:31 mongod --replSet foo2 --shardsvr --dbpath /
data/db/shard01 --port 10001 --logpath /var/log/mongodb/mongo.log --
fork

when i connect to mongo on the 2nd server..
[root <at> alpha01 ~]# mongo mydb
MongoDB shell version: 1.6.1
connecting to: mydb
> show collections;
mycollection
system.indexes
>

[root <at> alpha02 db]# mongo mydb
MongoDB shell version: 1.6.1
connecting to: mydb
> show collections;
Mon Aug 23 13:02:02 uncaught exception: error: { "$err" : "can't find
a shard to put new db on", "code" : 10185 }
>

If i kill the mongos process on alpha02, and point it to alpha01, i
can connect fine, which makes sense.. but if alpha01 goes down, i've
effectively lost my database.

How do i sync the configurations between servers?

Thanks for any help.

-- 
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@...
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@...
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.


Gmane