0

I already installed Redis on a Centos server. I have updated the file etc/redis.conf with the following config:

unixsocket /var/run/redis/redis.sock

unixsocketperm 777

$ redis-cli ping returns "PONG" so basically Redis is working. But I still can't connect from my Magento application. Here is my config on app/etc/local.xml

<config>
<global>
    <install><date>...</date></install>
    <crypt><key>...</key></crypt>
    <cache>
        <backend>Cm_Cache_Backend_Redis</backend>
        <backend_options>
            <server>/var/run/redis/redis.sock</server>
            <port>0</port>
            <database>0</database>
            <password></password>
            <force_standalone>0</force_standalone>
            <connect_retries>1</connect_retries>
            <read_timeout>10</read_timeout>
            <automatic_cleaning_factor>0</automatic_cleaning_factor>
            <compress_data>1</compress_data>
            <compress_tags>1</compress_tags>
            <compress_threshold>20480</compress_threshold>
            <compression_lib>gzip</compression_lib>
            <persistent></persistent>
            <use_lua>0</use_lua>
        </backend_options>
    </cache>
    <disable_local_modules>false</disable_local_modules>
    <resources>...</resources>
    <session_save>db</session_save>
    <redis_session>                       
        <host>/var/run/redis/redis.sock</host>          
        <port>0</port>
        <password></password>        
        <timeout>2.5</timeout>            
        <persistent></persistent>         
        <db>0</db>                      
        <compression_threshold>2048</compression_threshold>  
        <compression_lib>gzip</compression_lib>              
        <log_level>1</log_level>               
        <break_after_frontend>5</break_after_frontend>       
        <fail_after>10</fail_after>                         
        <break_after_adminhtml>30</break_after_adminhtml>
        <first_lifetime>600</first_lifetime>                 
        <bot_first_lifetime>60</bot_first_lifetime>          
        <bot_lifetime>7200</bot_lifetime>                    
        <disable_locking>0</disable_locking>                 
        <min_lifetime>60</min_lifetime>                      
        <max_lifetime>2592000</max_lifetime>                
    </redis_session>
</global>
<admin>...</admin>

Any thoughts? Thank you.

0

Try remove below line:

<session_save>db</session_save>

In my local.xml, before adding redis code, there is already session_save tag:

<session_save><![CDATA[db]]></session_save>

IMHO, I think adding redis code created a duplicate of session tags. After removing the session_save tag going with redis code, my site was working again. This is my workaround. Maybe it just works in my case.

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.