Skip to content

Instantly share code, notes, and snippets.

@diegopacheco
Last active August 3, 2019 18:29
Show Gist options
  • Save diegopacheco/73130ba7515383717751 to your computer and use it in GitHub Desktop.
Save diegopacheco/73130ba7515383717751 to your computer and use it in GitHub Desktop.
How to Install Redis 3 Amazon Linux OS / CentOS

Install Redis cluster on Amazon Linux OS

sudo yum -y upgrade
sudo yum install -y gcc*
sudo yum install -y tcl
sudo wget http://download.redis.io/releases/redis-3.0.4.tar.gz
sudo tar xzf redis-3.0.4.tar.gz
cd redis-3.0.4
cd deps ; sudo make hiredis jemalloc linenoise lua ; cd ..
sudo make
sudo make test
sudo make install
cd utils ; sudo chmod +x install_server.sh ; sudo ./install_server.sh

It will ask you for the Redis Executable - it should be: /usr/local/bin/redis-server Them you can check for redis service

sudo service redis_6379 status

To play with the cluster we will need add ruby redis gem

sudo gem install redis

Them you can do

cd create-cluster
sudo ./create-cluster start
sudo ./create-cluster create
redis-cli -c -p 30001
set foo bar
CTRL + D
redis-cli -c -p 30002
get foo
CTRL + D
redis-cli -c -p 30003
get foo
CTRL + D
redis-cli -p 30001 cluster nodes
sudo ./create-cluster stop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment