Redis搭建
配置环境
系统:CentOS Linux release 7.6.1810 (Core)
安装包:redis-6.2.6.tar
安装依赖
[root@localhost ~]# yum -y install gcc tcl
[root@localhost ~]# tar -zxf redis-6.2.6.tar.gz -C /usr/src/
[root@localhost ~]# cd /usr/src/redis-6.2.6/
[root@localhost redis-6.2.6]# make && make install
编译报错 (以下内容)
In file included from adlist.c:34:0:
编译中断。
make[1]: *** [adlist.o] 错误 1
make[1]: 离开目录“/usr/src/redis-6.2.6/src”
make: *** [all] 错误 2
解决方案:
[root@localhost redis-6.2.6]# make MALLOC=libc
启动
[root@localhost redis-6.2.6]# redis-server &
[1] 10616
[root@localhost redis-6.2.6]# 10616:C 21 May 2022 00:35:10.249 #
oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
10616:C 21 May 2022 00:35:10.249 # Redis version=6.2.6, bits=64, commit=00000000, modified=0, pid=10616, just started
10616:C 21 May 2022 00:35:10.249 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
10616:M 21 May 2022 00:35:10.251 * Increased maximum number of open files to 10032 (it was originally set to 1024).
10616:M 21 May 2022 00:35:10.251 * monotonic clock: POSIX clock_gettime
_._
_.-``__ ''-._
_.-`` `. `_. ''-._ Redis 6.2.6 (00000000/0) 64 bit
.-`` .-```. ```\/ _.,_ ''-._
( ' , .-` | `, ) Running in standalone mode
|`-._`-...-` __...-.``-._|'` _.-'| Port: 6379 端口号
| `-._ `._ / _.-' | PID: 10616
`-._ `-._ `-./ _.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' | https://redis.io
`-._ `-._`-.__.-'_.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' |
`-._ `-._`-.__.-'_.-' _.-'
`-._ `-.__.-' _.-'
`-._ _.-'
`-.__.-'
10616:M 21 May 2022 00:35:10.253 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
10616:M 21 May 2022 00:35:10.253 # Server initialized
10616:M 21 May 2022 00:35:10.253 # 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.
10616:M 21 May 2022 00:35:10.253 * Ready to accept connections
进入redis
Redis-cli 后可加 端口号、ip、密码 (链接)
[root@localhost redis-6.2.6]# redis-cli -h 127.0.0.1 -p 6379
127.0.0.1:6379>
故障解决方案
https://blog.csdn.net/libra_ts/article/details/71195128