1 minute read

In this article I will introduce how to install a Redis into Linux and make it as a service

Download

  1. go to Redis website and find the download button, get its link, example link
  2. in Linux, run wget <above link> , if there is no wget command, run “yum install wget -y” first
  3. tar -xf <downloaded_folder>unzip the downloaded folder

Install

  1. cd to the folder where we put unzipped content

  2. make, to compile the executable into system

    1. if this command fails, possibly some dependencies are missing, e.g. yum install gcc
    2. make distclean and rerun make
  3. now there are some runnable programs in /src folder

  4. make install PREFIX=/opt/redis to copy the programs from /src folder to specified one

  5. now we can only run the redis program under that folder, let’s make redis command globally accessible

  6. vi /etc/profile

    1. export REDIS_HOME=/opt/redis
      export $PATH=$PATH:$REDIS_HOME/bin
      
    2. source
  7. then go to <redis folder>/utils

  8. ./install_server

    1. which may encounter the issue This system seems to use systemd. Please take a look at the provided example service unit files in this directory, and adapt and install them.

      the solution can be found in this stack overflow thread

    2. then the command can executed successfully, just use the default option for pop-up questions

Verify

To verify whether the Redis has started successfully, we can

  1. ps -fe | grep redis should has some records
  2. service redis_6379 status should be executable, which meansredis_6379 can be found under /etc/init.d