I'm using phpredis (redis_cluster branch) with redis stable (v3.0.4) on top of CentOS 7.1 (latest) and PHP 5.6 (remi repo) with Apache (2.4.6)
Using cluster with 3 masters (test only).
My redis.ini contains:
extension = redis.so
session.save_handler = rediscluster
session.save_path = "mycluster[]=192.168.1.100:6379&mycluster[]=192.168.1.100:6380&mycluster[]=192.168.1.100:6381&timeout=3&read_timeout=3&failover=error"
redis.clusters.seeds = "mycluster[]=192.168.1.100:6379&mycluster[]=192.168.1.100:6380&mycluster[]=192.168.1.100:6381"
redis.clusters.timeout = "mycluster=5"
redis.clusters.read_timeout = "mycluster=10"
Simulating a simple store session with PHP on redis (cluster):
one.php:
session_start ();
$_SESSION['favcolor'] = 'green';
$_SESSION['animal'] = 'cat';
$_SESSION['time'] = time();
two.php:
session_start();
var_dump($_SESSION);
Got this on apache errors:
PHP Warning: session_start(): Cannot find save handler 'rediscluster' - session startup failed in /var/www/html/one.php on line 4
Any ideas out there what might be the problem ?
从save_path删除尾部的斜杠;)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.