开启端口,修改防火墙配置文件 vi /etc/sysconfig/iptables html
加入端口配置 centos
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 6379 -j ACCEPT tcp
service iptables savepost
service iptables restart url
CentOS 7.0默认使用的是firewall做为防火墙,这里改成iptables防火墙。rest
一、关闭firewall:htm
systemctl stop firewalld.service #中止firewallblog
systemctl disable firewalld.service #禁止firewall开机启动ip