Navigation Menu

Skip to content

Commit

Permalink
sample cluster: support droonga-engine restart
Browse files Browse the repository at this point in the history
  • Loading branch information
kou authored and piroor committed Jan 6, 2015
1 parent 172fbb8 commit ce1a8d0
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion sample/cluster/Rakefile
Expand Up @@ -62,6 +62,10 @@ class DroongaEngine
Process.kill(:TERM, @pid)
Process.waitpid(@pid)
@pid = nil
if pid_path.exist?
pid = Integer(pid_path.read)
Process.kill(:TERM, pid)
end
end

def host
Expand All @@ -81,6 +85,14 @@ class DroongaEngine
working_dir_path + "droonga-engine.pid"
end

def pid_path_base_name
"droonga-engine.pid"
end

def pid_path
working_dir_path + pid_path_base_name
end

def generate_catalog(node_ids)
hosts = node_ids.collect do |node_id|
self.class.host(node_id)
Expand All @@ -98,7 +110,7 @@ class DroongaEngine
"port" => self.class.port,
# "log_file" => "droonga-engine.log",
"log_level" => "info",
"pid_file" => "droonga-engine.pid",
"pid_file" => pid_path_base_name,
}
config_path.open("w") do |file|
file.puts(config.to_yaml)
Expand Down

0 comments on commit ce1a8d0

Please sign in to comment.