Skip to content

Instantly share code, notes, and snippets.

@wittawasw
Forked from diegopacheco/redis.md
Created August 22, 2016 22:08
Show Gist options
  • Save wittawasw/84064f0ed86d1d5f8e24c3bb3ac6dfc8 to your computer and use it in GitHub Desktop.
Save wittawasw/84064f0ed86d1d5f8e24c3bb3ac6dfc8 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-stable.tar.gz
sudo tar xzf redis-stable.tar.gz
cd redis-stable
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