MongoDb Cluster Setup 4 Node,

133 views
Skip to first unread message

Sumit Gupta

unread,
May 28, 2015, 10:56:53 AM5/28/15
to mongod...@googlegroups.com
Hi All,

I am new in MongoDb.I am trying to set up 4 node cluster. using replica set. I have set up like 1 primary 1 arbitary on one node and two secondary on two node , 1 secondary 1 arbitary on one node so total 3 secondary 2 arbitary and 1 primary.

But when i am trying for switch over first time arbitary contributing in primary but this primary is down then other primary is not contributing in primary election.

Please suggest me i am doing correct node selection or something i need to change.

Any help  will be highly appreciated.

Thanks,
Sumit

Stephen Steneker

unread,
May 28, 2015, 1:51:19 PM5/28/15
to mongod...@googlegroups.com, sumit.g...@gmail.com
On Thursday, 28 May 2015 07:56:53 UTC-7, Sumit Gupta wrote:
I am new in MongoDb.I am trying to set up 4 node cluster. using replica set. I have set up like 1 primary 1 arbitary on one node and two secondary on two node , 1 secondary 1 arbitary on one node so total 3 secondary 2 arbitary and 1 primary.

Hi Sumit,

From the information provided I'm not clear on your current node count .. but you should have at most one arbiter (and only if you have an even number of nodes and need a tie-breaking vote).

For example, assuming you want to have 4 data-bearing nodes your replica set configuration would be:
 - 4 data nodes
 - 1 arbiter (so there are a total of 5 voting nodes)

Can you provide the output of rs.conf() and rs.status() to clarify your current replica set state?

 
But when i am trying for switch over first time arbitary contributing in primary but this primary is down then other primary is not contributing in primary election.

All available members will contribute to the election process. If you have a total of five members configured, the strict majority of votes required to elect a primary is 3 votes.

If one or more members of your five node replica set is down, the total number of members (and the strict majority of votes required) does not change.

Regards,
Stephen

Sumit Gupta

unread,
May 29, 2015, 1:29:40 AM5/29/15
to mongod...@googlegroups.com, sumit.g...@gmail.com
Hi Stiphen,

Thanks for your quick answer.

My First doubt is can i run arbitar on primary or secondary node..i mean two instances of mongod.
So Suppose I have total 4 node 1 primary and 3 secondary and i am running one arbitary on primary node itself and one more arbitary on secondary node.

Thanks,
Sumit

Stephen Steneker

unread,
May 29, 2015, 3:09:10 AM5/29/15
to mongod...@googlegroups.com, sumit.g...@gmail.com
On Thursday, 28 May 2015 22:29:40 UTC-7, Sumit Gupta wrote:
Thanks for your quick answer.

My First doubt is can i run arbitar on primary or secondary node..i mean two instances of mongod.

Hi Sumit,

You can run multiple instances of mongod on the same server (i.e. a data bearing node and an arbiter), however that also affects your failure scenarios. For example, if you have two mongods on a single server then failure of that server affects two members of your replica set. In general I would not recommend having multiple data-bearing replica set nodes on the same server as resource contention is also a common challenge.
 
So Suppose I have total 4 node 1 primary and 3 secondary and i am running one arbitary on primary node itself and one more arbitary on secondary node.

You have to count arbiters as members of your replica set. So if you have 1 primary and 3 secondaries that is 4 replica set members; you would want to add one arbiter for a total of 5 nodes. You do not need to add multiple arbiters to your replica set.

Regards,
Stephen 

Sumit Gupta

unread,
May 29, 2015, 9:04:47 AM5/29/15
to mongod...@googlegroups.com
Hi,

Thanks Stephen.

So it's looks like 1 primary 3 secondary 1 arbitary is best configuration in my case..but the scenario is at the same time 3 server should not go down if i am not wrong.

Thanks,
Sumit

Dwayne Mcnab

unread,
May 29, 2015, 12:44:23 PM5/29/15
to mongod...@googlegroups.com
Hi Sumit,

Seems like you are running a bit of an over kill on your replica set design. My question for you to better understand your setup and what you are trying to achieve is, why do you need 3 secondaries and one primary? Are you planning to use one of the secondary for a particular purpose? For example, are you running mongod's cross sites and are trying to minimize latency? Please provide more details about your use case so that we can better assist you.

Regards,

Dwayne
Reply all
Reply to author
Forward
0 new messages