problem while connecting to memcache servers over network

hemant gethemant at gmail.com
Wed Jul 18 14:38:39 UTC 2007


hi,

I am using ruby memcache client,
http://seattlerb.rubyforge.org/memcache-client/ for connecting to
memcache servers.

I am attempting to connect to a memcache server located in another
machine, through internet( so no its not also in same domain and all).
Although I can open telnet prompt from the same machine at port 11211,
but memcache throws error when attempting to make a connection to the
same machine at same port:

/usr/local/lib/ruby/gems/1.8/gems/memcache-client-1.3.0/lib/memcache.rb:539:in
`request_setup': No connection to server (MemCache::MemCacheError)
        from /usr/local/lib/ruby/gems/1.8/gems/memcache-client-1.3.0/lib/memcache.rb:199:in
`[]'
        from a.rb:23


My code is:

require "rubygems"
require "memcache"

memcache_options = {
  :c_threshold => 10_000,
  :compression => true,
  :debug => false,
  :namespace => 'bekar_data',
  :readonly => false,
  :urlencode => false
}

CACHE = MemCache.new(memcache_options)
CACHE.servers = "xxx.xxx.xxx.xx:11211"


if ARGV.include?("-d")
  puts "Here"
  CACHE["22120192091291ahae-1"] = "3232"
  puts CACHE["22120192091291ahae-1"]
else
  puts CACHE["22120192091291ahae-1"]
end


More information about the memcached mailing list