rhubarbgroup / .github

Community Health Files
https://github.com/rhubarbgroup/
0 stars 0 forks source link

PHPMessage: RedisException: MOVED #24

Closed vvsaichaitanya closed 1 year ago

vvsaichaitanya commented 1 year ago

I have an AWS elasticahce redis cluster with 1 shard containing 1 primary & 1 replica I use the configuration endpoint as the redis_host.

define( 'WP_REDIS_PASSWORD', 'password' ); define( 'WP_REDIS_SCHEME', 'tls' ); define( 'WP_REDIS_CLIENT', 'phpredis' ); define( 'WP_REDIS_HOST', 'wmkt-stg-redis-0001-001.wmkt-stg-redis.du3ngv.use1.cache.amazonaws.com'); define( 'WP_REDIS_PORT', 6379);

I get PHP message: RedisException: MOVED 16313 error with this & the plugin toggles between error state & connected state.

If i try to use the endpoint given in the MOVED error above, the redis settings page throws 504 define( 'WP_REDIS_CLUSTER', ['tcp://abc-dev-redis-0001-001.wmkt-stg-redis.acd.use1.cache.amazonaws.com:6379']);

Any pointers on what the right config is would be helpful

tillkruss commented 1 year ago

You need to use the cluster configuration, not WP_REDIS_HOST.

vvsaichaitanya commented 1 year ago

@tillkruss could you please give me an example of the cluster configuration?

define( 'WP_REDIS_CLUSTER', ['tcp://abc-dev-redis-0001-001.wmkt-stg-redis.acd.use1.cache.amazonaws.com:6379']);

above is not working either

vvsaichaitanya commented 1 year ago

@tillkruss AWS only gives a cluster configuration endpoint but it would never tell us what is a primary node.

what do I add into WP_REDIS_CLUSTER array? what if the primary changes?

tillkruss commented 1 year ago

Disable cluster mode on AWS, or use the correct endpoint. It works tons of people are using Elasticache.

If you need 1:1 support, we offer that over at Object Cache Pro.