Hi,

Actually, pecl/memcache version 3.0.0+ already has support for client side replication where the client writes keys to N (user specified) servers in parallel, the replicas are then used if the primary copy is unavailable. This method isn't really 100% reliably though (please use a database for that), it's more for caching data like sessions or other stuff that you'd rather not loose or have get inconsistent but it isn't totally catastrophic if you in some very infrequent cases do.

Replication can be enabled by setting either of the INI settings

# For 2 server general redundancy
memcache.redundancy = 2

# For 2 server session redundancy
memcache.session_redundancy = 2

Or like

<?php

$prev = ini_get('memcache.redundancy');
ini_set('memcache.redundancy', 2);

$redundantpool = new MemcachePool();
$redundantpool->addServer(..);
$redundantpool->addServer(..);
...

ini_set('memcache.redundancy', $prev);

//Mikael

Brian Aker wrote:
Hi!

On Apr 2, 2008, at 12:45 PM, Kris Drebin wrote:
Do you, or does anyone else have any other ideas of how I can
accomplish my goal of creating a fail-over solution using memcached?
so that if one memcached server dies, the other will have all the
needed information?

We have replication support in nodes available as a branch in libmemcached right now:
http://tangent.org/552/libmemcached.html

Support is only partially available in the C/C++ versions of the API. Once I have them stabilized I am assuming the perl/python/php/ruby drivers will come along for the ride.

Cheers,
    -Brian

--
_______________________________________________________
Brian "Krow" Aker, brian at tangent.org
Seattle, Washington
http://krow.net/                     <-- Me
http://tangent.org/                <-- Software
_______________________________________________________
You can't grep a dead tree.




Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to