NOTE

1.2 Redis Installation

Install Redis from source, configure the core settings, and start a local instance.

Redis / CacheCreated Updated 1 min readhistorical

This is a historical learning note and may contain outdated or incomplete understanding.

1. Install from Source

  1. Download the source code
  1. Install development-environment packages
sudo apt-get install build-essential tcl ruby rubygems
  1. Compile
cd src
make MALLOC=libc
  1. Install
  • redis*
make install PREFIX=<USER_HOME>/software/redis/redis0
mkdir -p redis0/{conf,data,log}
cp src/redis-trib.rb <USER_HOME>/software/redis/redis0/bin/
cp redis-5.0.8/*.conf redis0/conf/
  1. Configure

    • Back up the configuration and remove comments
    mv redis.conf redis_bak.conf
    cat redis_bak.conf | grep -v "#" | grep -v "^$" > redis.conf
    • The most important configuration
    daemonize yes
    bind 127.0.0.1
    port 6379
    dir "<USER_HOME>/software/redis/redis0/data"
    logfile "<USER_HOME>/software/redis/redis0/log/6379.log"
  2. Start and test

bin/redis-server conf/redis.conf
bin/redis-cli -p 6379

Discussion

Sign in with GitHub to comment. Discussions are stored as GitHub Issues.View on GitHub