GARA
博闻强记 多思多问 取法乎上 持之以恒

 

  1. 检查本机与虚拟机是否可以互相ping通,如本机IP:192.168.22.111  虚拟机IP:192.168.44.129 (设置虚拟机静态IP已设置)
    • 本机 win+R 输入cmd 进入dos 输入 ping 192.168.44.129 ,查看数据输送情况
    • 虚拟机: ping 192.168.22.111 查看数据输送情况
  2. 查看6379(或者自定义redis端口)时候打开
    • firewall-cmd --query-port=6379/tcp 如果返回no则端口没有开启
    • firewall-cmd --add-port=6379/tcp  (加 --permanent 永久有效),返回success说明开启成功
  3. 第2步无误之后,检查虚拟机防火墙设置
    • 关闭防火墙两种方式
      • iptables 形式防火墙关闭
        • service iptables stop
        • chkconfig iptables off 永久关闭
      • firewalld 形式防火墙关闭
        • systemctl stop firewalld && systemctl disable firewalld 
        • chkconfig firewalld off 永久关闭
    • 检查防火墙状态(是否dead状态)
      • systemctl status iptables
      • systemctl status firewalld

      •   
  4. 第3步无法解决问题的话,就出绝招了——修改redis.conf文件
    • ps addr 查了虚拟机分配的IP
    • 修改redis.conf中bind,指定虚拟机IP,如笔者这样修改
      • # bind 127.0.0.1
      • bind 192.168.44.129
      • protected-mode yes 改为 protected-mode no
      • daemonized no 改为 daemonized yes 以后台静默进程启动(可选)
    • 重启reidis 服务
      • systemctl restart redis
    • 启动redis服务正确姿势
      • 后台启动方式 redis-server /xx/yy/redis.conf (redis.conf实际地址)
      • 显式启动方式
        • cd 到redis 安装目录 
        • redis-server &

  

  5. 在本机端用Redis Desktop Manager 测试,出现如下惊喜界面,大功告成!

  

 

posted on 2018-08-23 15:26  GaraYing  阅读(11280)  评论(1编辑  收藏  举报