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,
            ]
        ],
    ],

 

相关文章:

  • 2022-03-09
  • 2021-07-02
  • 2022-12-23
  • 2022-01-08
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-01-30
  • 2021-11-03
  • 2021-12-15
  • 2021-07-24
  • 2022-12-23
相关资源
相似解决方案