Navigation Menu

Skip to content

Commit

Permalink
Store tags permanently as a tags file of serf agent
Browse files Browse the repository at this point in the history
  • Loading branch information
piroor committed Apr 21, 2015
1 parent e8e0e23 commit 7d9ccc4
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions lib/droonga/serf.rb
Expand Up @@ -34,6 +34,10 @@ class << self
def path
Droonga::Path.base + "serf"
end

def tags_file
Droonga::Path.state + "serf-tags"
end
end

include Loggable
Expand All @@ -58,10 +62,13 @@ def run_agent(loop)
@name.host, agent_port, rpc_port,
"-node", @name.to_s,
"-event-handler", "droonga-engine-serf-event-handler",
"-tag", "type=engine",
"-tag", "role=#{role}",
"-tag", "cluster_id=#{cluster_id}",
"-tags-file", self.class.tags_file,
*retry_joins)
agent.on_ready = lambda do
set_tag("type", "engine")
set_tag("role", role)
set_tag("cluster_id", cluster_id)
end
agent.start
logger.trace("run_agent: done")
agent
Expand Down

0 comments on commit 7d9ccc4

Please sign in to comment.