Open leovic0101 opened 5 years ago
I'm in the same boat. I have the redis.lua file overwritten in my repo, but it would be great if I didn't have to do that.
me too
Hi @leovic0101: I can not redis after overwrite redis.lua with the latest file,it failed.Can you help me? redis failed to authenticate: timeout
@zffocussss not sure what your configuration is but if you are running in SSL you will need to add the options parameter. In my case, I set it up something like this:
local resty_redis = require "resty.redis"
local redis = resty_redis:new()
-- Syntax: redis:set_timeouts(connect_timeout, send_timeout, read_timeout)
redis:set_timeouts(5000, 5000, 5000) -- 5 sec
local ok, err = redis:connect("**<<Redis IP>>**", **<<Redis SSL Port>>**, {
ssl = true,
ssl_verify = true,
pool_size = 100,
backlog = 300
})
if not ok then
ngx.say("Failed to connect: ", err)
return ngx.exit(500)
end
local response, err = redis:auth('**<<Redis AUTH password>>**')
if not response then
ngx.say("Failed to authenticate: ", err)
return ngx.exit(500)
end
@leovic0101 what if I do not set pool_size and backlog?
it failed redis failed to authenticate: timeout
lua tcp socket read timed out redis failed to authenticate: timeout
version: nginx version: openresty/1.13.6.2
overwrite the redis.lua
how do you overwrite the redis.lua?
@zffocussss edit the file located here /usr/local/openresty/lualib/resty/redis.lua
(on Ubuntu at least).
Would be amazing to get a new version of this out so that it can work easily with SSL enforced situations! Let me know if there is anything I can do to help.
thanks @jloh
Also make sure that the updated redis.lua has the proper permission. Run command below:
chmod +r /usr/local/openresty/lualib/resty/redis.lua
Sorry for the late response.
This is really more of a question than an issue.
We need to use the latest update with SSL support. It works and thank you for releasing it. However, the only way I know right now to update the module is to overwrite the redis.lua.
I tried using yum to update openresty as well as using luarocks but neither works.
I am noob but would like to know what is your recommendation to update to the latest version?
Thank you and most appreciate it.