1.由于centOS官方yum源里面没有Redis,这里我们需要安装一个第三方的yum源,这里用了fedora的epel仓库

yum install epel-release

安装过程中会有让你确认的,输入y按回车就可以了

 

2.安装Redis

yum install redis

安装过程中会有让你确认的,输入y按回车就可以了

 

3.启动Redis

service redis start

 

4.修改端口号/密码等配置

vim /etc/redis.conf

 

5.注释掉ip绑定(这个只允许本地调试,不注释掉这个,你远程这个redis的时候会提示:

redis.clients.jedis.exceptions.JedisConnectionException: java.net.ConnectException: Connection refused: connect

)

[从零开始搭网站八]CentOS使用yum安装Redis的方法

 

6:关闭保护模式(不关闭的话远程这个redis会提示:

redis.clients.jedis.exceptions.JedisDataException: DENIED Redis is running in protected mode

)

[从零开始搭网站八]CentOS使用yum安装Redis的方法

相关文章:

  • 2022-12-23
  • 2021-05-29
  • 2021-09-21
  • 2021-04-23
  • 2021-10-02
  • 2021-10-27
  • 2021-06-02
  • 2021-10-03
猜你喜欢
  • 2022-02-14
  • 2021-08-26
  • 2021-10-08
  • 2021-11-08
  • 2021-11-04
  • 2021-09-13
相关资源
相似解决方案