Navigation Menu

Skip to content

Commit

Permalink
Use port for the bind address, not the rpc address.
Browse files Browse the repository at this point in the history
It was wrongly used for rpc.
  • Loading branch information
piroor committed Jun 27, 2014
1 parent 532cd0c commit 9fdeb79
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
3 changes: 1 addition & 2 deletions lib/droonga/command/serf_event_handler.rb
Expand Up @@ -33,8 +33,7 @@ def run

def initialize
@serf = ENV["SERF"] || Serf.path
@serf_port = ENV["SERF_PORT"] || Serf.default_port
@serf_rpc_address = ENV["SERF_RPC_ADDRESS"] || "127.0.0.1:#{@serf_port}"
@serf_rpc_address = ENV["SERF_RPC_ADDRESS"] || "127.0.0.1:7373"
@serf_name = ENV["SERF_SELF_NAME"]
end

Expand Down
12 changes: 5 additions & 7 deletions lib/droonga/serf.rb
Expand Up @@ -33,15 +33,15 @@ def port_file
end

def default_port
7373
7946
end

def dump_source_port
7374
7947
end

def dump_destination_port
7375
7948
end
end

Expand All @@ -57,16 +57,14 @@ def start
logger.trace("start: start")
ensure_serf
ENV["SERF"] = @serf
@port = port
ENV["SERF_PORT"] = "#{@port}"
ENV["SERF_RPC_ADDRESS"] = rpc_address
retry_joins = []
detect_other_hosts.each do |other_host|
retry_joins.push("-retry-join", other_host)
end
@agent = run("agent",
"-node", @name,
"-bind", extract_host(@name),
"-bind", "#{extract_host(@name)}:#{port}",
"-event-handler", "droonga-engine-serf-event-handler",
"-log-level", log_level,
*retry_joins)
Expand Down Expand Up @@ -131,7 +129,7 @@ def log_level
end

def rpc_address
"#{extract_host(@name)}:#{@port}"
"#{extract_host(@name)}:7373"
end

def port
Expand Down

0 comments on commit 9fdeb79

Please sign in to comment.