sudo apt-get update
sudo apt-get install -y build-essential tcl8.5
cd /tmp
wget http://download.redis.io/releases/redis-stable.tar.gz
unrar
tar xzf redis-stable.tar.gz
cd redis-stable
make
make test
sudo make install
cd utils
sudo ./install_server.sh # Choose a port
#=>
Port : 6379
Config file : /etc/redis/6379.conf
Log file : /var/log/redis_6379.log
Data dir : /var/lib/redis/6379
Executable : /usr/local/bin/redis-server
Cli Executable : /usr/local/bin/redis-cli
sudo service redis_6379 stop
sudo service redis_6379 start
redis-cli -p 6379
> ping
Since this redis is local, access it via
redis://localhost:6379/
Or just set in redis.yml
staging:
redis: redis://localhost:6379/
production:
redis: redis://localhost:6379/
For persistent queue, like for Sidekiq
sudo nano /etc/redis/6379.conf
# use Ctrl+W to search in nano
supervised systemd
maxclients 1000
databases 1
# maxmemory <bytes>
maxmemory-policy noeviction
For a LRU-expiring cache
sudo nano /etc/redis/6380.conf
# use Ctrl+W to search in nano
supervised systemd
maxclients 1000
databases 1
maxmemory 500mb
maxmemory-policy noeviction