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:
parent
d166975af9
commit
77e9c05e40
|
@ -187,9 +187,11 @@ class ReplSetManager
|
||||||
def kill(node, signal=2)
|
def kill(node, signal=2)
|
||||||
pid = @mongods[node]['pid']
|
pid = @mongods[node]['pid']
|
||||||
puts "** Killing node with pid #{pid} at port #{@mongods[node]['port']}"
|
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
|
@mongods[node]['up'] = false
|
||||||
sleep(1)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def kill_primary(signal=2)
|
def kill_primary(signal=2)
|
||||||
|
|
Loading…
Reference in New Issue