centos redis 安装和配置

安装

# install from EPEL
[root@dlp ~]# yum --enablerepo=epel -y install redis

配置

[root@dlp ~]# vi /etc/redis.conf
# line 45: listening port
port 6379
# line 64: listening interface
# localhost only by default
# if you'd like to connect from other Hosts,
# change to the own IP address or to 0.0.0.0
bind 127.0.0.1
# line 118: number of Databases
# database ID is is assgined from 0 to (setting value - 1)
databases 16
# line 142: save caching Datase on Disk
# the default settings below means like follows
# after 900 sec if at least 1 key changed
# after 300 sec if at least 10 keys changed
# after 60 sec if at least 10000 keys changed
# if you'd like to disable this function, comment out all lines fo "save ***" or specify [save ""]
save 900 1
save 300 10
save 60 10000
# line 392: authorization password
requirepass password
# line 501: alternative persistence mode ("yes" means enabled)
# if enabled, Redis loses high performance but get more safety
appendonly no
# line 531: if enabled "appendonly yes" when wirting data on Disk
# no means do not fsync by Redis (just let the OS flush the data)
# appendfsync always
appendfsync everysec
# appendfsync no

启动

[root@dlp ~]# systemctl start redis
[root@dlp ~]# systemctl enable redis

添加端口

[root@dlp ~]# firewall-cmd --add-port=6379/tcp --permanent
success
[root@dlp ~]# firewall-cmd --reload
success
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值