Message from discussion
does primary,secondary order matter in connection string?
Received: by 10.50.5.210 with SMTP id u18mr2094907igu.4.1352254636004;
Tue, 06 Nov 2012 18:17:16 -0800 (PST)
X-BeenThere: mongodb-user@googlegroups.com
Received: by 10.50.140.37 with SMTP id rd5ls2699988igb.2.gmail; Tue, 06 Nov
2012 18:17:04 -0800 (PST)
Received: by 10.50.182.132 with SMTP id ee4mr2100062igc.5.1352254624558;
Tue, 06 Nov 2012 18:17:04 -0800 (PST)
Received: by 10.50.182.132 with SMTP id ee4mr2100061igc.5.1352254624549;
Tue, 06 Nov 2012 18:17:04 -0800 (PST)
Return-Path: <hannes.magnus...@10gen.com>
Received: from mail-ie0-f172.google.com (mail-ie0-f172.google.com [209.85.223.172])
by gmr-mx.google.com with ESMTPS id wu4si127888igb.3.2012.11.06.18.17.04
(version=TLSv1/SSLv3 cipher=OTHER);
Tue, 06 Nov 2012 18:17:04 -0800 (PST)
Received-SPF: pass (google.com: domain of hannes.magnus...@10gen.com designates 209.85.223.172 as permitted sender) client-ip=209.85.223.172;
Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of hannes.magnus...@10gen.com designates 209.85.223.172 as permitted sender) smtp.mail=hannes.magnus...@10gen.com
Received: by mail-ie0-f172.google.com with SMTP id 9so1690158iec.3
for <mongodb-user@googlegroups.com>; Tue, 06 Nov 2012 18:17:04 -0800 (PST)
d=google.com; s=20120113;
h=mime-version:in-reply-to:references:date:message-id:subject:from:to
:content-type:x-gm-message-state;
bh=ndX70FZffbj1ZWuodgnqymTK/mf3ipMW/dgSzZDVJ7I=;
b=N6D64TFB6yNOQV2UAkYY51EQhPVGG2EoiFwYgi31gxej/l82L606TrcawZuoq0BAFl
xtb2CAdHcXIGMeePOTk2pzqths93+FoKTpjYely+1xeonq4hdisA+91epi3/ybm++/pN
+6RWYAcjC5Kbz/wleBI0x4+/vL0ZWsDw2frnnOQviRXKWKI66VrbQkSWIQJZIopLGIcr
sQ7mxrv5xFI2pHDb+wKLST3VxWht8i2s6DqiEnsDtHa9kv7WtPLbXDRkT1D/pB1J8z1I
+I/h6jICXedEoSfBa+6WM5jBj3J6t574tN3FkwbYJbfWwtuw4TbH0ZLr/fg8MMw41DVn
iQDQ==
MIME-Version: 1.0
Received: by 10.50.212.72 with SMTP id ni8mr659897igc.5.1352254624343; Tue, 06
Nov 2012 18:17:04 -0800 (PST)
Received: by 10.50.41.37 with HTTP; Tue, 6 Nov 2012 18:17:04 -0800 (PST)
In-Reply-To: <5099B708....@gmail.com>
References: <5099B708....@gmail.com>
Date: Tue, 6 Nov 2012 18:17:04 -0800
Message-ID: <CAJWOBQtaT-MYS6OHaa_iReLsD4H=4gf4_KJdva1YGJ+TgXG...@mail.gmail.com>
Subject: Re: [mongodb-user] does primary,secondary order matter in connection string?
From: Hannes Magnusson <han...@10gen.com>
To: mongodb-user@googlegroups.com
Content-Type: text/plain; charset=UTF-8
X-Gm-Message-State: ALoCoQngf0V6VH3/LnD39qb6N59WNmflPD6K15sDdvYDDgNJ6Bb6m8C1P6s14uW3axpDO14ij546
We will always use the first entry in the seed list to discover the
topology of the replicaset, and then match the next server in the
seedlist to our discovery.
The only case where it could possibly matter is if the first node is
down, but the end results would be the same as we will verify the the
entire seed list to our discovered topology.
This should have no affect on the cursor whatsoever.. You are passing
in an array as the second argument to the constructor with
array("replicaSet" => "replicaset-name") right?
-Hannes
On Tue, Nov 6, 2012 at 5:19 PM, Adam Monsen <hair...@gmail.com> wrote:
> Do these two connection strings behave the same?
>
> 1. mongodb://primary:27017,secondary:27017
> 2. mongodb://secondary:27017,primary:27017
>
> I was seeing a bunch of "MongoCursorTimeoutException: cursor timed out"
> errors using #2, when I switched to #1 they went away.
>
> I'm running a 3-node replica set on EC2 instances. Each node runs in a
> different availability zone.
>
> Each node is MongoDB 2.2.1 on the latest Amazon Linux (2012.09).
>
> I connect to MongoDB using Doctrine MongoDB, so here are a few other
> moving parts:
>
> * Symfony v2.0.18
> * doctrine-common b886898821288d305862ee9c567cc5b5cbb4c0dc
> * doctrine-mongodb 727a12d25ba12d18aa293bc6eb61f203a9545912
> * doctrine-mongodb-odm bd65a47c32f9ad9ac888914ab88d89976a5bcfe8
> * 'mongo' from pecl.php.net, version 1.2.12
>