arqui78 / rock-php

Automatically exported from code.google.com/p/rock-php
0 stars 0 forks source link

Can't access collections on slave node #138

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Mongo master/slave setup
2. Configure rock-php to access both master and slave servers
3. Select 'slave' in the rock-php servers selection drop-down

What is the expected output? What do you see instead?

- Would expect to see a list of the collections available
on the slave

- Instead, get the following error message (left handside column):
Execute failed:not master
function (){ return db.getCollectionNames(); }

RockMongo Version (1.1.0)
Operation System (Ubuntu)
PHP Version (5.2.6)
php_mongo Version (1.1.4)
MongoDB version (1.8.0)

Please provide any additional information below.

Original issue reported on code.google.com by dchanco...@gmail.com on 14 May 2011 at 7:02

GoogleCodeExporter commented 8 years ago
okey, we will check it later.

Original comment by iwind....@gmail.com on 15 May 2011 at 3:39

GoogleCodeExporter commented 8 years ago
同样的问题,master访问正常,slave出现如上错误,点击顶部Sla
ve错误提示:
Fatal error: can not find action 'replication' in class 'AdminController' in 
/home/wwwroot/rockmongo/rock.php on line 200

Original comment by imas...@gmail.com on 15 Aug 2011 at 5:03

GoogleCodeExporter commented 8 years ago
Is there anyone working with this issue? 
I get the same problem.

Original comment by jensfros...@gmail.com on 18 Nov 2011 at 1:39

GoogleCodeExporter commented 8 years ago
There needs to be a call to db.getMongo().setSlaveOk(); on each connection 
before querying slaves

Original comment by m...@drollette.com on 22 Dec 2011 at 5:17

GoogleCodeExporter commented 8 years ago
Here is quick hack:
open /ap/models/MServer.php

Find:
$this->_mongo = new Mongo($this->_mongoHost . ":" . $this->_mongoPort);

Replace:
$this->_mongo = new Mongo($this->_mongoHost . ":" . $this->_mongoPort, 
array("replicaSet" => true));
$this->_mongo->setSlaveOkay(true);

It should work now :)

Original comment by remdex on 18 Feb 2012 at 11:21