[2021-04-30 06:04:16] local.ERROR: Predis\Response\ServerException: ERR 'EVAL' command keys must in same slot in /www/wwwroot/demo/vendor/predis/predis/src/Client.php:370
Stack trace:
#0 /www/wwwroot/demo/vendor/predis/predis/src/Client.php(335): Predis\Client->onErrorResponse(Object(Predis\Command\ServerEval), Object(Predis\Response\Error))
#1 /www/wwwroot/demo/vendor/predis/predis/src/Client.php(314): Predis\Client->executeCommand(Object(Predis\Command\ServerEval))
#2 /www/wwwroot/demo/vendor/laravel/framework/src/Illuminate/Redis/Connections/Connection.php(72): Predis\Client->__call('eval', Array)
#3 /www/wwwroot/demo/vendor/laravel/framework/src/Illuminate/Redis/Connections/Connection.php(84): Illuminate\Redis\Connections\Connection->command('eval', Array)
#4 /www/wwwroot/demo/vendor/laravel/framework/src/Illuminate/Queue/RedisQueue.php(193): Illuminate\Redis\Connections\Connection->__call('eval', Array)
#5 /www/wwwroot/demo/vendor/laravel/framework/src/Illuminate/Queue/RedisQueue.php(176): Illuminate\Queue\RedisQueue->migrateExpiredJobs('queues:default:...', 'queues:default')
#6 /www/wwwroot/demo/vendor/laravel/framework/src/Illuminate/Queue/RedisQueue.php(156): Illuminate\Queue\RedisQueue->migrate('queues:default')
#7 /www/wwwroot/demo/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(241): Illuminate\Queue\RedisQueue->pop('default')
#8 /www/wwwroot/demo/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(104): Illuminate\Queue\Worker->getNextJob(Object(Illuminate\Queue\RedisQueue), 'default')
#9 /www/wwwroot/demo/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(101): Illuminate\Queue\Worker->daemon('redis', 'default', Object(Illuminate\Queue\WorkerOptions))
#10 /www/wwwroot/demo/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(85): Illuminate\Queue\Console\WorkCommand->runWorker('redis', 'default')
#11 [internal function]: Illuminate\Queue\Console\WorkCommand->fire()
**
主要原因
**:
本地的redis为单机版,线上环境为集群版。redis版本冲突问题。
解决方案如下
:
为队列指名并且用{}括起来:
newdemo::dispatch($url,$data)->onqueue('{luck}');
在执行队列指令
php artisan queue:work redis --queue={luck}
还有什么问题可以下方留言,一起交流。。。