• Resolved bradjon

    (@bradjon)


    If I attempt upgrading beyond version 2.2.4 I run into an issue where it cannot connect to Redis and I get this error:

    SELECT failed: ERR SELECT is not allowed in cluster mode

    It’s working fine on 2.2.4 and below, but I figure I shouldn’t stay at that version forever.

    Below is my Redis info in case the issue is related to something there. Thanks for any insight you can provide!

    Client: PhpRedis (v5.2.1)
    Host: redacted.h07z7u.clustercfg.use1.cache.amazonaws.com
    Port: 6379
    Database: 2
    Connection Timeout: 1s
    Read Timeout: 1s
    Retry Interval: 0ms
    Redis Version: 7.0.7

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support Julie

    (@julieadrienne)

    It looks like you’re using WP_REDIS_HOST with a real Redis Cluster.

    In that case you must use WP_REDIS_CLUSTER instead. Can you post your full configuration please?

    Thread Starter bradjon

    (@bradjon)

    Aha! That makes sense. Here’s what I have:

    define( ‘WP_REDIS_HOST’, ‘redacted.h07z7u.clustercfg.use1.cache.amazonaws.com’ );
    define( ‘WP_REDIS_PORT’, 6379 );
    define( ‘WP_REDIS_DATABASE’, 2 );
    define( ‘WP_REDIS_PREFIX’, ‘app-redacted-com’ );

    So, is it just that I change WP_REDIS_HOST to WP_REDIS_CLUSTER?

    Plugin Author Till Krüss

    (@tillkruess)

    It might take a little bit of fiddling. I see you’re using WP_REDIS_DATABASE=2 which does not work on Redis Cluster only 0 is available.

    If you really like like it, I’d say spin up a new cluster with cluster_mode disabled. AWS Elasticache offers that.

    Otherwise try this config:

    define( 'WP_REDIS_CLIENT', 'phpredis' );
    
    define( 'WP_REDIS_CLUSTER', [
        'tcp://redacted.h07z7u.clustercfg.use1.cache.amazonaws.com:6379?alias=primary1',
    ] );
    
    
    Thread Starter bradjon

    (@bradjon)

    Got it. For immediate resolution, I’ve spun up a new one with cluster_mode disabled.

    I’m curious on your take for ideal setup. Right now I have 14 WP sites which will probably grow to 20 in the next 12 months. I was setting up multiple databases per redis so that I didn’t need to spin up a separate redis server for each site.

    Is it best practice to spin up a separate one for each site? If so, any thoughts on sizing? Trying to avoid unnecessary spending.

    • This reply was modified 10 months ago by bradjon.
    Plugin Author Till Krüss

    (@tillkruess)

    You can use hundreds of sites with a single Redis instance, just skip the dumb Cluster Mode, because with it you’re limited to 1 database. With it disabled you can give each site its own database and even credentials if you like. That’s the ideal setup IMO.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Issue blocking upgrading above 2.2.4’ is closed to new replies.