由于tcp-backlog,Redis无法启动

时间:2015-02-08 19:45:36

标签: macos redis

我正在使用osx并尝试通过brew

安装redis
brew install redis
==> Downloading http://download.redis.io/releases/redis-2.8.17.tar.gz
Already downloaded: /Library/Caches/Homebrew/redis-2.8.17.tar.gz
==> make -C /private/tmp/redis-WEL8AT/redis-2.8.17/src CC=clang
==> Caveats
To have launchd start redis at login:
    ln -sfv /usr/local/opt/redis/*.plist ~/Library/LaunchAgents
Then to load redis now:
    launchctl load ~/Library/LaunchAgents/homebrew.mxcl.redis.plist
Or, if you don't want/need launchctl, you can just run:
    redis-server /usr/local/etc/redis.conf
==> Summary

最后我安装了redis,但是当我以

的方式运行它时
redis-server /usr/local/etc/redis.conf

有错误消息,

*** FATAL CONFIG FILE ERROR ***
Reading the configuration file, at line 54
>>> 'tcp-backlog 511'
Bad directive or wrong number of arguments

我从Redis tcp-backlog学习取消注释该行中的redis.conf。 但是其他线路上的更多错误再次出现。 我该如何解决?

2 个答案:

答案 0 :(得分:15)

检查您是否安装了两次redis。我的情况下我从anaconda安装了另一个版本为2.6.9的redis:

$ which redis-server
/Users/<username>/anaconda/bin/redis-server
$ redis-server -v
Redis server v=2.6.9 sha=00000000:0 malloc=libc bits=64

Homebrew会将redis-server安装到其他地方:

$ /usr/local/bin/redis-server -v
Redis server v=3.0.1 sha=00000000:0 malloc=libc bits=64 build=bf58331b4c8133f5

所以用自制软件配置文件启动自制程序版本

$ /usr/local/bin/redis-server /usr/local/etc/redis.conf

答案 1 :(得分:0)

由于以前的redis版本遗留了配置文件,我遇到了类似的问题。卸载所有redis版本并重新安装最新版本(同样,不要忘记在安装redis之前更新brew):

brew uninstall redis --force
brew update
brew install redis

你现在应该可以启动它了。