I am going to configure load balancing and fault tolerance for Redmine:
HAProxy 1 ------- Apache 1 ------- MySQL 1 | (Repcached) | | | | (virtual IP) (memcached repl) (master-master repl) | | | | (Repcached) | HAProxy 2 ------- Apache 2 ------- MySQL 2
and I want to use repcached to store the session:
/usr/local/memcached/bin/memcached -d -u memcached -l 192.168.3.118 -c 512 -t 8 -m 512 -p 11211 -P /usr/local/memcached/var/run/redmine.pid -f 1.25 -x 192.168.6.142 -X 112110
The replication function works fine ( telnet checked).
memcache-client :
# gem list memcache-client *** LOCAL GEMS *** memcache-client (1.8.5)
and can be loaded from the command line:
# su - apache -s /bin/bash -bash-3.2$ gem contents --no-prefix memcache-client FAQ.rdoc History.rdoc LICENSE.txt README.rdoc Rakefile bin/memcached_top lib/continuum_native.rb lib/memcache.rb lib/memcache/event_machine.rb lib/memcache/version.rb lib/memcache_util.rb performance.txt test/test_benchmark.rb test/test_event_machine.rb test/test_mem_cache.rb -bash-3.2$ ruby -rubygems -e 'require "memcache"' -bash-3.2$ echo $? 0
There is only one version of Ruby on my server:
-bash-3.2$ which ruby /usr/bin/ruby -bash-3.2$ gem env RubyGems Environment: - RUBYGEMS VERSION: 1.8.10 - RUBY VERSION: 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux] - INSTALLATION DIRECTORY: /usr/lib/ruby/gems/1.8 - RUBY EXECUTABLE: /usr/bin/ruby - EXECUTABLE DIRECTORY: /usr/bin - RUBYGEMS PLATFORMS: - ruby - x86_64-linux - GEM PATHS: - /usr/lib/ruby/gems/1.8 - /var/www/.gem/ruby/1.8 - GEM CONFIGURATION: - :update_sources => true - :verbose => true - :benchmark => false - :backtrace => false - :bulk_threshold => 1000 - REMOTE SOURCES: - http:
config /environment.rb
require 'memcache' config.action_controller.session_store = :mem_cache_store memcache_options = { :compression => true, :debug => false, :namespace => "mem-#{RAILS_ENV}", :readonly => false, :urlencode => false } memcache_servers = [ '192.168.3.118:11211', '192.168.6.142:11211' ] CACHE = MemCache.new(memcache_options) CACHE.servers = memcache_servers ActionController::Base.session_options[:cache] = CACHE
but when restarting Apache it gives the following error:
no such file to download - memcache
Did I miss something?
PS:
Redmine version 2.0.3.stable Ruby version 1.8.7 (x86_64-linux) Rails version 3.2.6 Environment production Database adapter MySQL