-
Notifications
You must be signed in to change notification settings - Fork 213
Closed
Description
$manager = new MongoDB\Driver\Manager("mongodb://192.168.1.11:5000,192.168.1.22:5000", array(
'connect' => true,
'connectTimeoutMS' => 1000,
'socketTimeoutMS' => 5000,
'replicaSet'=>"pktest"
));
$options['projection'] = array();
$options['limit'] = 1;
$query = new MongoDB\Driver\Query(array('_id' => 21), $options);
$rp = new MongoDB\Driver\ReadPreference(MongoDB\Driver\ReadPreference::RP_PRIMARY);
$result = $manager->executeQuery("test.test", $query, $rp);
var_dump($result);
When the first IP port(192.168.1.11:5000) is the PRIMARY and existing, But the last IP port(192.168.1.22:5000) does not exist, Run time prompt (No suitable servers found (serverselectiontryonce set): [connection error calling ismaster on).
If the two IP for a location, and normal, ("mongodb://192.168.1.22:5000,192.168.1.11:5000")
PHP5.4-7.0.4/mongodb1.1.3-1.1.5 Have this problem.
asp24, vingrad and udoless
Metadata
Metadata
Assignees
Labels
No labels