diff --git a/config/broadcasting.php b/config/broadcasting.php index 3ca45eaa8523..d034dccb2178 100644 --- a/config/broadcasting.php +++ b/config/broadcasting.php @@ -43,7 +43,7 @@ return [ 'redis' => [ 'driver' => 'redis', - 'connection' => 'default', + 'connection' => env('REDIS_BROADCAST_CONNECTION', 'default'), ], 'log' => [ diff --git a/config/cache.php b/config/cache.php index 4f41fdf966b5..b054ca87d6f7 100644 --- a/config/cache.php +++ b/config/cache.php @@ -74,7 +74,7 @@ return [ 'redis' => [ 'driver' => 'redis', - 'connection' => 'cache', + 'connection' => env('REDIS_CACHE_CONNECTION', 'cache'), ], 'dynamodb' => [ diff --git a/config/database.php b/config/database.php index 1d338edd5dba..a59440a08e5f 100644 --- a/config/database.php +++ b/config/database.php @@ -153,6 +153,42 @@ return [ 'database' => env('REDIS_CACHE_DB', 1), ], + 'sentinel-default' => array_merge( + array_map( + function ($a, $b) { + return ["host" => $a,"port" => $b]; + }, + explode(',', env('REDIS_HOST', 'localhost')), + explode(',', env('REDIS_PORT', 26379)) + ), + ['options' => [ + 'replication' => 'sentinel', + 'service' => env('REDIS_SENTINEL_SERVICE', 'mymaster'), + 'parameters' => [ + 'password' => env('REDIS_PASSWORD', null), + 'database' => env('REDIS_DB', 0), + ], + ]] + ), + + 'sentinel-cache' => array_merge( + array_map( + function ($a, $b) { + return ["host" => $a,"port" => $b]; + }, + explode(',', env('REDIS_HOST', 'localhost')), + explode(',', env('REDIS_PORT', 26379)) + ), + ['options' => [ + 'replication' => 'sentinel', + 'service' => env('REDIS_SENTINEL_SERVICE', 'mymaster'), + 'parameters' => [ + 'password' => env('REDIS_PASSWORD', null), + 'database' => env('REDIS_CACHE_DB', 1), + ], + ]] + ), + ], ]; diff --git a/config/queue.php b/config/queue.php index dc2d4665ea47..8f826c982be9 100644 --- a/config/queue.php +++ b/config/queue.php @@ -61,7 +61,7 @@ return [ 'redis' => [ 'driver' => 'redis', - 'connection' => 'default', + 'connection' => env('REDIS_QUEUE_CONNECTION', 'default'), 'queue' => env('REDIS_QUEUE', 'default'), 'retry_after' => 90000000, 'block_for' => null,