• Resolved swiftc

    (@swiftc)


    Hello,

    Sorry for such n00b question..

    I have 3 web node each with Redis running (as master on each).

    I have Redis as PHP Session handler in php.ini on each like so:

    session.save_handler = redis
    session.save_path = “tcp://1.1.1.1:6379?auth=pass?database=10,tcp://2.2.2.2:6379?auth=pass?database=10,tcp://3.3.3.3:6379?auth=pass?database=10”

    how do I then get WordPress to use all 3?

    Currently I have in wp-config.php

    define(‘WP_REDIS_HOST’, ‘1.1.1.1’);
    define(‘WP_REDIS_PORT’, ‘6379’);
    define(‘WP_REDIS_DATABASE’, ‘1’);
    define(‘WP_REDIS_PASSWORD’, ‘pass’);
    define(‘WP_CACHE_KEY_SALT’, ‘example.com’);

    would I use Master-Slave or Clustering from https://wordpress.org/plugins/redis-cache/other_notes/#Replication-&-Clustering

    Maybe:

    define( ‘WP_REDIS_CLUSTER’, [
    ‘tcp://1.1.1.1:6379?database=15&alias=node-01’,
    ‘tcp://2.2.2.2:6379?database=15&alias=node-02’,
    ‘tcp://3.3.3.3:6379?database=15&alias=node-02’,
    ] );
    define(‘WP_REDIS_PASSWORD’, ‘pass’);
    define(‘WP_CACHE_KEY_SALT’, ‘example.com’);

    Thanks for any help.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Till Krüss

    (@tillkruess)

    That looks correct, yes.

    define( 'WP_REDIS_CLUSTER', [
        'tcp://1.1.1.1:6379?database=10&alias=node-01',
        'tcp://2.2.2.2:6379?database=10&alias=node-02',
        'tcp://3.3.3.3:6379?database=10&alias=node-02',
    ] );

    You might get an authentication error if you Redis servers require a password. If that’s the case, please let me know and I fix authentication for replication and clustering.

    Thread Starter swiftc

    (@swiftc)

    Thanks, actually had to disable requirepass as the PHP sessions cannot seem to use it. Maybe works in new Redis but not via old one in YUM. Have a good day!

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

The topic ‘Replication & Clustering Question’ is closed to new replies.