• 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修改库、表、字段 字符集,中文排序
    CENTOS6.5 编译安装MySQL5.7.14
    自己的一个小小的目标
    css 浮动和清除浮动
    移动端调试方法
    Fiddler抓包工具总结
    Vue中错误图片的处理
    跨域资源共享 CORS 详解
    十大排序算法JavaScript实现总结
    javascript实现二叉搜索树
  • 原文地址:https://www.cnblogs.com/dongruiha/p/8408999.html
Copyright © 2020-2023  润新知