未捕获的异常' Predis \ Response \ ServerException'消息' MOVED 7369

时间:2018-05-27 13:09:56

标签: amazon-web-services redis redis-cluster

获取此错误

  

[error] 1118#1118:* 366在stderr中发送FastCGI:" PHP消息:PHP致命错误:未捕获异常' Predis \ Response \ ServerException'消息' MOVED 7369 10.0.213.16:6379'

我的 Redis连接代码是:

$parameters = array(
                    "scheme" => "tcp",
                    "host" => "testingredis.akf46e.clustercfg.use1.cache.amazonaws.com",
                    "port" => 6379,
                    "database" => 0,
                );


$db = new Predis\Client($parameters, $options);

注意:上述代码在本地工作正常但在我的AWS服务器中无法正常工作。任何帮助将不胜感激。

2 个答案:

答案 0 :(得分:0)

After lots of research successfully completed the redis cluster with the AWS elasticache.

$options    = array('cluster' => 'redis');
    $parameters = array(
        'clusters' => array(
            'default' => array(
                    'scheme' => 'tcp',
                    'host' => 'staging.akf46e.clustercfg.use1.cache.amazonaws.com',
                    'port' => 6379,
                    'database' => 0
            ),
        ),
    );

    $db = new Predis\Client($parameters,$options);

答案 1 :(得分:0)

正在努力解决同样的问题。这是有效的简短版本:

intros