• Resolved marcqdigital

    (@marcqdigital)


    I’ve been using AWS Elasticache with Redis OSS caches for a while and just tried to set up a new Elasticache instance using Valkey instead which AWS advertises as a drop-in replacement of Redis OSS.

    I swapped the environment variable for WP_REDIS_HOST and started with WP_REDIS_DISABLED set to true to prevent site downtime if Valkey just didn’t work. After that update, the plugin settings page stated that Redis is Reachable. I enabled the object cache with the environment variable again and shortly after, got this error:
    Error establishing a Redis connection
    CROSSSLOT Keys in request don't hash to the same slot

    Is there a setting I need to change for this to work?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter marcqdigital

    (@marcqdigital)

    My Valkey instance is set to serverless. What’s funny is that on 2/3 sites I got this error, but things are working fine with a Valkey serverless instance on one of the sites that I tried this on. On that site I was able to flush the cache (via the plugin) right before the enivronment update, so maybe that’s why? But I did use the wp cache flush command on the other two sites after the error message showed up and that didn’t help.

    Thread Starter marcqdigital

    (@marcqdigital)

    Ah, the site where redis is working on Valkey has PhpRedis installed instead of just using Predis. I will try setting that up on the remaining sites.

    Plugin Author Till Krüss

    (@tillkruess)

    If you’re using cluster_mode in AWS then you can’t use WP_REDIS_HOST, you must use the cluster connection parameters (see README).

    Thread Starter marcqdigital

    (@marcqdigital)

    For anyone else curious, you do need PhpRedis installed on the server to use any type of Valkey Elasticache instance, but once you have PhpRedis in place you can set up an Elasticache instance with either serverless or customize the cluster settings to turn cluster off and set up a read-replica instead. Then either of these types of instances on Valkey will work set as WP_REDIS_HOST without any complicated cluster mode settings.

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

You must be logged in to reply to this topic.