0

redisAsyncConnectUnix() returns a redisAsyncContext(not NULL) that has err=1 i.e REDIS_ERR_IO with errstr "No such file or directory" , what file/directory are they looking for ?

Redis is up and running, was able to SET from redis-cli

melwin_jose
  • 315
  • 3
  • 20

1 Answers1

2

redisAsyncConnectUnix is used to connect to the server using a Unix Domain Socket, which is materialized by a pseudo-file. The path of this file has to be provided as a parameter:

redisAsyncContext *redisAsyncConnectUnix(const char *path);

For instance, you could use:

path = /tmp/redis.socket

However, you need to check that the server (which has to run on the same machine than the client), is listening to the same path. Check the definition of the following parameters in the Redis configuration file:

unixsocket /tmp/redis.socket
unixsocketperm 755

Make sure the path is valid, and access rights are correct. You can check that the configuration is ok on server-side by running:

redis-cli -s /tmp/redis.socket
Didier Spezia
  • 70,911
  • 12
  • 189
  • 154
  • thanx for the help,i was trying to connect to the master in the above, anyway that got fixed. Now the problem is while connecting to slave, says "Bad file descriptor", with slave unix socket as "/tmp/redis.socket" – melwin_jose Feb 20 '15 at 09:16
  • 1
    Is your slave running on the same machine? In that case, you must ensure that master and slaves use different configuration files, different directories to store their data, and of course, different port numbers, and different paths for the unix socket name. – Didier Spezia Feb 20 '15 at 12:32