Skip to content
This repository has been archived by the owner on Sep 18, 2021. It is now read-only.

Commit

Permalink
Fix port used for memcache commands.
Browse files Browse the repository at this point in the history
RB_ID=81900
  • Loading branch information
Cory Watson committed Aug 21, 2012
1 parent b546686 commit ba5b029
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/main/ruby/kcluster/bin/kcluster
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ $options = {
:datacenter => 'smf1',
:server_list => [],
:port => 2223,
:memcache_port => 22133,
:verbose => false,
}

Expand Down Expand Up @@ -138,8 +139,8 @@ end

def broadcast(command, queue_name, verb)
$options[:server_list].each do |server|
status "--- #{verb} queue #{queue_name} from #{server}:#{$options[:port]} ... "
with_server(server, $options[:port]) do |sock|
status "--- #{verb} queue #{queue_name} from #{server}:#{$options[:memcache_port]} ... "
with_server(server, $options[:memcache_port]) do |sock|
sock.puts("#{command} " + queue_name)
puts sock.readline.chomp
end
Expand Down Expand Up @@ -197,8 +198,8 @@ end

def show_versions
$options[:server_list].each do |server|
verbose "--- Fetching version from #{server}:#{$options[:port]}"
with_server(server, $options[:port]) do |sock|
verbose "--- Fetching version from #{server}:#{$options[:memcache_port]}"
with_server(server, $options[:memcache_port]) do |sock|
sock.puts("version")
line = sock.gets.chomp
line =~ /VERSION (.*)/
Expand All @@ -222,6 +223,9 @@ parser = OptionParser.new do |opts|
opts.on("-h", "--host=HOSTNAME", "use a specific server") do |singlehost|
$options[:singlehost] = singlehost
end
opts.on("-m", "--memcache-port=N", "use memcache port (default: #{$options[:memcache_port]})") do |memcacheport|
$options[:memcache_port] = memcacheport
end
opts.on("-p", "--port=N", "use port (default: #{$options[:port]})") do |port|
$options[:port] = port.to_i
end
Expand Down

0 comments on commit ba5b029

Please sign in to comment.