虚拟机centOS中安装Redis,主机Redis Destop Manager不能访问虚拟机Redis server的解决方案
2015-12-28 22:05
525 查看
今天在学些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:
然后安装iptables服务包:
让服务在系统启动的时候启动:
下面是iptables的命令example:
保存防火墙的规则:
or
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安装与测试
- Lind.DDD.Repositories.Redis层介绍
- redis集群常用命令
- Redis的简介与安装(windows)
- redis安装
- redis的使用
- yii2 redis 使用 unixSocket
- redis 订阅 发布
- 基于sentinel的redis的HA方案
- redis error MISCONF Redis is configured to save RDB snapshots
- java操作redis
- Redis的简单介绍及在Windows下环境搭建
- redis 的性能及高版本配置
- Redis 未授权访问配合 SSH key 文件利用分析
- Java使用Pipeline对Redis批量读写(hmset&hgetall)
- 看了几天的redis稍微总结一下数据类型及命令(字符型)
- Nosql之redis学习(四)
- Redis整合Spring结合使用缓存实例
- Nosql之redis学习(三)
- NoSql之redis学习(二)