OroCommerce Forums

Covering OroCommerce topics, including community updates and company announcements.

Forums Forums OroCommerce Setting up Redis Sentinel

This topic contains 3 replies, has 2 voices, and was last updated by Andrey Yatsenko Andrey Yatsenko 6 months ago.

The forum will run in the read-only mode starting from March 1. Please head to StackOverflow for support.

  • Creator
    Topic
  • #39979

    marius.negoescu
    Participant

    Hi, guys

    We have redis server and redis sentinel installed on the server and we have 2 websites which are using orocommerce.

    This is the default setup for parameters.yml:

    session_handler: ‘snc_redis.session.handler’
    redis_dsn_session: [‘redis://127.0.0.1:26379/0′,’redis://127.0.0.1:26379/0’]
    redis_dsn_cache: [‘redis://127.0.0.1:26379/1′,’redis://127.0.0.1:26379/1’]
    redis_dsn_doctrine: [‘redis://127.0.0.1:26379/2′,’redis://127.0.0.1:26379/2’]
    redis_setup: ‘sentinel’
    redis_sentinel_master_name: ‘mymaster’
    redis_sentinel_prefer_slave: ‘127.0.0.1’

    If we want to use redis sentinel on both websites, what should be the setup on the 2nd site ?

    Cheers, Marius

Viewing 3 replies - 1 through 3 (of 3 total)
  • Author
    Replies
  • #39980
    Andrey Yatsenko
    Andrey Yatsenko
    Moderator

    In the simplest setup, the second website can just use different databases, also you should note that it’s highly not recommended to store sessions in the same Redis server as the cache stored, because when the cache storage will be full it will start removing sessions and users will be logged out. Instead, you should use a different server for sessions that should be configured to never remove old records, unlike the cache server. If it is not possible to have multiple Redis servers, just use another storage for sessions, like database or filesystem.

    #39988

    marius.negoescu
    Participant

    For the second website I have used:

    session_handler: ‘snc_redis.session.handler’
    redis_dsn_session: [‘redis://127.0.0.1:26379/3′,’redis://127.0.0.1:26379/3’]
    redis_dsn_cache: [‘redis://127.0.0.1:26379/4′,’redis://127.0.0.1:26379/4’]
    redis_dsn_doctrine: [‘redis://127.0.0.1:26379/5′,’redis://127.0.0.1:26379/5’]
    redis_setup: ‘sentinel’
    redis_sentinel_master_name: ‘mymaster’
    redis_sentinel_prefer_slave: ‘127.0.0.1’

    I am guessing this is wrong, right ?

    Cheers, Marius

    #39995
    Andrey Yatsenko
    Andrey Yatsenko
    Moderator

    I just consulted with an OroCloud team and they are saying that an application currently is compatible with sentinel, but the performance will not be optimal. We are working on the performance fix and it will be released in a month or two.
    Stay tuned, it will be mentioned at release notes.

    According to the configuration, redis_dsn_session should be linked to the separate Redis server on a different port, otherwise, users will be logged out as soon as Redis will reach the memory limit, so it’s incorrect unless you have too much memory allocated to Redis.

    There is a mistake at the documentation, https://github.com/oroinc/redis-config#configuration-for-sentinel-redis-setup for sessions 26380 port should be used or another one that you will configure. I will fix that.

Viewing 3 replies - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

You will be redirected to [title]. Would you like to continue?

Yes No