-
Notifications
You must be signed in to change notification settings - Fork 7
Installation: Redis
Redis is the key/value store that connects the jobs generated by the HydraDAM code with the resque workers that execute those jobs.
-
Change to the install directory by entering the command
mkdir -p /opt/install && cd /opt/install
in the terminal window. -
Download redis by entering the command
wget http://download.redis.io/redis-stable.tar.gz
. -
Untar redis by entering the command
tar xvzf redis-stable.tar.gz
. -
Change to the redis directory by entering the command
cd redis-stable/
. -
Compile redis from source by entering the command
make
.The output for Steps 1-5 should look similar to this (with the ... indicating system generated code that has been intentionally left out of these instructions):
[your_username@ip install]$ mkdir -p /opt/install && cd /opt/install
[your_username@ip install]$ wget http://download.redis.io/redis-stable.tar.gz
--2014-02-01 02:25:14-- http://download.redis.io/redis-stable.tar.gz
Resolving download.redis.io... 109.74.203.151
Connecting to download.redis.io|109.74.203.151|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1071670 (1.0M) [application/x-gzip]
Saving to: “redis-stable.tar.gz”100%[======================================>] 1,071,670 1.22M/s in 0.8s
2014-02-01 02:25:15 (1.22 MB/s) - “redis-stable.tar.gz” saved [1071670/1071670]
[your_username@ip install]$ tar xvzf redis-stable.tar.gz
redis-stable/
redis-stable/INSTALL
redis-stable/sentinel.conf
...
[your_username@ip install]$ cd redis-stable/
[your_username@ip redis-stable]$ make
cd src && make all
make[1]: Entering directory `/opt/install/redis-stable/src'
...
LINK redis-check-dump
CC redis-check-aof.o
LINK redis-check-aofHint: To run 'make test' is a good idea ;)
make[1]: Leaving directory `/opt/install/redis-stable/src'
-
Test your redis installation. Make sure you are in the redis directory and then enter the command
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 by entering the command
sudo cp src/redis-server /usr/local/bin/ sudo cp src/redis-cli /usr/local/bin/
-
Make the necessary directories by entering the command
sudo mkdir /etc/redis /var/redis /var/redis/6379
. -
Copy the init script by entering the command
Ubuntu:sudo cp utils/redis_init_script /etc/init.d/redis_6379
CentOS:sudo cp utils/redis_init_script /etc/rc.d/init.d/redis_6379
-
Copy the conf file by entering the command
sudo cp redis.conf /etc/redis/6379.conf
. -
Edit the conf file to daemonize, set the pidfile, configure logging, and set the home directory by entering the commands:
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 by entering the command
sudo service redis_6379 start
. -
(CentOS only) Add redis to chkconfig so it starts automatically on start/reboot. To do this 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 by entering the command `sudo chkconfig --add redis_6379`.
# Verification Steps
1. Enter the command `redis-cli ping`. The output should be _PONG_.
1. Enter the command `redis-cli save`. The output should be _OK_.
# Next Step
Proceed to [[Install ffmpeg|Installation:-ffmpeg]] or return to the [[Overview|Production-Installation:-Overview]] page.