Answer the question
In order to leave comments, you need to log in
Symfony 2. Connecting to remote database via pem key?
Good afternoon.
Raised replication for Mongo on several servers.
I connect as in the documentation
$m = new MongoClient("mongodb://rs1.example.com:27017,rs2.example.com:27017", array("replicaSet" => "myReplSetName"));
$ctx = stream_context_create(array(
"ssl" => array(
/* Optionally verify the server is who he says he is, and has been certified by CA we trust */
"verify_peer" => true,
"allow_self_signed" => false,
"cafile" => "/vagrant/certs/ca.pem",
),
));
$mc = new MongoClient(
"mongodb://server1",
array("ssl" => true),
array("context" => $ctx)
);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question