sending a shutdown command to kill a node seems a lot more reliable than issuing a kill command (on my system anyways)

This commit is contained in:
Karl Seguin 2011-08-11 22:35:08 +08:00 committed by Kyle Banker
parent d166975af9
commit 77e9c05e40
1 changed files with 4 additions and 2 deletions

View File

@ -187,9 +187,11 @@ class ReplSetManager
def kill(node, signal=2)
pid = @mongods[node]['pid']
puts "** Killing node with pid #{pid} at port #{@mongods[node]['port']}"
system("kill -#{signal} #{@mongods[node]['pid']}")
begin
get_connection(node)['admin'].command({'shutdown' => 1})
rescue Mongo::ConnectionFailure
end
@mongods[node]['up'] = false
sleep(1)
end
def kill_primary(signal=2)