dpsarr / laravel-redis-sentinel
该包允许通过PHPRedis将laravel连接到Redis Sentinel
v0.1
2021-06-10 15:48 UTC
Requires
- php: ^7.3|^8.0
- ext-redis: *
- laravel/laravel: ^6.0
Requires (Dev)
- phpunit/phpunit: ^9.0
README
允许通过Redis Sentinel连接到Redis
在config/database.php中更改redis配置
'redis' => [ 'client' => env('REDIS_CLIENT', 'phpredis'), 'options' => [ 'cluster' => env('REDIS_CLUSTER', 'redis'), 'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'), ], 'default' => [ 'password' => env('REDIS_PASSWORD', null), 'database' => env('REDIS_DB', '0'), 'master' => 'mymaster', 'sentinel' => [ 'hosts' => [ '172.21.0.1' => 26379, ], 'timeout' => 0, 'persistent' => null, 'retry_interval' => 0, 'read_timeout' => 0, ], ], ],