yum 安装 Redis

# Redis  /  CentOS  /  CentOS7  /  yum

1.先启用 remi 源

yum install epel-release yum-utils  
yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm  
yum-config-manager --enable remi  

2.安装

目前可安装到的版本是:V3.2.12

yum install redis  

docker下安装: docker pull redis:3.2.12

3.修改配置文件

vi /etc/redis.conf  

修改参考:

############################
#允许远程访问
#bind 127.0.0.1
#端口号
port 6378  
#设置密码
requirepass xxx  
#关闭保护
protected-mode no  
############################

4.启动

systemctl start redis.service  

5.测试

redis-cli -p 6378 -a xxx  
set 'test' 'hello'  
get 'test'  

6.开机启动

systemctl enable redis.service  

评论

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×