0

I am trying to run Magento2 with a Redis Cluster (running redis-sentinel) as cache and session backend.

I am not sure about how I should do this ? Is it even possible ?

As I see from Collin Mollenhour repository, it seems possible :

https://github.com/colinmollenhour/Cm_Cache_Backend_Redis#redis-sentinel

However, this part was written for Magento1.

But, since the library is the same in Magento2, maybe I can achieve ?

Here is my app/etc/env.php file :

'cache' => 
  array (
    'frontend' => 
    array (
      'default' => 
      array (
        'backend' => 'Cm_Cache_Backend_Redis',
        'backend_options' => 
        array (
          'server' => 'magento2-redis-sentinel', // A load-balanced host where my sentinel service resides.
          'sentinel_master' => 'mymaster',
          'sentinel_master_verify' => '1',
          'port' => '26379',
          'database' => '1',
          'compress_data' => 0,
        ),
      ),
      'page_cache' => 
      array (
        'backend' => 'Cm_Cache_Backend_Redis',
        'backend_options' => 
        array (
          'server' => 'magento2-redis-sentinel',
          'sentinel_master' => 'mymaster',
          'sentinel_master_verify' => '1',
          'port' => '26379',
          'database' => '2',
          'compress_data' => 0,
        ),
      ),
    ),
  ),

However, this does not work, here is what Magento says :

Unable to connect to a redis sentinel: Unknown sentinel subcommand 'setClientTimeout'

But, connecting directly via netcat is OK :

nc magento2-redis-sentinel 26379 (and then issue commands like "info" are properly showing redis-sentinel state).

Does anyone already achieve to get such setup to work?

0

From what I read in the colinmollenhour repository, I am missing this line : https://github.com/colinmollenhour/credis/blob/master/Sentinel.php#L88

This is not included in the version of colinmollenhour/credis used in Magento 2.

Will give a try to leverage the composer requirements and see if it's running better.

  • This is impossible to leverage the requirements of credis library to the latest 1.8 version. The usage of explicit 1.6 is hardcoded in Magento's composer.json files. I will submit an issue on the Magento2's github. – Rorua Sep 19 '17 at 13:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.