Install compile environment
/root @ local ~ # yum install GCC GCC - c + + make - y
Download software
http://download.redis.io/releases/
/root @ localhost ~ # rz -e
Rz waiting to receive.
/root @ localhost ~ # ll
The total amount 1948
rw -- -- -- -- -- -- --. 1 root root 13:28 anaconda 2 July 1289 - ks. CFG
Rw - r - r -. 1 root root on July 24, 1986574 05:25 redis - 5.0.9. Tar. Gz
Unpack the
/root @ localhost ~ # tar xf redis - 5.0.9. Tar. Gz - C/usr/local/SRC/
[root @ localhost local] # CD/usr/local/SRC
[root @ localhost SRC] # ll
The total amount of 4
DRWXRWXR - x. 6 root root on April 17, 4096 10:45 redis - 5.0.9
[root @ localhost SRC] # redis - 5.0.9/CD
Compile
[root @ node1 redis - 5.0.9] # make MALLOC=libc
Install
[root @ localhost redis - 5.0.9] # make install PREFIX=/usr/local/redis
Provide configuration file
[root @ localhost redis - 5.0.9] # mkdir/etc/redis
[root @ localhost redis - 5.0.9] # cp/usr/local/SRC/redis - 5.0.9/redis. Conf/etc/redis/
Modify the configuration file
[root @ localhost redis - 5.0.9] # vim/etc/redis/redis conf
Dir/var/lib/redis
Create a data directory
[root @ localhost redis - 5.0.9] # mkdir/var/lib/redis
Create user and group
[root @ localhost redis - 5.0.9] # groupadd - r - 950 g redis
[root @ localhost redis - 5.0.9] # useradd - r - 950 - g u/var/lib/redis - 950 - d c 'redis server - s/sbin/nologin redis
Change the directory permissions
[root @ localhost redis - 5.0.9] # chown -r redis/var/lib/redis/
Configure the environment variables
[root @ localhost redis - 5.0.9] # vim/etc/profile. D/redis. Sh
The export PATH=/usr/local/redis/bin: $PATH
[root @ localhost redis - 5.0.9] # source/etc/profile. D/redis. Sh
Configure the service startup scripts
[root @ localhost redis - 5.0.9] # vim/usr/lib/systemd/system/redis. Service
[root @ localhost redis - 5.0.9] # cat/usr/lib/systemd/system/redis. Service
[Unit]
Description=Redis persistent key - value database
After=network. The target
[Service]
ExecStart=/usr/local/redis/bin/redis server/etc/redis/redis conf - supervised systemd
ExecStop=/usr/bin/kill ` pidof redis - server `
Type=notify
User=redis
Group=redis
RuntimeDirectory=redis
RuntimeDirectoryMode=0755
[Install]
WantedBy=multi - user. Target