zoukankan      html  css  js  c++  java
  • laravel中redis集群配置示例

    'redis' => [
    
            'options' => [
                'prefix' => 'api_',
                'cluster' => 'redis', //使用原生集群
            ],
    
            'client' => 'predis',
            
            //  单机
            'stand_alone' => [
                    [
                        'host' => '127.0.0.1',
                        'password' => '',
                        'port' => 6379,
                        'database' => 0,
                    ],
            ],
            //集群
            'clusters' => [
                'default' => [
                    [
                        'host' => env('REDIS_MS_HOST1','127.0.0.1'),
                        'port' => env('REDIS_MS_PORT1','6379'),
                        'database' => 0,
                    ],
                    [
                        'host' => env('REDIS_MS_HOST2','127.0.0.1'),
                        'port' => env('REDIS_MS_PORT2','6379'),
                        'database' => 0,
                    ],
                    [
                        'host' => env('REDIS_MS_HOST3','127.0.0.1'),
                        'port' => env('REDIS_MS_PORT3','6379'),
                        'database' => 0,
                    ],
                    [
                        'host' => env('REDIS_MS_HOST4','127.0.0.1'),
                        'port' => env('REDIS_MS_PORT4','6379'),
                        'database' => 0,
                    ],
                    [
                        'host' => env('REDIS_MS_HOST5','127.0.0.1'),
                        'port' => env('REDIS_MS_PORT5','6379'),
                        'database' => 0,
                    ],
                    [
                        'host' => env('REDIS_MS_HOST6','127.0.0.1'),
                        'port' => env('REDIS_MS_PORT6','6379'),
                        'database' => 0,
                    ],
                    'options' => [
                        'prefix' => 'api_',
                        'cluster' => 'redis', //使用原生集群
                        'parameters' => [
                            'password' => env('REDIS_MS_PASSWORD'),
                        ]
                    ],
                ],
            ],
        ],
  • 相关阅读:
    6.1.1.1 属性类型之数据属性
    6.1 理解对象
    5.7.2.4 random() 方法
    5.7.2.3 舍入方法
    5.7.2.2 min()和max()方法
    5.7.2.1 Math对象
    5.7.1.4 window对象
    frontend2_s9_part2_fe_d48_form
    s10_part3_django_basic.md
    frontend1_s9_part2_d47_html
  • 原文地址:https://www.cnblogs.com/wjs2019/p/14808360.html
Copyright © 2011-2022 走看看