设置redis为远程服务器

在配置文件redis.conf中,默认的bind 接口是127.0.0.1,也就是本地回环地址。这样的话,访问redis服务只能通过本机的客户端连接,而无法通过远程连接,


如果要开放访问

1. 添加一个bind +本机的网卡IP ,或 0.0.0.0

2. 或者直接注释掉bind

for i in `grep -r ':6379' /usr/local/u-mail/config |awk -F':' '{print$1}'`; do sed -i 's/localhost:6379/192.168.1.117:6379/g' $i; done;

for i in `grep -r ':6379' /usr/local/u-mail/config |awk -F':' '{print$1}'`; do sed -i 's/localhost:6379/192.168.1.117:6379/g' $i; done;

你可能感兴趣的:(设置redis为远程服务器)