您的位置:首页 > 数据库 > Redis

Redis Destop Manager不能访问虚拟机

2016-05-13 15:46 519 查看

虚拟机centOS中安装Redis,主机Redis Destop Manager不能访问虚拟机Redis server的解决方案

今天在学些redis的时候碰到个问题,发现主机Redis Destop Manager不能访问虚拟机Redis server的解决方案,找了一些网上的资料,原因可能有两个,整理记录下来:

1. Redis.conf文件中打开了

# By default Redis listens for connections from all the network interfaces
# available on the server. It is possible to listen to just one or multiple
# interfaces using the "bind" configuration directive, followed by one or
# more IP addresses.
#
# Examples:
#
# bind 192.168.1.100 10.0.0.1
# bind 127.0.0.1
#如果上面这一行打开了,请关闭它。

2. 如果发现配置文件里面的bind没有打开,请尝试下面的步骤:

centos默认使用firewalld来管理netfilter子系统,不过底层调用的命令仍然是iptables等,所以先关掉firewalld:

systemctl stop firewalld

#屏蔽(让它不能启动)或显示该服务
systemctl mask firewalld

然后安装iptables服务包:

yum install iptables-services

让服务在系统启动的时候启动:

systemctl enable iptables

下面是iptables的命令example:

systemctl [stop|start|restart] iptables

保存防火墙的规则:

service iptables save

or

/usr/libexec/iptables/iptables.init save

试一下看是不是你的Redis Destop Manager是不是可以连接到虚拟机的Redis server了。


标签: Redis
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: