Tuesday, February 23, 2016

How to fix: non-responding redis-cli

So I installed redis. It was listening, I saw that in netstat -tulpn. But when I tried to use it or connect to redis-cli it was hanging.
Strace said:

...
stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=3477, ...}) = 0
write(1, "2283:M 23 Feb 12:06:32.492 * The"..., 882283:M 23 Feb 12:06:32.492 * The server is now ready to accept connections on port 6379
) = 88
epoll_wait(3, {}, 10128, 0)             = 0
open("/proc/2283/stat", O_RDONLY)       = 6
read(6, "2283 (redis-server) R 2280 2280 "..., 4096) = 319
close(6) 


Solution: Make sure you allow local traffic in iptables if you drop the rest

iptables -A INPUT -s 127.0.0.1 -j ACCEPT

No comments:

Post a Comment