zoukankan      html  css  js  c++  java
  • laravel redis sentinel 和 redis cluster 配置

    laravel redis sentinel配置:

    'redis' => [
        'cluster' => false,
    
        'options' => [
            'replication' => 'sentinel',
            'service' => 'redis-master',
            'parameters' => [
                'password' => 'xxxxxxx',
                'database' => 0,
            ],
        ],
    
        'default' => [
            'tcp://192.168.0.11:27000', 'tcp://192.168.0.23:27002', 'tcp://192.168.0.24:27001',
        ],
    ],

    laravel redis cluster配置:

        'redis' => [
    
            'cluster' => true,
    
            'options' => ['cluster' => 'redis'],
    
            'default' => [
                [
                    'host'     => '192.168.0.11',
                    'port'     => 6381,
                    'database' => 0,
                    'timeout'  => 15,
                    'read_write_timeout' => 1800, //redis客户端连接以后的读写超时时间(默认是60s)
                    'password' => null,
                ],
                [
                    'host'     => '192.168.0.11',
                    'port'     => 6382,
                    'database' => 0,
                    'timeout'  => 15,
                    'read_write_timeout' => 1800,
                    'password' => null,
                ],
                [
                    'host'     => '192.168.0.11',
                    'port'     => 6383,
                    'database' => 0,
                    'timeout'  => 15,
                    'read_write_timeout' => 1800,
                    'password' => null,
                ],
                [
                    'host'     => '192.168.0.11',
                    'port'     => 6384,
                    'database' => 0,
                    'timeout'  => 15,
                    'read_write_timeout' => 1800,
                    'password' => null,
                ],
                [
                    'host'     => '192.168.0.11',
                    'port'     => 6385,
                    'database' => 0,
                    'timeout'  => 15,
                    'read_write_timeout' => 1800,
                    'password' => null,
                ],
                [
                    'host'     => '192.168.0.11',
                    'port'     => 6386,
                    'database' => 0,
                    'timeout'  => 15,
                    'read_write_timeout' => 1800,
                    'password' => null,
                ]
            ],
        ],
  • 相关阅读:
    mysql随笔 -- 基本sql语句
    jdbc驱动底层代码(通过控制器查询数据库的数据)
    项目实战:数据库,服务器,浏览器的登录页面的实现
    JSP随笔
    Session的学习
    servlet请求转发
    Servlet的流程总结
    collection 知识点3
    linux虚拟机,Centos7部署django项目
    python高级函数以及文件操作
  • 原文地址:https://www.cnblogs.com/dongruiha/p/8408999.html
Copyright © 2011-2022 走看看