42

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?

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
Jack
  • 15,614
  • 19
  • 67
  • 92
  • 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 '11 at 13:44

5 Answers5

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.

Anthony Roberts
  • 1,971
  • 1
  • 19
  • 34
60

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

dtt101
  • 2,151
  • 25
  • 21
12

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
Tanmay Jain
  • 311
  • 3
  • 8
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.

Jack
  • 15,614
  • 19
  • 67
  • 92
2

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