colinmollenhour / Cm_Cache_Backend_Redis

A Zend_Cache backend for Redis with full support for tags (works great with Magento)
Other
390 stars 142 forks source link

Unable to use redis cluster + sentinel with Magento 2.3.5 #161

Open henry1303 opened 3 years ago

henry1303 commented 3 years ago

Hi,

We are trying to configure Magento 2.3.5 to use Redis cluster + sentinel, but we are getting an error when running bin/magento c:c (for example) :

ERR unknown command select, with args beginning with: 2

Here you have the configuration in our env.php file :

    'session' => [
    'save' => 'redis',
    'redis' => [
        'host' => 'redis-sentinel',
        'port' => '16379',
        'password' => '',
        'timeout' => '2.5',
        'persistent_identifier' => '',
        'database' => '0',
        'compression_threshold' => '2048',
        'compression_library' => 'gzip',
        'log_level' => '3',
        'max_concurrency' => '6',
        'break_after_frontend' => '5',
        'break_after_adminhtml' => '30',
        'first_lifetime' => '600',
        'bot_first_lifetime' => '60',
        'bot_lifetime' => '7200',
        'disable_locking' => '0',
        'min_lifetime' => '60',
        'max_lifetime' => '2592000',
        'sentinel_master' => 'master-node',
        'sentinel' => 'redis-sentinel:16379',
        'sentinel_connect_retries' => '5',
        'sentinel_verify_master' => '0',
        'load_from_slave' => '2',
        'retry_reads_on_master' => '1'
    ]
],
'cache' => [
    'frontend' => [
        'default' => [
            'id_prefix' => '40d_',
            'backend' => 'Cm_Cache_Backend_Redis',
            'backend_options' => [
                'server' => 'redis-sentinel',
                'database' => '1',
                'port' => '16379',
                'password' => '',
                'load_from_slave' => '2',
                'retry_reads_on_master' => '1'
            ]
        ],
        'page_cache' => [
            'id_prefix' => '40d_',
            'backend' => 'Cm_Cache_Backend_Redis',
            'backend_options' => [
                'server' => 'redis-sentinel',
                'database' => '2',
                'port' => '16379',
                'password' => '',
                'load_from_slave' => '2',
                'retry_reads_on_master' => '1'
            ]
        ]
    ]
]

Any idea what's wrong ?

Best regards, Pierre

jonathanribas commented 2 years ago

Hi @henry1303, we have same issue here with Adobe Commerce 2.3.7. Have you managed to fix it?

jg-development commented 2 years ago

+1 ... any ideas?

Xon commented 2 years ago

Remove the database option, redis cluster doesn't support multiple databases.