Skip to content

Instantly share code, notes, and snippets.

@gatesvp
Created May 12, 2011 22:03
Show Gist options
  • Select an option

  • Save gatesvp/969561 to your computer and use it in GitHub Desktop.

Select an option

Save gatesvp/969561 to your computer and use it in GitHub Desktop.
<?php
try{
### Step 1 & 2
$m = new Mongo('ec2-50-16-121-178.compute-1.amazonaws.com');
$db = $m->admin;
### Step 3
$res = $db->command(array('replSetGetStatus' => 1));
print_r($res);
### Step 4
$res = $db->command(array('replSetStepDown' => 120));
print_r($res);
### Step 5
$res = $db->command(array('replSetGetStatus' => 1));
print_r($res);
}
catch(Exception $ex){
print($ex->getMessage());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment