2011-09-14 25 views
30

我使用Redis的版本2.2.13Redis的服務器端口已在使用

[email protected]:~/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 

所以我按照上面的說明,並嘗試

redis-server $HOME/redis/redis.conf 

使我有以下錯誤:

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

該文件具有以下意見:

# 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. 

解決

+0

? – seppo0010

+0

版本2.2.13,我想我現在已經解決了這個問題! 我使用以下命令來確保我運行的是正確的文件: $ HOME/redis/src/redis-server $ HOME/redis/redis.conf – Jack

回答

82

我有同樣的問題,但我忘記了redis持續存在。如果您收到此錯誤,請嘗試以下命令:

redis-cli ping 

,如果你得到PONG作爲響應,然後Redis的運行,且端口在使用中,通過Redis的。

9

必須有安裝在我的機器上的Redis服務器的另一個版本,我跑它使用下面的命令:

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

一切似乎是工作。

+0

/root/redis/src/redis-server:沒有這樣的文件或目錄 – vishal

47

和運行redis-cli ping並得到了積極的響應後,只需運行redis-cli shutdown

+0

它給我錯誤 - (錯誤)ERR錯誤嘗試關閉。檢查日誌。 –

0

嘗試使用其他端口,並設置守護進程您正在使用什麼版本 ./redis-server --port 6379 --daemonize yes

相關問題