43

I'm using Redis version 2.2.13

jack@ubuntu:~/redis$ src/redis-server
[23900] 14 Sep 14:28:52 # Warning: no config file specified, using the default config. In order to specify a config file use 'redis-server /path/to/redis.conf'
[23900] 14 Sep 14:28:52 # Opening port: bind: Address already in use

So I follow the above instructions and try

redis-server $HOME/redis/redis.conf

Which gives me the following error:

*** FATAL CONFIG FILE ERROR ***
Reading the configuration file, at line 135
>>> 'slave-serve-stale-data yes'
Bad directive or wrong number of arguments

The file has the following comments:

# When a slave lost the connection with the master, or when the replication
# is still in progress, the slave can act in two different ways:
#
# 1) if slave-serve-stale-data is set to 'yes' (the default) the slave will
#    still reply to client requests, possibly with out of data data, or the
#    data set may just be empty if this is the first synchronization.
#
# 2) if slave-serve-stale data is set to 'no' the slave will reply with
#    an error "SYNC with master in progress" to all the kind of commands
#    but to INFO and SLAVEOF.

How can I resolve this issue?

1
  • version 2.2.13, I think i've solved the problem now! I used the following, to make sure I was running the correct file: $HOME/redis/src/redis-server $HOME/redis/redis.conf
    – Jack
    Sep 14, 2011 at 13:44

5 Answers 5

107

I had this same problem, but I forgot that redis persists. If you get this error, try this command:

redis-cli ping

if you get PONG as a response, then Redis is running, and the port is in use, by Redis.

60

And after running redis-cli ping and getting a positive response, simply run redis-cli shutdown

1
  • Its giving me error - (error) ERR Errors trying to SHUTDOWN. Check logs.
    – Jatin Seth
    Mar 24, 2016 at 6:24
13

Try searching for redis folder on your machine, in my case, I had redis-server running in another application. Switch to that directory and run:

redis-cli ping

If it returns PONG, run:

redis-cli shutdown

This should shut down the redis, and now go to your project and try running:

redis-server
10

There must be another version of redis server installed on my machine, I ran it using the following command:

$HOME/redis/src/redis-server $HOME/redis/redis.conf

Everything seems to be working.

1
  • 1
    /root/redis/src/redis-server: No such file or directory
    – vishal
    Mar 26, 2015 at 6:17
2

try use another port and set it daemonize ./redis-server --port 6379 --daemonize yes

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.