使用RedisDesktopManager(可视化)无法连接Redis(云)服务器问题 |
您所在的位置:网站首页 › 为什么虚拟机登录说连接不上服务器 › 使用RedisDesktopManager(可视化)无法连接Redis(云)服务器问题 |
好了废话不多说本着解决问题的实事求是的踩坑心得分享解决问题 问题点一就是redis的配置文件问题 进入redis的目录 [root@VM-20-13-centos ~]# cd /www/server/redis/ 使用vim进入配置文件的修改 [root@VM-20-13-centos redis]# vim redis.conf使用vim编辑器修改`bin`目录中的redis.conf文件,修改如下三项 ################################## NETWORK ##################################### # By default, if no "bind" configuration directive is specified, Redis listens # for connections from all the network interfaces available on the server. # It is possible to listen to just one or multiple selected interfaces using # the "bind" configuration directive, followed by one or more IP addresses. # # Examples: # # bind 192.168.1.100 10.0.0.1 这里是告诉我们可以绑定多个ip来连接redis服务端 # bind 127.0.0.1 ::1 # # ~~~ WARNING ~~~ If the computer running Redis is directly exposed to the # internet, binding to all the interfaces is dangerous and will expose the 翻译一下大概就是注意:如果redis直接暴露在互联网,绑定所有接口是非常危险的,因此我们没有注释下面的绑定指令 # instance to everybody on the internet. So by default we uncomment the bind 127.0.0.1 这个相当于只绑定在服务端本地,也就是说只能在服务端连接redis,进行操作 # following bind directive, that will force Redis to listen only into # the IPv4 lookback interface address (this means Redis will be able to # accept connections only from clients running into the same computer it # is running). # # IF YOU ARE SURE YOU WANT YOUR INSTANCE TO LISTEN TO ALL THE INTERFACES 如果你想要开放所有ip接口,注释下面这行 # JUST COMMENT THE FOLLOWING LINE. # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #bind 127.0.0.1 就直接注释bind 127.0.0.1,重启一下让配置生效,再进行远程连接就ok了。
重启可以连接成功,下面的可以不用看了。 ································································································································· 接下来大概率就是防火墙没有打开6379的端口,进入shell工具查看Linux系统虚拟机的IP地址 ifconfig可以看到VM虚拟机的IP
inte 后面的就是IP地址,这时候打开win+R输入cmd命令,通过telnet命令,测试端口是否畅通。如果连接失败,表示CentOS的6379端口没有开启。 开启端口成功之后再用cmd命令重复上述telnet命令一遍,出现小黑框闪烁一下说明连接没有问题。 最后开启redis desktop manager(可视化工具),auth为redis密码,可以设置,也可以不设置,但是提个醒在云服务器上安装redis最好设置密码,设置密码和绑定ip,二选一即可,否则redis处于保护模式,只能本虚拟机访问
|
今日新闻 |
推荐新闻 |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |