Troubleshooting Redis install issues

716 views
Skip to first unread message

Geoffrey Hoffman

unread,
Jan 14, 2013, 4:19:51 PM1/14/13
to redi...@googlegroups.com
I installed redis-server with aptitude on Ubuntu server 10.04 LTS.
I realized it was really old, and so I tried aptitude remove.
Then I downloaded the source from Redis.io and compiled it like I should've done to begin with.

As far as config goes, all I did differently was change daemonize no to yes in the redis.conf file, save it, then
 
root> redis-server /root/source/redis-2.6.8/redis.conf 

*** FATAL CONFIG FILE ERROR ***
Reading the configuration file, at line 109
>>> 'stop-writes-on-bgsave-error yes'
Bad directive or wrong number of arguments

So I tried running

apt-get -o DPkg::options::=--force-confmiss --reinstall install redis-server

Now redis-server starts, but when I try to run redis-cli I get...

#> redis-cli
usage: redis-cli [-h host] [-p port] [-r repeat_times] [-n db_num] cmd arg1 arg2 arg3 ... argN
usage: echo "argN" | redis-cli [-h host] [-p port] [-r repeat_times] [-n db_num] cmd arg1 arg2 ... arg(N-1)

If a pipe from standard input is detected this data is used as last argument.

example: cat /etc/passwd | redis-cli set my_passwd
example: redis-cli get my_passwd
example: redis-cli -r 100 lpush mylist x

If you see any of the above errors, you have a super old version of Redis, or someone previously installed it via package manager. You're seeing the redis-cli output from 1.2 or some such, before it was an interactive shell.

A tip over here
said to 
sudo add-apt-repository ppa:chris-lea/redis-server
sudo apt-get update
sudo apt-get install redis-server

When I tried that, it complained that it didn't know how to add-apt-repository ! Sheesh.

So I found this
which said to 
sudo apt-get update && sudo apt-get install python-software-properties

Great, after that, I had a go at this again 
sudo apt-get install redis-server 
and it worked, but I still had only Redis 2.4.x

I ended up finding everything related to redis on the whole system, deleting it and starting over, using the four simple steps on redis.io/download. It works fine now.

Moral of the story: Package managers are awesome, except when they aren't. Just use make!

Greg Andrews

unread,
Jan 14, 2013, 4:37:10 PM1/14/13
to redi...@googlegroups.com
I realized it was really old, and so I tried aptitude remove.


I noticed that you used "apt-get" to install, but "aptitude" to remove.  I usually don't trust different package management programs to perform complementary install/remove actions, even if they're supposed to work the same as each other.  Often they won't.

The command I use to remove old Ubuntu Redis packages is:  apt-get purge redis-server

I use purge instead of remove because of the way config files are handled.  From the apt-get man page:

       remove
           remove is identical to install except that packages are removed instead of installed. Note the removing a package leaves its configuration files in system. If a plus sign is appended to the package name (with no
           intervening space), the identified package will be installed instead of removed.

       purge
           purge is identical to remove except that packages are removed and purged (any configuration files are deleted too).


  -Greg

Geoffrey Hoffman

unread,
Jan 14, 2013, 4:41:04 PM1/14/13
to redi...@googlegroups.com
I'm a hack. I basically surf around net and try anything that seems relevant which is how my server gets so messed up. I saw a comment about someone else's packages are following the latest Redis 2.6 but it was too late, and I already made the choice to purge by hand and install by hand.

I thought that apt-[command] was shorthand for aptitude [samecommand]. It's not?

Thanks for the tip anyway - I probably should purge a lot of stuff on my system and learn the right way to do things ;-)





--
You received this message because you are subscribed to the Google Groups "Redis DB" group.
To post to this group, send email to redi...@googlegroups.com.
To unsubscribe from this group, send email to redis-db+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/redis-db?hl=en.

Reply all
Reply to author
Forward
0 new messages