Redis搭建

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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值