MongoDB Replica Set status from PHP -
is there way output of "rs.status();" php driver?
passing following setting command function of mongodb driver
array('replsetgetstatus'=>1)
results in error message:
array ( [0] => access denied; use admin db [1] => 0 )
you can reuse same connection; have admin db object:
$connection->admin->command(array("replsetgetstatus"=>1)
if haven't already, you'll need create database connection object 'admin' db can call output of rs.status() through driver specified.
mongodb://[username:password@]host1[:port1][,host2[:port2:],...]/db
see docs here
Comments
Post a Comment