note 101194 added to memcache.addserver
| From: | anthony at iclasspro dot com | Date: | Wed, 01 Dec 2010 23:40:32 +0000 |
| Subject: | note 101194 added to memcache.addserver | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-174535@lists.php.net to get a copy of this message | ||
An important thing to note about this is that if you have 2 memcache servers and one of those
servers is your localhost that you will want to specify the external IP addresses of both of those.
<?php
$m = memcache_connect('127.0.0.1', 11211);
memcache_add_server($m, '10.5.50.20');
?>
This will NEVER talk to 10.5.50.20.
So what you need to do is to specify the external IP address of all your servers:
<?php
$m = memcache_connect('10.5.50.10', 11211);
memcache_add_server($m, '10.5.50.20');
?>
For some reason when the PHP memcache module does a connection to localhost it assumes that this is
the ONLY memcache server and does not attempt to use others.
----
Server IP: 69.147.83.197
Probable Submitter: 206.255.245.99
----
Manual Page -- http://www.php.net/manual/en/memcache.addserver.php
Edit -- https://master.php.net/note/edit/101194
Del: integrated -- https://master.php.net/note/delete/101194/integrated
Del: useless -- https://master.php.net/note/delete/101194/useless
Del: bad code -- https://master.php.net/note/delete/101194/bad+code
Del: spam -- https://master.php.net/note/delete/101194/spam
Del: non-english -- https://master.php.net/note/delete/101194/non-english
Del: in docs -- https://master.php.net/note/delete/101194/in+docs
Del: other reasons-- https://master.php.net/note/delete/101194
Reject -- https://master.php.net/note/reject/101194
Search -- https://master.php.net/manage/user-notes.php