Dec 22, 2020
0
Level 1
When ElastiCache failover, it output the following error.
We are currently managing a queue using AWS ElastiCache for Redis and Laravel Horizon. When ElastiCache failover, most of the time it automatically switches to a new primary node. However, one time 3 months ago it didn't, and continuously output the following error.
Predis\Connection\ConnectionException(code: 0): Error while reading line from the server.
Predis\Response\ServerException(code: 0): READONLY You can't write against a read only replica.
ERR Error running script (call to f_230148430cb441a76f6486ae084405a674e00385): @user_script:two: @user_script: 2: -READONLY You can't write against a read only replica.
ElastiCache For Redis settings:
redis: 5.0.6
parameter group: default.redis5.0 (in-sync)
node: one primary node, one replica node
cluster mode: disabled
multi AZ : enabled
auto failover: enabled
Laravel Version:
Laravel: 7.23.2
horizon: 4.3.3
redis driver: predis(1.1.1)
config :
'redis' => [
'client' => 'predis',
'default' => [
'host' => AWS Primary Endpoint,
'port' => AWS PORT,
'database' => 0,
],
];
'connections' => [
'redis' => [
'driver' => 'redis',
'connection' => 'default',
'queue' => 'default',
'retry_after' => 5700,
],
];
horizon config:
'environments' => [
'production' => [
'supervisor-1' => [
'connection' => 'redis',
'queue' => [
'default',
],
'balance' => 'auto',
'minProcesses' => 1,
'maxProcesses' => 15,
'tries' => 3,
],
],
];
Any help would be much appreciated!
Please or to participate in this conversation.