We first need to install the dependencies:
yum install -y gcc gcc-c++
Then download the installation package:
wget http://download.redis.io/releases/redis-5.0.7.tar.gz
:wget http://download.redis.io/releases/redis-5.0.7.tar.gz
--2020-03-06 09:03:24-- http://download.redis.io/releases/redis-5.0.7.tar.gz
Resolving download.redis.io (download.redis.io)... 109.74.203.151
Connecting to download.redis.io (download.redis.io)|109.74.203.151|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1984203 (1.9M) [application/x-gzip]
Saving to: ‘redis-5.0.7.tar.gz’
redis-5.0.7.tar.gz 100%[========================================================>] 1.89M 178KB/s in 13s
2020-03-06 09:03:43 (147 KB/s) - ‘redis-5.0.7.tar.gz’ saved [1984203/1984203]
Unzip the package:
tar -zxvf redis-5.0.7.tar.gz
Into the unpacked directory:
cd redis-5.0.7
Compile (If you do not make use sudo apt install make install):
make
Create a directory under / usr / local:
mkdir /usr/local/redis
Installation redis:
make install PREFIX=/usr/local/redis
:sudo make install PREFIX=/usr/local/redis
cd src && make install
make[1]: Entering directory '/usr/local/redis-5.0.7/src'
Hint: It's a good idea to run 'make test' ;)
INSTALL install
INSTALL install
INSTALL install
INSTALL install
INSTALL install
make[1]: Leaving directory '/usr/local/redis-5.0.7/src'
The unpack redis redis.conf copied to the bin directory create the redis:
redis.conf ../redis/bin
Start redis:
cd /usr/local/redis/bin
./redis-server ./redis.conf
Close redis:
cd /usr/local/redis/bin
./redis-cli -h 127.0.0.1 -p 6379 shutdown