You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2022/03/09 16:48:05 UTC

[GitHub] [apisix] tzssangglass edited a comment on issue #6530: bug: limit-count plugin does not work when I use redis cluster

tzssangglass edited a comment on issue #6530:
URL: https://github.com/apache/apisix/issues/6530#issuecomment-1063131634


   Unfortunately I don't have that many VMs to build such a cluster, I tried to deploy it with docker-compose, but it didn't reproduce the environment I wanted.
   
   I've determined that it has something to do with lua-resty-redis-cluster caching redis nodes node information. The nodes ip you configured is overwritten by the redis cluster nodes information.
   
   You can assist me in doing a test like this in your environment:
   
   find here: https://github.com/steve0511/resty-redis-cluster/blob/2d562d83db6fa0b3a59164bdc8868367f383d0a4/lib/resty/rediscluster.lua#L206-L211
   
   ```lua
       -- if a cached serv_list is present, use it
       if serv_list_cached then
           serv_list_combined = serv_list_cached.serv_list
       else
           serv_list_combined = serv_list
       end
   ```
   
   and change this as
   
   ```lua
       -- if a cached serv_list is present, use it
       --if serv_list_cached then
       --    serv_list_combined = serv_list_cached.serv_list
       --else
       --    serv_list_combined = serv_list
       --end
   
   
       serv_list_combined = serv_list
   ```
   
   hack `lua-resty-redis-cluster` does not use the nodes cache from redis cluster, only the nodes you configured.
   
   let's see what happens.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org