1. Download Redis source code from REDIS website, this example is installed under/usr/opt
wget http://download.redis.io/releases/redis-3.2.6.tar.gz--2016-12-16 21:55:49--/http Download.redis.io/releases/redis-3.2.6.tar.gz parsing host Download.redis.io (Download.redis.io) ... 109.74.203.151 connecting Download.redis.io (Download.redis.io) |109.74.203.151|:80 ... is connected. An HTTP request has been made and is waiting for a response ... $ OK Length: 1544806 (1.5M) [application/x-gzip] saving to: "Redis-3.2.6.tar.gz"
2. Extracting source code
Tar xzf redis-3.2.6.tar.gz
3. Building Redis
CD redis-3.2.6/ [[email protected] redis-3.2.6]# make
4. Install Tcl (must, Tcl did not install Redis test will error. If already installed, can skip)
Yum Install Tcl
5. Test Redis
[[email protected] redis-3.2.6]# make test
...
171 Seconds-unit/obuf-limits
\o/all tests passed without errors!
Cleanup:may take some time ... Ok
MAKE[1]: Leave directory "/USR/OPT/REDIS-3.2.6/SRC"
6. When the build is complete, the server and client execution files for Redis are generated, along with the default configuration file
/usr/opt/redis-3.2.6/src/redis-server ---redis service side
/USR/OPT/REDIS-3.2.6/SRC/REDIS-CLI ---redis client
/usr/opt/redis-3.2.6/src/redis-sentinel ---Redis instance monitoring management, notification and instance failover service, is the management tool for Redis cluster
/usr/opt/redis-3.2.6/redis.conf ---redis configuration file
/usr/opt/redis-3.2.6/sentinel.conf---administration tool profile
7. For convenience, you can create a new soft link and add it to the path and copy the default profile to the new Conf directory
[[email protected] redis]# ln-s redis-3.2.6 redis[[email protected] redis]# CD Redis
Ln-s Src/redis-server Bin/redis-server
Ln-s src/redis-cli BIN/REDIS-CLI
ln-s Src/redis-sentinel bin/redis- Sentinel
[Email protected] redis]# mkdir conf
redis]#cp redis.conf conf
CP sentinel.conf sentinel.conf
Modify the. BASHRC, add the following path and join it to path
Path= $PATH:/usr/opt/redis/bin
Reload once. BASHRC to make the path effective
. ~/.BASHRC [Email protected] redis]# echo $PATH/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/ Usr/bin:/root/bin:/usr/opt/redis/bin
8. Modify the configuration file redis.conf, find ' daemonize no ' to ' daemonize yes ', which will let Redis later set service mode to run
9. Start the Redis service in DAEM mode
[Email protected] conf]# Redis-server redis.conf
View Redis server-side processes
[Email protected] ~]$ ps-ef|grep redisroot 3755 24813 0 22:49 pts/0 redis-server *:6379
10. Start the Redis client, type the ping command, and Redis response pong, which means Redis is installed and ready to use.
[Email protected] ~]# REDIS-CLI
127.0.0.1:6379> Ping
PONG
127.0.0.1:6379>
One. Done
Installing Redis steps under CentOS 7