Redis外网访问配置修改
当我们在服务器安装了Redis之后,和MySQL一样都是只能在服务器本地进行访问,无法在服务器外部对服务器的Redis进行访问,所以我们需要对Redis的配置文件进行修改,从而使Redis可以远程访问,具体流程如下:
找到Redis的配置文件,一般情况下为**/etc/redis.conf**文件,修改该文件的bind和protect-mode
1 | # 将bind注释掉,或者将其值修改为0.0.0.0 |
重启Redis服务
1 | systemctl restart redis |
开放Redis的运行端口并重置防火墙,Redis的默认运行端口为6379
1 | firewall-cmd --add-port=6379 --permanent |