-
Notifications
You must be signed in to change notification settings - Fork 7
Installation: Redis
acozine edited this page May 28, 2013
·
19 revisions
- Change to the install directory
mkdir -p /opt/install && cd /opt/install
- Download redis
wget http://download.redis.io/redis-stable.tar.gz
- Untar redis
tar xvzf redis-stable.tar.gz
- Change to the redis directory
cd redis-stable/
- Compile redis from source
make
- Test your redis installation. In the redis directory, type
make test
. You should see a lot of output, with the line "All tests passed without errors!" near the end. - To configure redis, move the server and client:
sudo cp src/redis-server /usr/local/bin/
sudo cp src/redis-cli /usr/local/bin/
- Make the necessary directories:
sudo mkdir /etc/redis /var/redis /var/redis/6379
- Copy the init script and conf file:
sudo cp utils/redis_init_script /etc/rc.d/init.d/redis_6379
sudo cp redis.conf /etc/redis/6379.conf
- Edit the conf file to daemonize, set the pidfile, configure logging, and set the home directory:
sudo sed 's/^\(daemonize\ \)no.*$/\\1yes/' -i /etc/redis/6379.conf
sudo sed 's#^\(pidfile\ /var/run/\).*$#\\1redis_6379.pid#' -i /etc/redis/6379.conf
sudo sed 's/^\(loglevel\ \)verbose.*$/\\1notice/' -i /etc/redis/6379.conf
sudo sed 's#^\(dir\ \).*$#\\1/var/redis/6379#' -i /etc/redis/6379.conf
- Start redis
sudo service redis_6379 start
- Confirm functionality and clear the decks for action:
Typeredis-cli ping
you should see PONG; typeredis-cli save
you should see OK. - (CentOS only) Add redis to chkconfig so it starts automatically on start/reboot:
- Edit /etc/rc.d/init.d/redis_6379. Immediately after the initial comments, add
```
Do not uncomment these lines.
1. Save the file
1. Add redis to chkconfig with sudo chkconfig -add redis_6379
.