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

Popular posts from this blog

jasper reports - Fixed header in Excel using JasperReports -

media player - Android: mediaplayer went away with unhandled events -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -