GithubHelp home page GithubHelp logo

monospice / laravel-redis-sentinel-drivers Goto Github PK

View Code? Open in Web Editor NEW
101.0 101.0 48.0 182 KB

Redis Sentinel integration for Laravel and Lumen.

License: MIT License

PHP 93.05% Shell 6.95%
laravel lumen php redis redis-sentinel

laravel-redis-sentinel-drivers's People

Contributors

cyrossignol avatar jacovdbergh avatar pdbreen avatar yupmin-ct avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

laravel-redis-sentinel-drivers's Issues

NotSupportedException on PUB/SUB psubscribe

Thandks for you project first.
After config redis sentinel when using

RedisSentinel::psubscribe(['*'], function ($message) {
...
}

meet this exception

[Predis\NotSupportedException]                                    
  Cannot initialize a PUB/SUB consumer over aggregate connections.

I'm using Laravel 5.2, and I have the aggregate connections issue

Predis\NotSupportedException: Cannot initialize a MULTI/EXEC transaction over aggregate connections
I found the latest version maybe has fixed, but how about Laravel 5.2?
Because I used version "monospice/laravel-redis-sentinel-drivers": "^1.0",.
Sorry for my poor English.

Compatible with redis cluster

Is this package compatible with redis clustering?

I got the following error.

Predis\\Response\\ServerException MOVED 6918 x.x.x.x:6379

Am I missing something?

routes/web.php

use Monospice\LaravelRedisSentinel\RedisSentinel;

Route::get('/ping', function () {
    RedisSentinel::get('test');
});
 "exception": "Predis\\Response\\ServerException",
    "file": "/var/www/html/vendor/predis/predis/src/Client.php",
    "line": 370,
    "trace": [
        {
            "file": "/var/www/html/vendor/predis/predis/src/Client.php",
            "line": 335,
            "function": "onErrorResponse",
            "class": "Predis\\Client",
            "type": "->"
        },
        {
            "file": "/var/www/html/vendor/predis/predis/src/Client.php",
            "line": 314,
            "function": "executeCommand",
            "class": "Predis\\Client",
            "type": "->"
        },
        {
            "file": "/var/www/html/vendor/laravel/framework/src/Illuminate/Redis/Connections/Connection.php",
            "line": 114,
            "function": "__call",
            "class": "Predis\\Client",
            "type": "->"
        },
        {
            "file": "/var/www/html/vendor/laravel/framework/src/Illuminate/Redis/Connections/Connection.php",
            "line": 214,
            "function": "command",
            "class": "Illuminate\\Redis\\Connections\\Connection",
            "type": "->"
        },
        {
            "file": "/var/www/html/vendor/laravel/framework/src/Illuminate/Redis/RedisManager.php",
            "line": 214,
            "function": "__call",
            "class": "Illuminate\\Redis\\Connections\\Connection",
            "type": "->"
        },
        {
            "function": "__call",
            "class": "Illuminate\\Redis\\RedisManager",
            "type": "->"
        },
        {
            "file": "/var/www/html/vendor/monospice/spicy-identifiers/src/DynamicMethod.php",
            "line": 62,
            "function": "call_user_func_array"
        },
        {
            "file": "/var/www/html/vendor/monospice/laravel-redis-sentinel-drivers/src/RedisSentinelManager.php",
            "line": 96,
            "function": "callOn",
            "class": "Monospice\\SpicyIdentifiers\\DynamicMethod",
            "type": "->"
        },
        {
            "file": "/var/www/html/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php",
            "line": 237,
            "function": "__call",
            "class": "Monospice\\LaravelRedisSentinel\\RedisSentinelManager",
            "type": "->"
        },
REDIS_PASSWORD=null
REDIS_HOST="172.22.0.54"
REDIS_PORT=26379
REDIS_SENTINEL_SERVICE=master
REDIS_SENTINEL_TIMEOUT=10
REDIS_CACHE_DATABASE=1
REDIS_SESSION_DATABASE=2
REDIS_QUEUE_DATABASE=3
CACHE_DRIVER=redis-sentinel
SESSION_DRIVER=redis-sentinel
QUEUE_DRIVER=redis-sentinel
REDIS_DRIVER=redis-sentinel

Question: can it be used w/Horizon?

Looks like a great package and I have plans to integrate & deploy early next week - provided it can be used w/Horizon (which requires/uses Redis to process queues and for all its tracking info). I'm assuming yes, that what's ultimately returned is / or implements that Laravel Redis interface, but thought I'd ask before diving in and hitting a dead end.

Any positive/negative results from others when using Horizon?

Thanks!

phpredis can be used?

hi,i have a question, phpredis can be used?
if i dont use predis,only use phpredis extension?

Struggling to get Queues working with redis sentinel

Hey!

First - thanks for writing a redis sentinel driver, much appreciated. I'm deploying this driver alongside an upgrade to laravel 5.5, and my infrastructure uses a group of 3 sentinels.

I seem to be connected to laravel with this driver ok, as running (string)app('redis-sentinel')->connection()->ping() equals 'PONG'

But my queues, which are run via supervisor, are no longer processing. Relevant code pasted below:

Supervisor conf template:

[program:text-message-queue]
process_name=%(program_name)s_%(process_num)02d
command=php artisan queue:work redis-sentinel --queue=text_message --sleep=5 --tries=7 --env=production
autostart=true
autorestart=true
user=www-data
numprocs=2
redirect_stderr=true
stdout_logfile=/logs/worker.log

[program:order-callback-queue]
process_name=%(program_name)s_%(process_num)02d
command=php artisan queue:work redis-sentinel --queue=order_callback --sleep=5 --tries=7 --env=production
autostart=true
autorestart=true
user=www-data
numprocs=2
redirect_stderr=true
stdout_logfile=/var/www/adopterluv/storage/logs/worker.log

[program:email-queue]
process_name=%(program_name)s_%(process_num)02d
command=php artisan queue:work redis-sentinel --queue=email --sleep=3 --tries=7 --env=production
autostart=true
autorestart=true
user=www-data
numprocs=2
redirect_stderr=true
stdout_logfile=/logs/worker.log

[group:laravel-workers]
programs=text-message-queue,order-callback-queue,email-queue

And my database config looks like this:

'redis-sentinel' => [
    'default' => [
        [
            'host' => env('REDIS_HOST', 'localhost'),
            'port' => env('REDIS_PORT', 26379)
        ],
        [
            'host' => env('REDIS_HOST_2', 'localhost'),
            'port' => env('REDIS_PORT', 26379)
        ],
        [
            'host' => env('REDIS_HOST_3', 'localhost'),
            'port' => env('REDIS_PORT', 26379)
        ],
        'options' => [
            'service' => env('REDIS_SENTINEL_SERVICE', 'mymaster'),
            'parameters' => [
                'password' => env('REDIS_PASSWORD', null),
                'database' => 0,
            ],
        ],
    ],

    'cache' => [
        [
            'host' => env('REDIS_HOST', 'localhost'),
            'port' => env('REDIS_PORT', 26379)
        ],
        [
            'host' => env('REDIS_HOST_2', 'localhost'),
            'port' => env('REDIS_PORT', 26379)
        ],
        [
            'host' => env('REDIS_HOST_3', 'localhost'),
            'port' => env('REDIS_PORT', 26379)
        ],
        'options' => [
            'service' => env('REDIS_SENTINEL_SERVICE', 'mymaster'),
            'parameters' => [
                'password' => env('REDIS_PASSWORD', null),
                'database' => 1,
            ],
        ],
    ],

    'session' => [
        [
            'host' => env('REDIS_HOST', 'localhost'),
            'port' => env('REDIS_PORT', 26379)
        ],
        [
            'host' => env('REDIS_HOST_2', 'localhost'),
            'port' => env('REDIS_PORT', 26379)
        ],
        [
            'host' => env('REDIS_HOST_3', 'localhost'),
            'port' => env('REDIS_PORT', 26379)
        ],
        'options' => [
            'service' => env('REDIS_SENTINEL_SERVICE', 'mymaster'),
            'parameters' => [
                'password' => env('REDIS_PASSWORD', null),
                'database' => 2,
            ],
        ],
    ],

    'queue' => [
        [
            'host' => env('REDIS_HOST', 'localhost'),
            'port' => env('REDIS_PORT', 26379)
        ],
        [
            'host' => env('REDIS_HOST_2', 'localhost'),
            'port' => env('REDIS_PORT', 26379)
        ],
        [
            'host' => env('REDIS_HOST_3', 'localhost'),
            'port' => env('REDIS_PORT', 26379)
        ],
        'options' => [
            'service' => env('REDIS_SENTINEL_SERVICE', 'mymaster'),
            'parameters' => [
                'password' => env('REDIS_PASSWORD', null),
                'database' => 3,
            ],
        ],
    ],
],

My connections array in queue.php has this entry:

'redis-sentinel' => [
    'driver' => 'redis-sentinel',
    'connection' => 'queue',
    'queue' => 'default',
    'retry_after' => 90, // Laravel >= 5.4.30
],

The env variable QUEUE_DRIVER is set to redis-sentinel. I enqueue various jobs like this to the different queues:

$job = (new SendCheckoutTextMessage($this, $adapter))->onQueue('text_message');
$this->dispatch($job);

Have you had an issues getting queues working?

Integration with other packages

Hi,

I have asked this same question here arquivei/laravel-prometheus-exporter#20, but did not receive any guidance, I will try my luck here.
I'm using both, this package redis sentinel driver and that other laravel prometheus package, but I do not know how to config the prometheus exporter to use the sentinel driver. The redis sentinel is configured ok for all laravel services (horizon, broadcast, cache, ...).
Should this work out-of-the-box following the standard configuration detailed here https://github.com/monospice/laravel-redis-sentinel-drivers#configuration ? Do you have any recommendations for this case?
I could not get the exporter to populate metrics with the sentinel driver but it works ok with standard redis, thanks!
Cheers,
Jacq

Add support for Redis Manager constructor in Laravel 5.7

Too few arguments to function Illuminate\Redis\RedisManager::__construct(), 2 passed in /Users/yupmin/PhpstormProjects/xxxxxxxx/vendor/monospice/laravel-redis-sentinel-drivers/src/Manager/VersionedManagerFactory.php on line 65 and exactly 3 expected

https://github.com/illuminate/redis/blob/v5.7.4/RedisManager.php

    /**
     * Create a new Redis manager instance.
     *
     * @param  \Illuminate\Foundation\Application  $app
     * @param  string  $driver
     * @param  array  $config
     * @return void
     */
    public function __construct($app, $driver, array $config)
    {
        $this->app = $app;
        $this->driver = $driver;
        $this->config = $config;
    }

https://github.com/illuminate/redis/blob/v5.6.38/RedisManager.php

    /**
     * Create a new Redis manager instance.
     *
     * @param  string  $driver
     * @param  array  $config
     * @return void
     */
    public function __construct($driver, array $config)
    {
        $this->driver = $driver;
        $this->config = $config;
    }

start-cluster.sh not working

When I run start-cluster, I get this. What seems to be the problem here?

$ sh start-cluster.sh
: not founder.sh: 34:
: not founder.sh: 45:
start-cluster.sh: 47: Syntax error: "&&" unexpected

Homestead 10.1.1
Laravel 8

No sentinel server available for autodiscovery.

Hi,

  1. Using laravel 5.3, when the replication option is passed to the redis server it gives the above error. If I do not pass this value, I get the message "READONLY: You cannot write against a read only slave".

  2. On the host file if I use the port 26379, it is unable to execute commands SET or GET command through that server.

  3. Also, noticed in the test cases, there is a stub for configuration file that is using port 6379 but in the documentation it is mentioned to use the 26379, which one to use for.

Trying to troubleshoot this issue from past few hours but no avail.

Will appreciate any help.

Thanks

Predis Error on Horizon - unknown command 'SENTINEL'

I have a Redis Sentinel cluster for our production servers -- the web servers have been running for the past year and have had zero issues. Tried originally to setup Horizon to use our cluster but wasn't ever able to originally, but decided it was time to try again.

official error: production.ERROR: ERR unknown command 'SENTINEL' {"exception":"[object] (Predis\Response\ServerException(code: 0): ERR unknown command 'SENTINEL' at /var/www/tennispoint/vendor/predis/predis/src/Connection/Aggregate/SentinelReplication.php:332)

Yes, we are running Sentinel on all 3 Redis Servers, but interesting thing is we can't run a "sentinel command" from CLI either. I CAN though on the CLI run it with Redis-cli first like this: redis-cli -p 26379 sentinel slaves mymaster

If it is a "redis sentinel server setup" weird though production servers never complain for cache, session, etc stored there.

From what I can tell all is configured correctly for our "Horizon server" and since our "non-horizon laravel" servers aren't having in issue with Redis Sentinel wondering if something else?

To be sure here is our configs overall - Laravel 6.x & latest laravel-redis-sentinel package

My .env file contains:

REDIS_DRIVER=redis-sentinel
QUEUE_CONNECTION=redis-sentinel

REDIS_HORIZON_HOST=ip1,slave-ip1,slave-ip2
REDIS_HORIZON_PORT=26379
REDIS_HORIZON_DB=3
REDIS_QUEUE_DATABASE=3
REDIS_SENTINEL_SERVICE=mymaster
HORIZON_DRIVER=redis-sentinel
REDIS_CLUSTER=redis-sentinel

My database.php file contains:

'redis' => [

        'client' => env('REDIS_CLIENT', 'phpredis'),

        'options' => [
            'cluster' => env('REDIS_CLUSTER', 'redis'),
            'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'),
        ],

        'default' => [
            'url' => env('REDIS_URL'), /* not used */
            'host' => env('REDIS_HORIZON_HOST', '127.0.0.1'),
            'password' => env('REDIS_HORIZON_PASSWORD', null),
            'port' => env('REDIS_HORIZON_PORT', 6379),
            'database' => env('REDIS_HORIZON_DB', 0),
        ],

My Horizon.php file contains:

'use' => 'default',
'waits' => [
        'redis-sentinel:default' => 60,
 ],
'driver' => 'redis-sentinel',

'environments' => [
        'production' => [
            'supervisor-1' => [
                'connection' => 'redis-sentinel',
                'queue' => ['emailSend', 'pushNotify'],
                'balance' => 'auto',
                'processes' => 10,
                'tries' => 2,
                'retry_after' => 2000,
                'timeout' => 600,
            ],

My Queue.php file contains the following:

'connections' => [
        'redis' => [
            'driver' => 'redis-sentinel',
            'connection' => 'default',
            'queue' => env('REDIS_QUEUE', 'default'),
            'retry_after' => 90,
            'block_for' => null,
        ],
        'redis-sentinel' => [
            'driver' => 'redis-sentinel',
            'connection' => 'default',
            'queue' => 'default',
            'retry_after' => 3666,
            'expire' => 3666,
        ],
    ],

Just in case, here is the full stack trace:

[2020-01-25 19:24:51] production.ERROR: ERR unknown command 'SENTINEL' {"exception":"[object] (Predis\\Response\\ServerException(code: 0): ERR unknown command 'SENTINEL' at /var/www/tennispoint/vendor/predis/predis/src/Connection/Aggregate/SentinelReplication.php:332)
[stacktrace]
#0 /var/www/tennispoint/vendor/predis/predis/src/Connection/Aggregate/SentinelReplication.php(355): Predis\\Connection\\Aggregate\\SentinelReplication->handleSentinelErrorResponse(Object(Predis\\Connection\\StreamConnection), Object(Predis\\Response\\Error))
#1 /var/www/tennispoint/vendor/predis/predis/src/Connection/Aggregate/SentinelReplication.php(427): Predis\\Connection\\Aggregate\\SentinelReplication->querySentinelForMaster(Object(Predis\\Connection\\StreamConnection), 'mymaster')
#2 /var/www/tennispoint/vendor/predis/predis/src/Connection/Aggregate/SentinelReplication.php(498): Predis\\Connection\\Aggregate\\SentinelReplication->getMaster()
#3 /var/www/tennispoint/vendor/predis/predis/src/Connection/Aggregate/SentinelReplication.php(536): Predis\\Connection\\Aggregate\\SentinelReplication->getConnectionInternal(Object(Predis\\Command\\ServerEval))
#4 /var/www/tennispoint/vendor/predis/predis/src/Connection/Aggregate/SentinelReplication.php(658): Predis\\Connection\\Aggregate\\SentinelReplication->getConnection(Object(Predis\\Command\\ServerEval))
#5 /var/www/tennispoint/vendor/predis/predis/src/Connection/Aggregate/SentinelReplication.php(698): Predis\\Connection\\Aggregate\\SentinelReplication->retryCommandOnFailure(Object(Predis\\Command\\ServerEval), 'executeCommand')
#6 /var/www/tennispoint/vendor/predis/predis/src/Client.php(331): Predis\\Connection\\Aggregate\\SentinelReplication->executeCommand(Object(Predis\\Command\\ServerEval))
#7 /var/www/tennispoint/vendor/predis/predis/src/Client.php(314): Predis\\Client->executeCommand(Object(Predis\\Command\\ServerEval))
#8 /var/www/tennispoint/vendor/laravel/framework/src/Illuminate/Redis/Connections/Connection.php(116): Predis\\Client->__call('eval', Array)
#9 /var/www/tennispoint/vendor/laravel/framework/src/Illuminate/Redis/Connections/Connection.php(220): Illuminate\\Redis\\Connections\\Connection->command('eval', Array)
#10 /var/www/tennispoint/vendor/laravel/framework/src/Illuminate/Queue/RedisQueue.php(105): Illuminate\\Redis\\Connections\\Connection->__call('eval', Array)
#11 /var/www/tennispoint/vendor/laravel/framework/src/Illuminate/Queue/RedisQueue.php(91): Illuminate\\Queue\\RedisQueue->pushRaw('{\"displayName\":...', 'emailTrack')
#12 /var/www/tennispoint/vendor/laravel/framework/src/Illuminate/Queue/Queue.php(44): Illuminate\\Queue\\RedisQueue->push(Object(App\\Jobs\\EmailOpened), '', 'emailTrack')
#13 /var/www/tennispoint/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(177): Illuminate\\Queue\\Queue->pushOn('emailTrack', Object(App\\Jobs\\EmailOpened))
#14 /var/www/tennispoint/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(160): Illuminate\\Bus\\Dispatcher->pushCommandToQueue(Object(Illuminate\\Queue\\RedisQueue), Object(App\\Jobs\\EmailOpened))
#15 /var/www/tennispoint/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(73): Illuminate\\Bus\\Dispatcher->dispatchToQueue(Object(App\\Jobs\\EmailOpened))
#16 /var/www/tennispoint/vendor/laravel/framework/src/Illuminate/Foundation/Bus/DispatchesJobs.php(17): Illuminate\\Bus\\Dispatcher->dispatch(Object(App\\Jobs\\EmailOpened))
#17 /var/www/tennispoint/app/Http/Controllers/SesMessageLoggingController.php(358): App\\Http\\Controllers\\Controller->dispatch(Object(App\\Jobs\\EmailOpened))
#18 [internal function]: App\\Http\\Controllers\\SesMessageLoggingController->opened('20950422', 'eyJQSUQiOiIwIiw...', Object(Illuminate\\Http\\Request))
#19 /var/www/tennispoint/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): call_user_func_array(Array, Array)
#20 /var/www/tennispoint/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(45): Illuminate\\Routing\\Controller->callAction('opened', Array)
#21 /var/www/tennispoint/vendor/laravel/framework/src/Illuminate/Routing/Route.php(219): Illuminate\\Routing\\ControllerDispatcher->dispatch(Object(Illuminate\\Routing\\Route), Object(App\\Http\\Controllers\\SesMessageLoggingController), 'opened')
#22 /var/www/tennispoint/vendor/laravel/framework/src/Illuminate/Routing/Route.php(176): Illuminate\\Routing\\Route->runController()
#23 /var/www/tennispoint/vendor/laravel/framework/src/Illuminate/Routing/Router.php(681): Illuminate\\Routing\\Route->run()
#24 /var/www/tennispoint/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(130): Illuminate\\Routing\\Router->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))
#25 /var/www/tennispoint/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php(41): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#26 /var/www/tennispoint/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\\Routing\\Middleware\\SubstituteBindings->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#27 /var/www/tennispoint/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php(49): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#28 /var/www/tennispoint/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\\View\\Middleware\\ShareErrorsFromSession->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#29 /var/www/tennispoint/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(56): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#30 /var/www/tennispoint/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\\Session\\Middleware\\StartSession->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#31 /var/www/tennispoint/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php(37): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#32 /var/www/tennispoint/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\\Cookie\\Middleware\\AddQueuedCookiesToResponse->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#33 /var/www/tennispoint/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(66): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#34 /var/www/tennispoint/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\\Cookie\\Middleware\\EncryptCookies->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#35 /var/www/tennispoint/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(105): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#36 /var/www/tennispoint/vendor/laravel/framework/src/Illuminate/Routing/Router.php(683): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))
#37 /var/www/tennispoint/vendor/laravel/framework/src/Illuminate/Routing/Router.php(658): Illuminate\\Routing\\Router->runRouteWithinStack(Object(Illuminate\\Routing\\Route), Object(Illuminate\\Http\\Request))
#38 /var/www/tennispoint/vendor/laravel/framework/src/Illuminate/Routing/Router.php(624): Illuminate\\Routing\\Router->runRoute(Object(Illuminate\\Http\\Request), Object(Illuminate\\Routing\\Route))
#39 /var/www/tennispoint/vendor/laravel/framework/src/Illuminate/Routing/Router.php(613): Illuminate\\Routing\\Router->dispatchToRoute(Object(Illuminate\\Http\\Request))
#40 /var/www/tennispoint/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(170): Illuminate\\Routing\\Router->dispatch(Object(Illuminate\\Http\\Request))
#41 /var/www/tennispoint/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(130): Illuminate\\Foundation\\Http\\Kernel->Illuminate\\Foundation\\Http\\{closure}(Object(Illuminate\\Http\\Request))
#42 /var/www/tennispoint/vendor/fideloper/proxy/src/TrustProxies.php(57): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#43 /var/www/tennispoint/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Fideloper\\Proxy\\TrustProxies->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#44 /var/www/tennispoint/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#45 /var/www/tennispoint/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#46 /var/www/tennispoint/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#47 /var/www/tennispoint/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#48 /var/www/tennispoint/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#49 /var/www/tennispoint/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#50 /var/www/tennispoint/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php(63): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#51 /var/www/tennispoint/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\\Foundation\\Http\\Middleware\\CheckForMaintenanceMode->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#52 /var/www/tennispoint/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(105): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#53 /var/www/tennispoint/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(145): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))
#54 /var/www/tennispoint/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(110): Illuminate\\Foundation\\Http\\Kernel->sendRequestThroughRouter(Object(Illuminate\\Http\\Request))
#55 /var/www/tennispoint/public/index.php(55): Illuminate\\Foundation\\Http\\Kernel->handle(Object(Illuminate\\Http\\Request))
#56 {main}
"} 

Lumen compatibility

There is a lumen compatibility issue with v2.0.0. Error as follows:

lumen.ERROR: Symfony\Component\Debug\Exception\FatalErrorException: Access level to Monospice\LaravelRedisSentinel\RedisSentinelManager::resolve() must be public (as in class Illuminate\Redis\RedisManager) in /var/www/oase-favorites/vendor/monospice/laravel-redis-sentinel-drivers/src/RedisSentinelManager.php:29
Stack trace:
#0 /var/www/oase-favorites/vendor/laravel/lumen-framework/src/Concerns/RegistersExceptionHandlers.php(54): Laravel\Lumen\Application->handleShutdown()
#1 [internal function]: Laravel\Lumen\Application->Laravel\Lumen\Concerns\{closure}()
#2 {main} 

To fix, RedisSentinelManager->resolve($name) must be public, and $name be optional.

-    protected function resolve($name)
+    public function resolve($name = null)

v2.1.0 is not compatible with lumen, as the illuminate\foundation package is required, and it injects a ton of BS into lumen you simply don't need. You might as well run Laravel at that point. Can we have a v2.0.1 with the above fix in?

How to check if the client is connected?

i want to know that the sentinel is first connected with each connection?then connect redis?
I want to know the specific process of connection,please tell me

[Question] How to set prefix with your package ??

Hi, I'm trying to set prefix for my redis sentinel with your package. When I used single redis master, it uses the prefix from configuration file. But for sentinel, it is not working. Can you please help?

Using Lumen v6.3.5

My configuration:

'redis' => [
    'driver' => env('REDIS_DRIVER', 'redis-sentinel'),

    'client' => 'predis',

    'cluster' => env('REDIS_CLUSTER', false),

    'default' => [
        'host' => env('REDIS_HOST'),
        'password' => env('REDIS_PASSWORD', null),
        'port' => env('REDIS_PORT', 6379),
        'database' => env('REDIS_DB', 0),
        'read_write_timeout' => 60,
        'prefix' => env('REDIS_PREFIX', ''),
    ],
],

Queue driver doesn't work in Laravel 5.2 and below

As @jacovdbergh found in #3, the queue implementation in Laravel 5.2 and below does not support transactions over a set of Redis servers behind Sentinel. Here's the exception:

Cannot initialize a MULTI/EXEC transaction over aggregate connections.

The package will need to implement the LuaScripts added to Laravel 5.3. Besides this issue, the LuaScripts solve some other race conditions faced by the older Laravel Redis Queue implementation, so backporting these will improve the package in other ways as well.

Multiple host configuration not as readme currently states

https://github.com/monospice/laravel-redis-sentinel-drivers#multi-service-configuration

Using that config array did not work for me, the following did work:

redis-sentinel => [
     "queue" => [
       "10.0.0.1:26379",
       "10.0.0.2:26379",
       "options" => [
         "service" => "db1",
         "parameters" => [
           "database" => 1,
           "password" => null,
         ],
       ],
     ],
     "cache" => [
       "10.0.0.1:26379",
       "10.0.0.2:26379",
       "options" => [
         "service" => "db1",
         "parameters" => [
           "database" => 2,
           "password" => null,
         ],
       ],
     ],
     "session" => [
       "10.0.0.1:26379",
       "10.0.0.2:26379",
       "options" => [
         "service" => "db1",
         "parameters" => [
           "database" => 3,
           "password" => null,
         ],
       ],
     ],
   ]

Is it something I'm doing wrong?
Using Predis 1.1, Laravel 5.2

Cache driver `redis-sentinel` not supported with Telescope

This packages implementation is broken in Laravel 7. When you set your CACHE_DRIVER=redis-sentinel, it breaks with the following error:

  InvalidArgumentException 

  Driver [redis-sentinel] is not supported.

  at vendor/laravel/framework/src/Illuminate/Cache/CacheManager.php:110
    106|             if (method_exists($this, $driverMethod)) {
    107|                 return $this->{$driverMethod}($config);
    108|             } else {
    109|                 // dd(get_class($this), debug_backtrace(null, 2));
  > 110|                 throw new InvalidArgumentException("Driver [{$config['driver']}] is not supported.");
    111|             }
    112|         }
    113|     }
    114| 

      +15 vendor frames 
  16  [internal]:0
      Illuminate\Foundation\Application::Illuminate\Foundation\{closure}(Object(Laravel\Telescope\TelescopeServiceProvider))

      +5 vendor frames 
  22  artisan:35
      Illuminate\Foundation\Console\Kernel::handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

it is not supported by laravel 7

when i install packeage ... i get the error:

Your requirements could not be resolved to an installable set of packages.

Problem 1
- Conclusion: remove laravel/framework v7.0.8
- Conclusion: don't install laravel/framework v7.0.8
- monospice/laravel-redis-sentinel-drivers 2.6.0 requires illuminate/support ^5.4 || ^6.0 -> satisfiable by laravel/framework[5.7.x-dev, 5.8.x-dev, 6.x-dev], illuminate/support[5.4.x-dev, 5.5.x-dev, 5.6.x-dev, 5.7.17, 5.7.18, 5.7.19, 5.7.x-dev, 5.8.x-dev, 6.x-dev, v5.4.0, v5.4.13, v5.4.17, v5.4.19, v5.4.27, v5.4.36, v5.4.9, v5.5.0, v5.5.16, v5.5.17, v5.5.2, v5.5.28, v5.5.33, v5.5.34, v5.5.35, v5.5.36, v5.5.37, v5.5.39, v5.5.40, v5.5.41, v5.5.43, v5.5.44, v5.6.0, v5.6.1, v5.6.10, v5.6.11, v5.6.12, v5.6.13, v5.6.14, v5.6.15, v5.6.16, v5.6.17, v5.6.19, v5.6.2, v5.6.20, v5.6.21, v5.6.22, v5.6.23, v5.6.24, v5.6.25, v5.6.26, v5.6.27, v5.6.28, v5.6.29, v5.6.3, v5.6.30, v5.6.31, v5.6.32, v5.6.33, v5.6.34, v5.6.35, v5.6.36, v5.6.37, v5.6.38, v5.6.39, v5.6.4, v5.6.5, v5.6.6, v5.6.7, v5.6.8, v5.6.9, v5.7.0, v5.7.1, v5.7.10, v5.7.11, v5.7.15, v5.7.2, v5.7.20, v5.7.21, v5.7.22, v5.7.23, v5.7.26, v5.7.27, v5.7.28, v5.7.3, v5.7.4, v5.7.5, v5.7.6, v5.7.7, v5.7.8, v5.7.9, v5.8.0, v5.8.11, v5.8.12, v5.8.14, v5.8.15, v5.8.17, v5.8.18, v5.8.19, v5.8.2, v5.8.20, v5.8.22, v5.8.24, v5.8.27, v5.8.28, v5.8.29, v5.8.3, v5.8.30, v5.8.31, v5.8.32, v5.8.33, v5.8.34, v5.8.35, v5.8.36, v5.8.4, v5.8.8, v5.8.9, v6.0.0, v6.0.1, v6.0.2, v6.0.3, v6.0.4, v6.1.0, v6.10.0, v6.11.0, v6.12.0, v6.13.0, v6.13.1, v6.14.0, v6.15.0, v6.15.1, v6.16.0, v6.17.0, v6.17.1, v6.18.0, v6.2.0, v6.3.0, v6.4.1, v6.5.0, v6.5.1, v6.5.2, v6.6.0, v6.6.1, v6.6.2, v6.7.0, v6.8.0].

Does this driver add latency?

I tried to use this driver in a production setup with 3 Sentinel instances on a 1 Master + 2 Replica cluster but I ended up with 20ms extra latency in the response time.

In a single Redis node situation, we have a response time around 47ms. But after using this driver, the response time increased to about 70ms.

I want to know what caused this latency. Is it the driver or it's a natural behavior in a Redis Sentinel cluster?

Thanks.

Support for Redis ACL

In later versions of Redis, they are promoting the use of ACL's rather than a single master password which will soon be considered deprecated.

Is it possible for this package to support ACLs?

Thanks,
Chris.

Exception from Predis when a job failed

Every time a job failed, we got an exception in the worker.

[2019-09-12 08:50:10] development.ERROR: ERR value is not a valid float {"exception":"[object] (Predis\\Response\\ServerException(code: 0): ERR value is not a valid float at /var/www/html/vendor/predis/predis/src/Pipeline/Pipeline.php:102)

�
[stacktrace]

#0 /var/www/html/vendor/predis/predis/src/Pipeline/Pipeline.php(147): Predis\\Pipeline\\Pipeline->exception(Object(Predis\\Connection\\Aggregate\\SentinelReplication), Object(Predis\\Response\\Error))


#1 /var/www/html/vendor/predis/predis/src/Pipeline/Pipeline.php(166): Predis\\Pipeline\\Pipeline->executePipeline(Object(Predis\\Connection\\Aggregate\\SentinelReplication), Object(SplQueue))


#2 /var/www/html/vendor/predis/predis/src/Pipeline/Pipeline.php(215): Predis\\Pipeline\\Pipeline->flushPipeline()


#3 /var/www/html/vendor/predis/predis/src/Client.php(445): Predis\\Pipeline\\Pipeline->execute(Object(Closure))


#4 /var/www/html/vendor/predis/predis/src/Client.php(396): Predis\\Client->createPipeline(NULL, Object(Closure))


#5 /var/www/html/vendor/predis/predis/src/Client.php(418): Predis\\Client->sharedContextFactory('createPipeline', Array)


#6 /var/www/html/vendor/laravel/framework/src/Illuminate/Redis/Connections/Connection.php(114): Predis\\Client->pipeline(Object(Closure))


#7 /var/www/html/vendor/laravel/framework/src/Illuminate/Redis/Connections/Connection.php(214): Illuminate\\Redis\\Connections\\Connection->command('pipeline', Array)


#8 /var/www/html/vendor/laravel/horizon/src/Repositories/RedisTagRepository.php(103): Illuminate\\Redis\\Connections\\Connection->__call('pipeline', Array)


#9 /var/www/html/vendor/laravel/horizon/src/Listeners/StoreTagsForFailedJob.php(41): Laravel\\Horizon\\Repositories\\RedisTagRepository->addTemporary(2880, 'HyLbvZ2kbjFlznz...', Array)


#10 [internal function]: Laravel\\Horizon\\Listeners\\StoreTagsForFailedJob->handle(Object(Laravel\\Horizon\\Events\\JobFailed))


#11 /var/www/html/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php(366): call_user_func_array(Array, Array)


#12 /var/www/html/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php(196): Illuminate\\Events\\Dispatcher->Illuminate\\Events\\{closure}('Laravel\\\\Horizon...', Array)


#13 /var/www/html/vendor/laravel/horizon/src/Listeners/MarshalFailedEvent.php(44): Illuminate\\Events\\Dispatcher->dispatch('Laravel\\\\Horizon...')


#14 [internal function]: Laravel\\Horizon\\Listeners\\MarshalFailedEvent->handle(Object(Illuminate\\Queue\\Events\\JobFailed))


#15 /var/www/html/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php(366): call_user_func_array(Array, Array)


#16 /var/www/html/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php(196): Illuminate\\Events\\Dispatcher->Illuminate\\Events\\{closure}('Illuminate\\\\Queu...', Array)


#17 /var/www/html/vendor/laravel/framework/src/Illuminate/Queue/Jobs/Job.php(185): Illuminate\\Events\\Dispatcher->dispatch('Illuminate\\\\Queu...')


#18 /var/www/html/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(443): Illuminate\\Queue\\Jobs\\Job->fail(Object(Exception))


#19 /var/www/html/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(430): Illuminate\\Queue\\Worker->failJob(Object(Illuminate\\Queue\\Jobs\\RedisJob), Object(Exception))


#20 /var/www/html/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(358): Illuminate\\Queue\\Worker->markJobAsFailedIfWillExceedMaxAttempts('redis-sentinel', Object(Illuminate\\Queue\\Jobs\\RedisJob), 1, Object(Exception))


#21 /var/www/html/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(331): Illuminate\\Queue\\Worker->handleJobException('redis-sentinel', Object(Illuminate\\Queue\\Jobs\\RedisJob), Object(Illuminate\\Queue\\WorkerOptions), Object(Exception))


#22 /var/www/html/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(277): Illuminate\\Queue\\Worker->process('redis-sentinel', Object(Illuminate\\Queue\\Jobs\\RedisJob), Object(Illuminate\\Queue\\WorkerOptions))


#23 /var/www/html/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(118): Illuminate\\Queue\\Worker->runJob(Object(Illuminate\\Queue\\Jobs\\RedisJob), 'redis-sentinel', Object(Illuminate\\Queue\\WorkerOptions))


#24 /var/www/html/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(102): Illuminate\\Queue\\Worker->daemon('redis-sentinel', 'low', Object(Illuminate\\Queue\\WorkerOptions))


#25 /var/www/html/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(86): Illuminate\\Queue\\Console\\WorkCommand->runWorker('redis-sentinel', 'low')


#26 /var/www/html/vendor/laravel/horizon/src/Console/WorkCommand.php(46): Illuminate\\Queue\\Console\\WorkCommand->handle()


#27 [internal function]: Laravel\\Horizon\\Console\\WorkCommand->handle()


#28 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(32): call_user_func_array(Array, Array)


#29 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(90): Illuminate\\Container\\BoundMethod::Illuminate\\Container\\{closure}()


#30 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(34): Illuminate\\Container\\BoundMethod::callBoundMethod(Object(Illuminate\\Foundation\\Application), Array, Object(Closure))


#31 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php(576): Illuminate\\Container\\BoundMethod::call(Object(Illuminate\\Foundation\\Application), Array, Array, NULL)


#32 /var/www/html/vendor/laravel/framework/src/Illuminate/Console/Command.php(183): Illuminate\\Container\\Container->call(Array)


#33 /var/www/html/vendor/symfony/console/Command/Command.php(255): Illuminate\\Console\\Command->execute(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Illuminate\\Console\\OutputStyle))


#34 /var/www/html/vendor/laravel/framework/src/Illuminate/Console/Command.php(170): Symfony\\Component\\Console\\Command\\Command->run(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Illuminate\\Console\\OutputStyle))


#35 /var/www/html/vendor/symfony/console/Application.php(921): Illuminate\\Console\\Command->run(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))


#36 /var/www/html/vendor/symfony/console/Application.php(273): Symfony\\Component\\Console\\Application->doRunCommand(Object(Laravel\\Horizon\\Console\\WorkCommand), Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))


#37 /var/www/html/vendor/symfony/console/Application.php(149): Symfony\\Component\\Console\\Application->doRun(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))


#38 /var/www/html/vendor/laravel/framework/src/Illuminate/Console/Application.php(90): Symfony\\Component\\Console\\Application->run(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))


#39 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(133): Illuminate\\Console\\Application->run(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))


#40 /var/www/html/artisan(49): Illuminate\\Foundation\\Console\\Kernel->handle(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))


#41 {main}
"} 

When we log the command sent to redis before the exception:

Predis\Command\ZSetAdd::__set_state(array(
   'arguments' => 
(
    0 => 'horizon:0.0.0:failed:api:4054',
    1 => 'HyLbvZ2kbjFlznzM0nHMrOuOF1Ap47zV',
    2 => 'HyLbvZ2kbjFlznzM0nHMrOuOF1Ap47zV',
  ),
))
```

Is this related to redis sentinel?

moving packgist dependancies out of dev status

Are there any timelines to move monospice/spicy-identifiers

out of dev status?

BTW this package is really really really allot better then the other redis-sentinel offerings :-) very nice.

Access change for RedisManager::resolve

Hey Cy,

I just discovered that framework 5.4.20 has an access change for the Iluminate\Redis\RedisManager::resolve method. It goes from protected to public. This means I'm getting a fatal error when updating beyond 5.4.19. This is true for lumen as well.

Not really sure how you wanna handle this, but i suppose it could be in your dependencies.

Sorry to be the bearer of bad news. Lemme know if you need more info.

-- Lorique

Driver [redis-sentinel] is not supported.

Hey guys,

Just installing the driver and setting the .env files, and I'm getting the error Driver [redis-sentinel] is not supported. on my Laraval 5.5 instance (it seems to hit that in Illuminate/Cache/CacheManager.php)

I'm using the default vars

CACHE_DRIVER=redis-sentinel
SESSION_DRIVER=redis-sentinel
QUEUE_DRIVER=redis-sentinel
REDIS_DRIVER=redis-sentinel

REDIS_HOST=localhost
REDIS_PORT=26379
REDIS_SENTINEL_SERVICE=mymaster
REDIS_CACHE_DATABASE=1
REDIS_SESSION_DATABASE=2
REDIS_QUEUE_DATABASE=3

with localhost being where redis/redis-sentinel is installed, but it doesn't seem to see the driver. Any ideas? Did I miss something?

Laravel 9

Hi,

Laravel 9 is now out can you please update your dependencies so we can upgrade :)

Thanks!

-Rob

Driver crashes since laravel 5.8.19

Since the laravel 5.8.19 release we get an connection error when using a sentinel connection.

ConnectionException {#649 ▼ -connection: StreamConnection {#641 ▶} #message: "Connection refused [tcp://127.0.0.1:6379]" #code: 111 #file: "/data/www/default/vendor/predis/predis/src/Connection/AbstractConnection.php" #line: 155 trace: {▶} }

Any suggestions on how we could fix it?

Help needed on hybrid setup - Sentinel cluster shared on Laravel & Java App

We run a 3 server Redis Sentinel cluster which is shared between a laravel app and also a java application.

Presently right now, database 0 is used for the java web application with the remaining databases being laravel. Below are the configuration settings from our laravel env file:

	CACHE_DRIVER=redis-sentinel
	SESSION_DRIVER=redis-sentinel
	REDIS_DRIVER=redis-sentinel

	QUEUE_DRIVER=redis-sentinel
	QUEUE_CONNECTION=redis-sentinel
	HORIZON_DRIVER=redis-sentinel

	REDIS_HOST=172.3.4.1,172.3.4.2,172.3.4.3
	REDIS_PORT=26379
	REDIS_SENTINEL_SERVICE=mymaster

	REDIS_CACHE_DATABASE=1
	REDIS_SESSION_DATABASE=2
	REDIS_QUEUE_DATABASE=3

We have a few new laravel jobs which we need to delete/remove a cached key set by the java application. The redis prefix in the java application is not set, but the prefix is auto-added with the default laravel configuration for redis database/cache config files.

What would be the best way for laravel to access these "java application set keys" in Redis?

We did try creating another database config setting under redis area but it throws errors in production that it isn't defined. Extra cache attribute added:

   'javaCache' => [
        'url' => env('REDIS_URL'),
        'host' => env('REDIS_HOST', '127.0.0.1'),
        'password' => null,
        'port' => '6379',
        'database' => '0',
        'prefix'=>'',
    ]

Do we need a hybrid setup per your readme front page -- granted after reading it a couple of times, I am not sure I understand what to change though unfortunately.

Thanks for your help & feedback!

Multiple masters with multiple sentinels

Hi there,

I have 9 physically separate hosts:

  1. Sentinel1, Sentinel2 and Sentinel3
  2. Master1, Master2 and Master3
  3. Slave1, Slave2 and Slave3

Each of the sentinels is monitoring correctly each of the masters - so Sentinel1, monitors Master1, Master2 and Master3 - Sentinel2 and Sentinel3 do the same thing.

When I install the library, all works like a charm with the following config:

REDIS_SENTINEL_HOST="10.47.128.0, 10.43.0.0, 10.35.0.0"
REDIS_PASSWORD=null
REDIS_PORT=26379
REDIS_SENTINEL_SERVICE=masterone

Unfortunately that only works if the key-value pair is on the shard monitored by the "masterone" master->slave combo. If the key-value pair I'm setting/getting is located on let's say the "mastertwo" master->slave combo, I will get the dreaded "MOVED 164 xx.xx.xx.xx:6379" message.

Is there a way to also monitor multiple REDIS_SENTINEL_SERVICEs as is possible with multiple REDIS_SENTINEL_HOSTs ?

I made a fork for newer installations of Laravel since this package is dead. Link: https://github.com/devnicolas1/laravel-redis-sentinel-drivers

I'm a bit late to the party, but I've made a fork that supports Laravel 9.x and Laravel 10.x: https://github.com/devnicolas1/laravel-redis-sentinel-drivers

I've used these versions in production for almost a year now and they seem just fine.

Laravel 11.x support will come as soon as I'm totally sure its working (and it probably is, so it shouldn't take too long).

Ill try to keep the fork updated with whatever is needed.

New Relic Reporting : Monospice\LaravelRedisSentinel\Horizon\HorizonServiceBindings::getIterator() should either be compatible with IteratorAggregate::getIterator()

Hello there,

Since upgrading to PHP8.1 New Relic is alive with the below error.

I can't actually see these logs in Laravel.log or the Horizon.log - I also can't confirm that it's even real since New Relic has been unreliable since 8.1 but I'm wondering if anyone else is experiencing this issue at all ?

I am on "monospice/laravel-redis-sentinel-drivers": "^2.7" (2.x-dev) perhaps i'm just being stupid and i'm on the wrong version of the driver.

Any assistance / thoughts would be great.

Return type of Monospice\LaravelRedisSentinel\Horizon\HorizonServiceBindings::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
                in Composer\Autoload\includeFile called at /var/www/hidden/vendor/composer/ClassLoader.php (428)
                                                  /in Composer\Autoload\ClassLoader::loadClass called at ? (?)
              in is_a called at /var/www/hidden/vendor/laravel/framework/src/Illuminate/Log/LogManager.php (371)
…:createMonologDriver called at /var/www/hidden/vendor/laravel/framework/src/Illuminate/Log/LogManager.php (210)
…\LogManager::resolve called at /var/www/hidden/vendor/laravel/framework/src/Illuminate/Log/LogManager.php (125)
…\Log\LogManager::get called at /var/www/hidden/vendor/laravel/framework/src/Illuminate/Log/LogManager.php (112)
…g\LogManager::driver called at /var/www/hidden/vendor/laravel/framework/src/Illuminate/Log/LogManager.php (101)
…lled at /var/www/hidden/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php (101)
…lled at /var/www/hidden/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php (72)

Lumen 5.2 implementation

Any chance of using this package on lumen 5.2 ?

I registered the service provider in bootstrap/app.php

$app->register(Monospice\LaravelRedisSentinel\RedisSentinelServiceProvider::class);

and I am gettiing an error

Class session does not exist

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.