Skip to content

Instantly share code, notes, and snippets.

@B-PRAVEEN
Last active April 4, 2022 12:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save B-PRAVEEN/4076db8a15662921de5ef503191f67e2 to your computer and use it in GitHub Desktop.
Save B-PRAVEEN/4076db8a15662921de5ef503191f67e2 to your computer and use it in GitHub Desktop.
sudo yum -y update
sudo ln -sf /usr/share/zoneinfo/UTC /etc/localtime
sudo yum -y install gcc make tcl
cd /usr/local/src
sudo wget http://download.redis.io/redis-stable.tar.gz
sudo tar xvzf redis-stable.tar.gz
sudo rm -f redis-stable.tar.gz
cd redis-stable
sudo yum groupinstall "Development Tools"
sudo make distclean
sudo make
sudo yum install -y tcl
# Create Directories and Copy Redis Files
sudo mkdir -p /etc/redis && sudo mkdir -p /var/lib/redis
sudo cp src/redis-server /usr/local/bin/
sudo cp src/redis-cli /usr/local/bin/
sudo cp /usr/local/src/redis-stable/redis.conf /etc/redis/
# Configure redis.conf
# replace: daemonize no --> daemonize yes
# sudo sed -i '/\#/! s/daemonize no/daemonize yes/' /etc/redis/redis.conf
# replace: dir ./ --> dir /var/lib/redis
sudo sed -i '/\#/! s/dir .\//dir \/var\/lib\/redis/' /etc/redis/redis.conf
# This can be used to daemonize anything that would normally run in the foreground
cd /etc/systemd/system/
wget https://gist.githubusercontent.com/B-PRAVEEN/551cacc342e792c1c94ceb9ee4768118/raw/7e1964b64f6b17798a810bb7fbf76ce3cebef6a4/redis.service
sudo systemctl enable /etc/systemd/system/redis.service
sudo systemctl start redis.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment