Last active
August 29, 2015 14:16
-
-
Save filipelenfers/5a6f4af5592208941b76 to your computer and use it in GitHub Desktop.
Install redis on Centos 6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Download and unzip | |
wget http://download.redis.io/releases/redis-2.8.19.tar.gz | |
tar xzvf redis-2.8.19.tar.gz | |
#Deps to compile and test | |
sudo yum install gcc tcl | |
#Compile | |
cd redis-2.8.19 | |
cd deps | |
make hiredis jemalloc linenoise lua | |
cd .. | |
make | |
make test #just to be sure :) | |
#Install | |
sudo make install | |
sudo mkdir /etc/redis | |
sudo cp redis.conf /etc/redis | |
sudo cp sentinel.conf /etc/redis | |
#configure the machine | |
sudo vim /etc/sysctl.conf #put this line somewhere: vm.overcommit_memory=1 | |
sudo sysctl vm.overcommit_memory=1 | |
sudo sysctl -w fs.file-max=100000 | |
sudo sysctl -w net.core.somaxconn=1024 | |
#Service | |
#Download this script as redis-server in your /etc/ini.d/, https://gist.github.com/tahajahangir/155176867afed0ff80ad | |
wget https://gist.githubusercontent.com/filipelenfers/df1e8b7d2aab3e77c6b6/raw/a296cbd89a73cf04c9283dd6a6fdf88c297a0e9d/redis-server | |
sudo cp redis-server /etc/init.d/ | |
sudo chmod +x /etc/init.d/redis-server | |
sudo vi /etc/redis/redis.conf #Change the line with "daemonize no" to "daemonize yes" | |
sudo chkconfig --add redis-server | |
sudo chkconfig --level 345 redis-server on | |
sudo service redis start (stop/restart) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment