Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Questions on batch-redis plugin setup with redis cluster #15

Open
chaitanya14 opened this issue Dec 11, 2022 · 2 comments
Open

Questions on batch-redis plugin setup with redis cluster #15

chaitanya14 opened this issue Dec 11, 2022 · 2 comments

Comments

@chaitanya14
Copy link

Hi Team,

Firstly, Thanks for the plugin. Can you please help me in answering below questions ?

  1. Doesn't this plugin work with password authenticated redis-cluster ? As i am getting below errors related to auth failure.

2022/12/09 22:43:54 [error] 2090#0: *8567 [lua] rediscluster.lua:238: fetch_slots(): failed to fetch slots: NOAUTH Authentication required.;NOAUTH Authentication required., context: ngx.timer, client: 10.240.1.209, server: 0.0.0.0:8443
2022/12/09 22:43:54 [error] 2090#0: *8567 [kong] connection.lua:96 failed to connect to Redis: nil, context: ngx.timer, client: 10.240.1.209, server: 0.0.0.0:8443

  1. How to verify if this plugin is actually using redis-cluster instead of local cache ?

Plugin Config:
{"name":"scalable-rate-limiter","config":{"redis_keepalive_timeout":60000,"redis_pool_size":4,"second":null,"redis_send_timeout":100,"hour":null,"redis_max_redirection":2,"redis_max_connection_attempts":2,"redis_backlog":1,"policy":"batch-redis","redis_port":6379,"redis_host":"redis-cluster-0.redis-cluster-headless.redis-cluster.svc.cluster.local","day":null,"batch_size":2,"limit_by":"service","redis_connect_timeout":200,"minute":5,"redis_read_timeout":100,"error_message":"API rate limit exceeded","header_name":null},"created_at":1670625790,"service":null,"route":{"id":"0abbce6b-f987-494b-96bb-38f9ae43dde2"},"protocols":["grpc","grpcs","http","https"],"consumer":null,"id":"ed409aa0-27b1-42b1-8359-9e59ac4c44ac","tags":null,"enabled":true}

Kong Version: 2.8.1

@chirag-manwani
Copy link
Collaborator

Hi @chaitanya14 ,

  1. You are right, the plugin does not support authentication with Redis yet. But on a closer look, it looks like the client we use does provide support for the same.
  2. To verify you can check for the keys in Redis cache and its value. Also if you have multiple nodes, your actual rate limit would be limit * number of nodes, since the policy is local so the counter is not shared.

I see that you have already raised a PR for 1. I'll verify the change once and let you know.

@jeremyjpj0916
Copy link

I also added an enhancement that should allow us to resolve hostnames if IP is not specified similar to how Kong deals in DNS:
#17

cc @chaitanya14 @chirag-manwani

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants