This article describes the compilation installation of Redis
1, upload the source package to the Linux server; I've uploaded it to the root directory:/root/redis-3.2.3.tar.gz
grep redis.*gz-rw-r--r-- 1 root root 1541401 September 18 :panax notoginseng redis-3.2. 3. tar. gz
2. Decompression
tar -xzvf redis-3.2 . 3 . tar .gzll /root/| grep redisdrwxrwxr -x 6 root root 4096 August 2 17 : 00 redis-3.2 . 3 -rw-r--r--1 root root 1541401 September 17 18 : 37 redis-3.2 . 3 . tar . GZ
3, make here can be made directly because Redis has already written make file, that is, do not have to execute configure, made after the compiled file will be saved to the SRC directory
cd/root/redis-3.2.3 Makell Total dosage196-rw-rw-r--1Root root75147August2 -:xx xx-releasenotes-rw-rw-r--1Root root -August2 -:xxBUGS-rw-rw-r--1Root root1805August2 -:xxcontributing-rw-rw-r--1Root root1487August2 -:xxCOPYINGDRWXRWXR-X7Root root4096September - -: -Deps-rw-rw-r--1Root root OneAugust2 -:xxINSTALL-rw-rw-r--1Root root151August2 -:xxMakefile-rw-rw-r--1Root root4223August2 -:xxMANIFESTO-rw-rw-r--1Root root6834August2 -:xxreadme.md-rw-rw-r--1Root root46695August2 -:xxredis.conf-rwxrwxr-x1Root root271August2 -:xxruntest-rwxrwxr-x1Root root280August2 -:xxruntest-Cluster-rwxrwxr-x1Root root281August2 -:xxruntest-Sentinel-rw-rw-r--1Root root7109August2 -:xxSENTINEL.CONFDRWXRWXR-X2Root root4096September - -: theSRCDRWXRWXR-XTenRoot root4096August2 -:xxTESTSDRWXRWXR-X7Root root4096August2 -:xxUtils
4, make install this step will be the SRC directory under the binary files copied to the/usr/local/bin/directory, because the way to save the file to the/usr/local/bin/directory is not easy to manage, so we saved the file to
Under the/usr/local/redis/bin/directory
mkdir -p/usr/local/redis/bin/cd srccp Redis-benchmark redis-check-aof Redis-check-rdb REDIS-CLI Redis-sentinel Redis-server redis-trib.rb/usr/local/redis/bin/
5. Provide a startup script for Redis
#!/bin/Bash#chkconfig:2345 - -#description: Redis-Server init scriptsserver_exec=/usr/local/redis/bin/redis-Serverpid_file=/usr/local/redis/Redis_server.pidport=6379 Case$1 inch"Start") ifTest-e $pid _file Then Echo "REDISD has been started" Else Echo "Start REDISD ..."$server _exec--port $port--pidfile $pid _file &fi;;"Stop") ifTest-e $pid _file Then Echo "Would to stop REDISD ..."PID=`Cat$pid _file 'Kill$pidElse Echo "REDISD has been stop" fi;;"*") Echo "Not suport argument $";;Esac
6. Start REDISD
Service REDISD Start
7. Modify Environment variables
Export Path=/usr/local/redis/bin: $PATH
Compiling and installing Redis