user824624
user824624

Reputation: 8080

Redis can't start due to tcp-backlog

I am using the osx and trying to install redis through brew

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

At last I have installed redis, but when I run it in the way of

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

there is error message,

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

I learned from Redis tcp-backlog to uncomment the redis.conf in that line. but still more errors on other lines come again. How do I solve it ?

Upvotes: 4

Views: 2919

Answers (2)

asmaier
asmaier

Reputation: 11746

Check if you have installed redis twice. I my case I had another redis installation from anaconda with version 2.6.9:

$ 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 instead will install the redis-server to a different place:

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

So to start the homebrew version with the homebrew config file do

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

Upvotes: 15

Sbbs
Sbbs

Reputation: 1670

I had similar problem due to a config file left over from previous redis versions. Uninstalling all redis versions and reinstalling the latest worked (also, don't forget to update brew before installing redis):

brew uninstall redis --force
brew update
brew install redis

You should now be able to start it.

Upvotes: 0

Related Questions