Could I change redis to unix socket?


Does anyone know how to change redis from tcp/ip to unix socket?

Thanks very much

Instead of:

connectPort = PortNumber 6379

you would have:

connectPort = UnixSocket “/tmp/redis.sock”

Of course, /tmp/redis.sock should be declared in the server-side Redis configuration file using the following parameters:

unixsocket /tmp/redis.sock unixsocketperm 755

Please note by default, unix domain socket parameters are commented out.

In upstream.conf

I change to pstream redis { server unix:/run/redis/redis.sock; #server; keepalive 10; }

And it’s not working