lua-resty-redis
lua-resty-redis copied to clipboard
Trouble connecting to host by aliased hostname
I've been running into trouble trying to open a connection from one docker container to another. I've set up redis to run from the base docker alpine image with minimal configuration. I've also set up an nginx server to make some calls out to the redis container. I've found that I can open and establish a connection using redis-lua and calling redis.connect("
connection refused, client: 192.168.21.252, server: I'm unsure if this is a DNS issue, as it appears that there is no server. But I would expect if this was the case, then the redis-lua library and the redis-cli would not work as well. Any idea what is going on here?
@bk10287 Enable the nginx debugging logs and see what's happening under the hood.
They are enabled. All I'm seeing is that the connection is refused:
2017/03/27 18:33:13 [error] 12#12: *1 connect() failed (111: Connection refused), client: 172.17.0.1, server: , request: "GET /v1/account/apiKeys HTTP/1.1", host: "localhost:9000" 2017/03/27 18:33:13 [error] 12#12: *1 [lua] locker.lua:29: HttpRequest(): failed to open cache connection: connection refused, client: 172.17.0.1, server: , request: "GET /v1/account/apiKeys HTTP/1.1", host: "localhost:9000"
Furthermore, I've tried this solution, which involves setting the local resolver via script before starting nginx, but still am having no luck.
I'm having this exact issue - did you ever resolve @bk10287 ?
@bk10287 You are not enabling debugging logs. Once enabled, you should see a ton of [debug] level log messages.
@ecaroth The suggestion goes to you as well. This way, you can see exactly what IP address and port number are used to connect.