Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Read data from Secondary without use rs.slaveOk() in Mongo Shell.

Received: by 10.58.70.146 with SMTP id m18mr149950veu.0.1348123416687;
        Wed, 19 Sep 2012 23:43:36 -0700 (PDT)
X-BeenThere: mongodb-user@googlegroups.com
Received: by 10.52.32.232 with SMTP id m8ls1480073vdi.8.gmail; Wed, 19 Sep
 2012 23:43:25 -0700 (PDT)
Received: by 10.52.35.104 with SMTP id g8mr78273vdj.19.1348123405940;
        Wed, 19 Sep 2012 23:43:25 -0700 (PDT)
Date: Wed, 19 Sep 2012 23:43:25 -0700 (PDT)
From: Tom Vo <tom...@nexcel.vn>
To: mongodb-user@googlegroups.com
Message-Id: <5910c086-af91-48ec-ae40-b614e1615a16@googlegroups.com>
Subject: Read data from Secondary without use rs.slaveOk() in Mongo Shell.
MIME-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_624_25228015.1348123405545"

------=_Part_624_25228015.1348123405545
Content-Type: multipart/alternative; 
	boundary="----=_Part_625_13458418.1348123405546"

------=_Part_625_13458418.1348123405546
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

Dear all
I setup Replication Set on my system with 1 Primary (port 27017), 1 
Secondary (port 27018), 1 Arbiter (port 27019).
Could I read data from Secondary without use rs.slaveOk() in Mongo Shell?


db1 = connect('localhost: 27018 /dbtest')

col1 = db1.getCollection("coltest")

col1.findOne()

Thu Sep 20 13:42:30 uncaught exception: error: { "$err" : "not master and 
slaveok=false", "code" : 13435 }

Thanks.
Tom Vo

------=_Part_625_13458418.1348123405546
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: 7bit

Dear all<div>I setup Replication Set on my system with 1 Primary (port 27017), 1 Secondary&nbsp;(port 27018), 1 Arbiter&nbsp;(port 27019).</div><div>Could I read data&nbsp;from Secondary without use rs.slaveOk() in Mongo Shell?</div><div><br></div><div><div><br></div><div>db1 = connect('localhost:
27018&nbsp;/dbtest')</div></div><div><br></div><div>col1 = db1.getCollection("coltest")<br></div><div><br></div><div>col1.findOne()<br></div><div><br></div><div>Thu Sep 20 13:42:30 uncaught exception: error: { "$err" : "not master and slaveok=false", "code" : 13435 }<br></div><div><br></div><div>Thanks.</div><div>Tom Vo</div>
------=_Part_625_13458418.1348123405546--

------=_Part_624_25228015.1348123405545--