githubEdit

Redis

Memory Database Redis

Introduction

...

Deploy By Binary

Quick Start

# dependencies
apt install pkgconf libsystemd-dev

# download source code
cd /usr/local/src/
#wget https://download.redis.io/redis-stable.tar.gz
#tar -xzvf redis-stable.tar.gz && cd redis-stable
wget https://download.redis.io/releases/redis-7.0.11.tar.gz
tar -xzvf redis-7.0.11.tar.gz && cd redis-7.0.11

# compile and install
make MALLOC=jemalloc USE_SYSTEMD=yes
make test
make PREFIX=/opt/redis-7.0.11/ install

# soft link
ln -svf /opt/redis-7.0.11 /opt/redis
cd /opt/redis

# start redis server
## 1. single mode
cp /usr/local/src/redis-7.0.11/redis.conf /opt/redis/redis.conf
/opt/redis/bin/redis-server /opt/redis/redis.conf
## 2. fake cluster mode
mkdir -p /opt/redis/{7001..7003}
cp /usr/local/src/redis-7.0.11/redis.conf /opt/redis/7001/redis.conf && cp /usr/local/src/redis-7.0.11/redis.conf /opt/redis/7002/redis.conf && cp /usr/local/src/redis-7.0.11/redis.conf /opt/redis/7003/redis.conf
./bin/redis-server /opt/redis/7001/redis.conf --bind 127.0.0.1 --port 7001 --daemonize yes --pidfile ./redis.pid --logfile ./redis.log --dir /opt/redis/7001 --cluster-enabled yes
./bin/redis-server /opt/redis/7002/redis.conf --bind 127.0.0.1 --port 7002 --daemonize yes --pidfile ./redis.pid --logfile ./redis.log --dir /opt/redis/7002 --cluster-enabled yes
./bin/redis-server /opt/redis/7003/redis.conf --bind 127.0.0.1 --port 7003 --daemonize yes --pidfile ./redis.pid --logfile ./redis.log --dir /opt/redis/7003 --cluster-enabled yes
./bin/redis-cli --cluster create 127.0.0.1:7001 127.0.0.1:7002 127.0.0.1:7003 --cluster-replicas 0 --cluster-yes

Config and Boot

Config

Boot(systemd)

Verify

[[Database#redis|Redis Command]]

Troubleshooting

Deploy By Container

Run On Docker

Run On Kubernetes

Reference:

Last updated