Redis 3.2.8 Latest Edition Installation Tutorial under Centos7

Time:2019-10-7

I. System Environment and Version Description

Redis’s version is the current official version redis-3.2.8.

II. Installation steps of Redis

2.1 Download Redis installation package online

[[email protected] lzh]# wget http://download.redis.io/releases/redis-3.2.8.tar.gz
--2017-04-18 09:37:12-- http://download.redis.io/releases/redis-3.2.8.tar.gz
Host download. redis. IO (download. redis. io)... 109.74.203.151
Connecting download.redis.io (download.redis.io) | 109.74.203.151 |: 80... Connected.
HTTP request has been issued, waiting for response... 200 OK
Length: 1547237 (1.5M) [application/x-gzip]
Save to: "redis-3.2.8.tar.gz"
100%[======================================================================>] 1,547,237,315KB/s takes 5.6s. 
2017-04-18 09:37:20 (268 KB/s) - Preserved "redis-3.2.8.tar.gz" [1547 237/1547 237])

2.2 Unzip and download Redis source code compression package to generate a new directory redis-3.2.8

$ tar xzf redis-3.2.8.tar.gz

2.3 Enter the directory and execute make compilation

$ cd redis-3.2.8

$ make

It takes a while to compile until you see it

[/code]

Note: After compiling the make command, six executable files are generated in the SRC directory, respectively.

redis-server、redis-cli、redis-benchmark、redis-check-aof、redis-check-rdb、redis-sentinel。

New version redis-check-dump to redis-check-rdb

III. Redis Installation Configuration

3.1 Install Redis and execute make install. Six executable files generated by make compilation will be copied to / usr / local / bin directory.

[[email protected] redis-3.2.8]# make install
cd src && make install
Make [1]: Enter the directory "/ home/lzh/redis-3.2.8/src"
Hint: It's a good idea to run 'make test' ;)
 INSTALL install
 INSTALL install
 INSTALL install
 INSTALL install
 INSTALL install
Make [1]: leave the directory "/ home/lzh/redis-3.2.8/src"

3.2 After executing. / utils/install_server.sh configuration, Redis can start with the system. During execution, you will choose port, file name, etc. I choose default.

3.3 View boot list

[[email protected] redis-3.2.8]# chkconfig --list
Note: The output only shows SysV services, not native system D services. SysV configuration data may be overwritten by native system D configuration. 
  If you want to list system D services, execute'system CTL list-unit-files'.
  To view services enabled for a specific target, execute
  'systemctl list-dependencies [target]'。
Netconsole 0:Guan 1:Guan 2:Guan 3:Guan 4:Guan 5:Guan 6:Guan
Network 0:Close 1:Close 2:Open 3:Open 4:Open 5:Open 6:Close
Redis_63790:Close 1:Close 2:Open 3:Open 4:Open 5:Open 6:Close

IV. Viewing, Opening and Closing Redis Services

4.1 View Redis process by ps-ef | grep redis command


[[email protected] redis-3.2.8]# ps -ef|grep redis
root   12831   1 0 10:21 ?    00:00:01 /usr/local/bin/redis-server 127.0.0.1:6379
root   13100  4090 0 10:29 pts/0  00:00:00 grep --color=auto redis

4.2 Close Redis service operation via / etc/init.d/redis_6379 stop command or (service redis_6379 stop)

4.3 Open Redis service operation by / etc/init.d/redis_6379 start command or (service redis_6379 start)

You can also start with the redis-server command

$ src/redis-server

V. Redis Testing

[[email protected] bin]# redis-cli
127.0.0.1:6379 > flushdb -- Clear the currently selected database
OK
127.0.0.1:6379> set testkey 2
OK
127.0.0.1:6379> get testkey
"2"

The above is the whole content of this article. I hope it will be helpful to everyone’s study, and I hope you will support developpaer more.