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

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

)

 

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

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

)

posted @ 2018-02-13 12:13  曲高终和寡  阅读(203)  评论(0编辑  收藏  举报