1. Install TCL environment:
    Wget http://downloads.sourceforge.net/tcl/tcl8.6.1-src.tar.gz tar - XZVF tcl8.6.1 - SRC. Tar. Gzcd  /usr/local/tcl8.6.1/ Unix /./configure make && make installCopy the code
  2. Redis installation:
    Wget http://download.redis.io/releases/redis-5.0.5.tar.gz tar - ZXVF redis - 5.0.5. Tar. GzcdRedis - 5.0.5 make && maketest && make install
    Copy the code
  3. Redis configuration:
    1. Copy the redis_init_script script from the redis utils directory to the /etc/init.d directory on Linux and rename it redis_6379
    2. (If you need to change the startup port of Redis, modify REDISPORT in line 6 of the redis_6379 script (default: 6379).)
    3. Conf file in the redis directory to /etc/redis/6379.conf
    4. Create a directory for storing redis data (persistent files) : /var/redis/6379
    5. Adjust the following configuration of redis.conf:
      1. Daemonize yes # Let Redis run as a daemon
      2. Pidfile /var/run/redis_6379.pid # set redis pidfile location
      3. (port 6379) # set the redis listening port number
      4. Dir /var/redis/6379 # Set the location of the persistence file
      5. Bind 192.168.xx.xx # Bind the local IP address
  4. Set up Redis startup:
    1. At the top of the redis_6379 script, add two lines of comment
      # chkconfig: 2345 90 10
      # description: Redis is a persistent key-value database
      Copy the code
    2. Execute command:
      chkconfig redis_6379 on
      Copy the code
  5. The correct way to open (and close) Redis:
    /etc/init.d
    redis_6379 start
    # Open method 2
    redis-server /redis.conf
    Kill -9: delete pid file manuallyRedis -cli -h 192.168.xx.xx -p 6379 shutdownCopy the code

First published on my blog: Zephyrlai.github. IO