Seedlist for replica set

416 views
Skip to first unread message

Om

unread,
Aug 12, 2011, 5:35:46 PM8/12/11
to mongodb-user
Here is what I found out abt the seedlist (from
http://www.mongodb.org/display/DOCS/Replica+Set+Tutorial)

"Most of the MongoDB drivers are replica set aware. The driver when
connecting takes a list of seed hosts from the replica set and can
then discover which host is primary and which are secondary (the
isMaster command is used internally by the driver for this). With this
complete set of potential master nodes, the driver can automatically
find the new master if the current master fails. See your driver's
documentation for specific details."


Does this mean that when starting a new node, if I specified a seed
list, the node will automatically find the Master and register itself
with the Master node (so that there is no need to do rs.add() at the
Primary)

Bernie Hackett

unread,
Aug 12, 2011, 5:49:20 PM8/12/11
to mongodb-user
No. It's talking about the drivers. For example, if you provide a list
of two hosts from the replica set to pymongo.Connection() it will find
all the other hosts in the set.

Here's an example. I've started up a replica set with 5 nodes but I'm
only providing 2 nodes in the seed list:

>>> import pymongo
>>> c = pymongo.Connection('behackett-dt:31017,behackett-dt:31018')
>>> c
Connection([u'behackett-dt:31021', u'behackett-dt:31019', u'behackett-
dt:31020', 'behackett-dt:31017', 'behackett-dt:31018'])


On Aug 12, 2:35 pm, Om <omkar.ti...@gmail.com> wrote:
> Here is what I found out abt the seedlist (fromhttp://www.mongodb.org/display/DOCS/Replica+Set+Tutorial)

Om

unread,
Aug 12, 2011, 5:52:20 PM8/12/11
to mongodb-user
Thanks Bernie. So is there a way for Secondary nodes to automatically
add themselves to the replica set (without doing rs.add() at the
Primary)?

Bernie Hackett

unread,
Aug 12, 2011, 6:02:54 PM8/12/11
to mongodb-user
No, you have to reconfigure the set from the primary. This is easy
since you can just run rs.add().

http://www.mongodb.org/display/DOCS/Adding+a+New+Set+Member

Om

unread,
Aug 12, 2011, 6:04:39 PM8/12/11
to mongodb-user
Bernie .... I'm aware of that option. I just wanted to know if there
is a way of doing this without doing a rs.add() at the primary. Thanks
for the help :D

Bernie Hackett

unread,
Aug 12, 2011, 6:13:06 PM8/12/11
to mongodb-user
Well, you can also do a lot of this in pymongo as I mentioned in this
previous discussion :-)

http://groups.google.com/group/mongodb-user/browse_thread/thread/a401f636705c1e0d

Om

unread,
Aug 12, 2011, 6:29:01 PM8/12/11
to mongodb-user
Yes :D ... u've been really helpful Bernie .. I appreciate that :)

On Aug 12, 3:13 pm, Bernie Hackett <ber...@10gen.com> wrote:
> Well, you can also do a lot of this in pymongo as I mentioned in this
> previous discussion :-)
>
> http://groups.google.com/group/mongodb-user/browse_thread/thread/a401...
Reply all
Reply to author
Forward
0 new messages