I am trying to setup two direct admin servers, with one website able to run on both. With PHP session storage in memcache, spead across the two servers for redundancy.
If traffic is load balanced to both, and one box goes down I don't want the user to loose their session.
I found some a nice article on how to go about it on this page:
PHP Sessions On Multiple Memcached Servers
The article is good, but it is specifically for Ubuntu, and I have not been able to get it working on DirectAdmin/Debian 7. Some of the configuration files they mention do not exist on my install.
Essentially they say to setup multiple Memcache servers, and add some config to your php.ini file.
To my php.ini I added the following:
session.save_handler = memcache
session.save_path = 'tcp://serverA:11211,tcp://serverB:11211'
They talk about adding a couple lines to memcache.ini, which I do not have.
memcache.allow_failover=1
memcache.session_redundancy=3
I added those to my php.ini as they appear to be PHP options, according to the PHP documentation.
Anyway, I can set my save handler to memcache, and I can point to either serverA or serverB... individually. Individually they work, but if I try and chain them together I get an error in the logs:
PHP Fatal error: session_start(): Failed to initialize storage module: memcache (path: tcp://serverA:11211,tcp:serverB:11211) in /home/ikbb/domains/widg.com/public_html/index.php on line 30
It obviously has something to do with the redundancy aspect since they both work individually.
Anyone got an idea where the memcache.allow_failover command is supposed to go, since DirectAdmin does not have a memcache.ini file.
Rob
If traffic is load balanced to both, and one box goes down I don't want the user to loose their session.
I found some a nice article on how to go about it on this page:
PHP Sessions On Multiple Memcached Servers
The article is good, but it is specifically for Ubuntu, and I have not been able to get it working on DirectAdmin/Debian 7. Some of the configuration files they mention do not exist on my install.
Essentially they say to setup multiple Memcache servers, and add some config to your php.ini file.
To my php.ini I added the following:
session.save_handler = memcache
session.save_path = 'tcp://serverA:11211,tcp://serverB:11211'
They talk about adding a couple lines to memcache.ini, which I do not have.
memcache.allow_failover=1
memcache.session_redundancy=3
I added those to my php.ini as they appear to be PHP options, according to the PHP documentation.
Anyway, I can set my save handler to memcache, and I can point to either serverA or serverB... individually. Individually they work, but if I try and chain them together I get an error in the logs:
PHP Fatal error: session_start(): Failed to initialize storage module: memcache (path: tcp://serverA:11211,tcp:serverB:11211) in /home/ikbb/domains/widg.com/public_html/index.php on line 30
It obviously has something to do with the redundancy aspect since they both work individually.
Anyone got an idea where the memcache.allow_failover command is supposed to go, since DirectAdmin does not have a memcache.ini file.
Rob
Last edited: