1.下载地址:​​https://redis.io/download​

2.编译安装redis

[root@mysql57 ~]# tar xvf /tmp/redis-6.2.6.tar.gz -C /
[root@mysql57 ~]# mv /redis-6.2.6/ /redis
[root@mysql57 ~]# yum install gcc-c++ -y
[root@mysql57 redis]# cd /redis/
[root@mysql57 redis]# make
[root@mysql57 redis]# src/redis-server
6402:C 27 Dec 2021 22:54:31.062 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
6402:C 27 Dec 2021 22:54:31.062 # Redis version=6.2.6, bits=64, commit=00000000, modified=0, pid=6402, just started
6402:C 27 Dec 2021 22:54:31.062 # Warning: no config file specified, using the default config. In order to specify a config file use src/redis-server /path/to/redis.conf
6402:M 27 Dec 2021 22:54:31.062 * Increased maximum number of open files to 10032 (it was originally set to 1024).
6402:M 27 Dec 2021 22:54:31.062 * monotonic clock: POSIX clock_gettime
_._
_.-``__ ''-._
_.-`` `. `_. ''-._ Redis 6.2.6 (00000000/0) 64 bit
.-`` .-```. ```// _.,_ ''-._
( ' , .-` | `, ) Running in standalone mode
|`-._`-...-` __...-.``-._|'` _.-'| Port: 6379
| `-._ `._ / _.-' | PID: 6402
`-._ `-._ `-./ _.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' | https://redis.io
`-._ `-._`-.__.-'_.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' |
`-._ `-._`-.__.-'_.-' _.-'
`-._ `-.__.-' _.-'
`-._ _.-'
`-.__.-'

6402:M 27 Dec 2021 22:54:31.063 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
6402:M 27 Dec 2021 22:54:31.063 # Server initialized
6402:M 27 Dec 2021 22:54:31.063 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
6402:M 27 Dec 2021 22:54:31.063 * Ready to accept connections

3.测试是否安装完成

[root@mysql57 ~]# cd /redis/
[root@mysql57 redis]# src/
mkreleasehdr.sh redis-check-aof redis-sentinel
modules/ redis-check-rdb redis-server
redis-benchmark redis-cli redis-trib.rb
[root@mysql57 redis]# src/
mkreleasehdr.sh redis-check-aof redis-sentinel
modules/ redis-check-rdb redis-server
redis-benchmark redis-cli redis-trib.rb
[root@mysql57 redis]# src/redis-c
redis-check-aof redis-check-rdb redis-cli
[root@mysql57 redis]# src/redis-cli
127.0.0.1:6379> set foo bar
OK
127.0.0.1:6379> get foo
"bar"

版权声明:本文为博主原创文章,未经博主允许不得转载。

Redis