[Groonga-commit] droonga/droonga-engine at 7d9ccc4 [master] Store tags permanently as a tags file of serf agent

Back to archive index

YUKI Hiroshi null+****@clear*****
Tue Apr 21 11:05:00 JST 2015


YUKI Hiroshi	2015-04-21 11:05:00 +0900 (Tue, 21 Apr 2015)

  New Revision: 7d9ccc4111d0330cb266c11eceaede2e375463c7
  https://github.com/droonga/droonga-engine/commit/7d9ccc4111d0330cb266c11eceaede2e375463c7

  Message:
    Store tags permanently as a tags file of serf agent

  Modified files:
    lib/droonga/serf.rb

  Modified: lib/droonga/serf.rb (+10 -3)
===================================================================
--- lib/droonga/serf.rb    2015-04-21 11:02:52 +0900 (00aed90)
+++ lib/droonga/serf.rb    2015-04-21 11:05:00 +0900 (20542ac)
@@ -34,6 +34,10 @@ module Droonga
       def path
         Droonga::Path.base + "serf"
       end
+
+      def tags_file
+        Droonga::Path.state + "serf-tags"
+      end
     end
 
     include Loggable
@@ -58,10 +62,13 @@ module Droonga
                         @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
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index