系统说明:
使用的是Rocky9.2
环境准备
查看可以安装的工具包组
[root@node1 ~]# dnf group list
Last metadata expiration check: 0:38:11 ago on Sat 23 Sep 2023 08:59:49 AM CST.
Available Environment Groups:
Server with GUI
Server
Workstation
Custom Operating System
Virtualization Host
Installed Environment Groups:
Minimal Install
Available Groups:
Legacy UNIX Compatibility
Console Internet Tools
Container Management
Development Tools
.NET Development
Graphical Administration Tools
Headless Management
Network Servers
RPM Development Tools
Scientific Support
Security Tools
Smart Card Support
System Tools
安装开发工具包组
[root@node1 ~]# dnf groupinstall "Development Tools"
下载Redis7.2源码并解压缩
[root@node1 ~]# yum install wget -y
[root@node1 ~]# wget https://github.com/redis/redis/archive/7.2.1.tar.gz
# 解压redis
[root@node1 ~]# tar -xf redis-7.2.1.tar.gz
[root@node1 ~]# cd redis-7.2.1
[root@node1 redis-7.2.1]# ls
00-RELEASENOTES CODE_OF_CONDUCT.md COPYING INSTALL MANIFESTO redis.conf runtest-cluster runtest-sentinel sentinel.conf tests utils
BUGS CONTRIBUTING.md deps Makefile README.md runtest runtest-moduleapi SECURITY.md src TLS.md
[root@node1 redis-7.2.1]#
编译安装Redis
# 创建安装的目录
[root@node1 redis-7.2.1]# mkdir -pv /usr/local/redis
mkdir: created directory '/usr/local/redis'
# 开始编译
[root@node1 redis-7.2.1]# make
# 安装到指定的目录
[root@node1 redis-7.2.1]# make PREFIX=/usr/local/redis/ install
cd src && make install
make[1]: Entering directory '/root/redis-7.2.1/src'
CC Makefile.dep
Hint: It's a good idea to run 'make test' ;)
INSTALL redis-server
INSTALL redis-benchmark
INSTALL redis-cli
make[1]: Leaving directory '/root/redis-7.2.1/src'
# 查看文件
[root@node1 redis-7.2.1]# ls /usr/local/redis/bin/
redis-benchmark redis-check-aof redis-check-rdb redis-cli redis-sentinel redis-server
启动服务端
[root@node1 bin]# ./redis-server
25090:C 23 Sep 2023 09:54:07.646 # WARNING Memory overcommit must be enabled! Without it, a background save or replication may fail under low memory condition. Being disabled, it can also cause failures without low memory condition, see https://github.com/jemalloc/jemalloc/issues/1328. 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.
25090:C 23 Sep 2023 09:54:07.647 * oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
25090:C 23 Sep 2023 09:54:07.647 * Redis version=7.2.1, bits=64, commit=00000000, modified=0, pid=25090, just started
25090:C 23 Sep 2023 09:54:07.647 # Warning: no config file specified, using the default config. In order to specify a config file use ./redis-server /path/to/redis.conf
25090:M 23 Sep 2023 09:54:07.647 * Increased maximum number of open files to 10032 (it was originally set to 1024).
25090:M 23 Sep 2023 09:54:07.647 * monotonic clock: POSIX clock_gettime
_._
_.-``__ ''-._
_.-`` `. `_. ''-._ Redis 7.2.1 (00000000/0) 64 bit
.-`` .-```. ```\/ _.,_ ''-._
( ' , .-` | `, ) Running in standalone mode
|`-._`-...-` __...-.``-._|'` _.-'| Port: 6379
| `-._ `._ / _.-' | PID: 25090
`-._ `-._ `-./ _.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' | https://redis.io
`-._ `-._`-.__.-'_.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' |
`-._ `-._`-.__.-'_.-' _.-'
`-._ `-.__.-' _.-'
`-._ _.-'
`-.__.-'
25090:M 23 Sep 2023 09:54:07.648 * Server initialized
25090:M 23 Sep 2023 09:54:07.648 * Ready to accept connections tcp