Magento 2 install redis in debian

  1. sudo apt-get update && sudo apt-get upgrade
    
  2. Install the software-properties-common package:
    1
    sudo apt-get install software-properties-common
    
    

    3.

    sudo add-apt-repository ppa:chris-lea/redis-server
    
    4.
    sudo apt-get update
    sudo apt-get install redis-server
    
    5.

    Verify the Installation

    Verify Redis is up by running redis-cli:

    redis-cli
    
    6.
    Magento configuration for redis

    configure Magento to use Redis for page caching

    Following is a sample configuration to add to <your Magento install dir>app/etc/env.php:

    'cache' =>
    array(
       'frontend' =>
       array(
          'default' =>
          array(
             'backend' => 'Cm_Cache_Backend_Redis',
             'backend_options' =>
             array(
                'server' => '127.0.0.1',
                'port' => '6379'
                ),
        ),
        'page_cache' =>
        array(
          'backend' => 'Cm_Cache_Backend_Redis',
          'backend_options' =>
           array(
             'server' => '127.0.0.1',
             'port' => '6379',
             'database' => '1',
             'compress_data' => '0'
           )
        )
      )
    ),
    
    
    

    Configure Magento to use Redis for session storage

    Following is a sample configuration to add to <your Magento install dir>app/etc/env.php:

    'session' => 
       array (
       'save' => 'redis',
       'redis' => 
          array (
    	'host' => '127.0.0.1',
    	'port' => '6379',
    	'password' => '',
    	'timeout' => '2.5',
    	'persistent_identifier' => '',
    	'database' => '0',
    	'compression_threshold' => '2048',
    	'compression_library' => 'gzip',
    	'log_level' => '1',
    	'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'
        )
    ),
    
    7.

    check monitor redis 

    redis-cli monitor

    8.start resdis

    redis-server

Leave a Comment