openEuler安装Redis
1.软件包下载上传
下载:https://redis.io/download
上传:上传tar包至虚拟机
[root@localhost download]# tar -C /opt/software/ -zxvf redis-6.2.7.tar.gz # -C指定解压目录
[root@localhost software]# mv redis-6.2.7 redis
[root@localhost software]# cd redis
2.Redis的安装
# 编译
# 编译的基础是虚拟机必须配备GCC环境
[root@localhost redis]# make
# 安装
[root@localhost redis]# make PREFIX=/opt/software/redis install
3.安装结果验证
[root@localhost redis]# bin/redis-server ./redis.conf
9660:C 10 May 2022 15:55:49.651 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
9660:C 10 May 2022 15:55:49.651 # Redis version=6.2.7, bits=64, commit=00000000, modified=0, pid=9660, just started
9660:C 10 May 2022 15:55:49.651 # Configuration loaded
9660:M 10 May 2022 15:55:49.651 * Increased maximum number of open files to 10032 (it was originally set to 1024).
9660:M 10 May 2022 15:55:49.651 * monotonic clock: POSIX clock_gettime
9660:M 10 May 2022 15:55:49.652 # A key '__redis__compare_helper' was added to Lua globals which is not on the globals allow list nor listed on the deny list.
_._
_.-``__ ''-._
_.-`` `. `_. ''-._ Redis 6.2.7 (00000000/0) 64 bit
.-`` .-```. ```\/ _.,_ ''-._
( ' , .-` | `, ) Running in standalone mode
|`-._`-...-` __...-.``-._|'` _.-'| Port: 6379
| `-._ `._ / _.-' | PID: 9660
`-._ `-._ `-./ _.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' | https://redis.io
`-._ `-._`-.__.-'_.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' |
`-._ `-._`-.__.-'_.-' _.-'
`-._ `-.__.-' _.-'
`-._ _.-'
`-.__.-'
9660:M 10 May 2022 15:55:49.652 # Server initialized
9660:M 10 May 2022 15:55:49.652 # 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.
9660:M 10 May 2022 15:55:49.652 * Loading RDB produced by version 6.2.7
9660:M 10 May 2022 15:55:49.652 * RDB age 128 seconds
9660:M 10 May 2022 15:55:49.652 * RDB memory usage when created 0.77 Mb
9660:M 10 May 2022 15:55:49.652 # Done loading RDB, keys loaded: 0, keys expired: 0.
9660:M 10 May 2022 15:55:49.652 * DB loaded from disk: 0.000 seconds
9660:M 10 May 2022 15:55:49.652 * Ready to accept connections
^C9660:signal-handler (1652169397) Received SIGINT scheduling shutdown...
9660:M 10 May 2022 15:56:37.758 # User requested shutdown...
9660:M 10 May 2022 15:56:37.759 * Saving the final RDB snapshot before exiting.
9660:M 10 May 2022 15:56:37.761 * DB saved on disk
9660:M 10 May 2022 15:56:37.761 * Removing the pid file
4.修改配置文件
# 修改Redis配置文件
[root@localhost redis]# vim redis.conf
# 配置远程访问
将bind 127.0.0.1 -::1此行注释 # 如果不注释,相当于配置了固定ip,配置完之后,只有指定ip可连接redis,其他ip不能
将protected-mode 由yes改为no # 与bind配合使用,一起注释
# 配置后台启动
将daemonize 由no改为yes