I am running Ubuntu server 20.04 LAMP, with Redis 5.0.7.
Problem:
When a unix socket has been configured with port 0
Redis refuses all connections.
basic /etc/redis/redis.conf
:
# create a unix domain socket to listen on
unixsocket /var/run/redis/redis.sock
# set permissions for the socket
unixsocketperm 775
bind 127.0.0.1
daemonize yes
stop-writes-on-bgsave-error no
rdbcompression yes
# maximum memory allowed for redis
maxmemory 50M
# how redis will evice old objects - least recently used
maxmemory-policy allkeys-lru
# tells redis to ignore TCP ports
port 0
#creates pidfile
pidfile /run/redis/redis-server.pid
Socket:
# ls -lh /var/run/redis
total 4.0K
-rw-rw---- 1 redis redis 5 Jul 30 18:23 redis-server.pid
srwxrwxr-x 1 redis redis 0 Jul 30 18:23 redis.sock
Listening Port:
# ps aux | grep redis
redis 4912 0.1 0.0 50192 3972 ? Ssl 18:23 0:01 /usr/bin/redis-server 127.0.0.1:0
root 6395 0.0 0.0 6432 592 pts/1 S+ 18:36 0:00 grep --color=auto redis
Connections Refused:
# redis-cli
Could not connect to Redis at 127.0.0.1:6379: Connection refused
not connected> quit
and
# redis-cli -h 127.0.0.1 -p 0
Could not connect to Redis at 127.0.0.1:0: Connection refused
Firewall completely disabled.
Any ideas?
netstat -anp|grep LISTEN
executed as root?unix 2 [ ACC ] STREAM LISTENING 85256 4912/redis-server 1 /var/run/redis/redis.sock
redis-cli -s /var/run/redis/redis.sock