【问题标题】:Uncaught exception 'Predis\Response\ServerException' with message 'MOVED 7369未捕获的异常“Predis\Response\ServerException”,消息为“MOVED 7369”
【发布时间】:2018-11-06 05:28:37
【问题描述】:

得到这个错误

[error] 1118#1118: *366 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught exception 'Predis\Response\ServerException' with message '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 服务器中无法运行。任何帮助将不胜感激。

【问题讨论】:

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


    【解决方案1】:

    同样在苦苦挣扎。这是有效方法的简短版本:

    $redis = new Predis\Client(
       ['tcp://127.0.0.1:6379'],
       ['cluster' => 'redis']
    );
    

    【讨论】:

      【解决方案2】:
      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' => HOST_URL,
                          'port' => 6379,
                          'database' => 0
                  ),
              ),
          );
      
          $db = new Predis\Client($parameters,$options);
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2013-10-10
        • 2014-08-08
        • 1970-01-01
        • 2013-02-01
        • 1970-01-01
        • 2011-06-09
        • 2015-01-04
        • 1970-01-01
        相关资源
        最近更新 更多