- Includes:
- sfMongoDBCache by gregoire
- sfMemcachedCache by dasher (Config: http://gist.github.com/232225)
$ wget repcached complete
$ tar zxf memcached-1.2.6-repcached-2.2.tar.gz
$ cd memcached-1.2.6-repcached-2.2
--- OR ---
$ wget memcache source
$ tar zxf memcached-1.2.6.tar.gz
$ cd memcached-1.2.6
$ wget repcached patch
$ gzip -cd repcached-2.2-1.2.6.patch.gz | patch -p1
$ ./configure --enable-replication // [notice: cannot set both --enable-replication and --enable-thread together]
$ make
$ make install
repcached adds two new options (-x and -X).
There are two machines called "foo" and "bar".
foo$ ./memcached (start as master)
bar$ ./memcached -x foo (start as slave and connect to master(foo))
Client set key/val to master(foo). We can get same value from slave(bar).
If master(foo) is down, slave(bar) become the new master automatically.
start memcached at foo as slave.
foo$ ./memcached -x bar (start as slave and connect to master(bar))
All data which master(bar) has will copy to new slave(foo), then master and slave have same data.
all:
storage:
class: sfCacheSessionStorage
param:
session_name: session_identifier
session_cookie_domain: .session_identifier.local
session_cookie_lifetime: +30 days
session_cookie_secret: s0m3th1ngS3cr3t
cache:
class: sfMemcachedCache
param:
lifetime: 7200
prefix: somePrefix
servers:
server1:
host: one.local
port: 11211
server2:
host: two.local
port: 11211