RedisDesktopManager连接出错 Can’t connect to redis-server

396次阅读
没有评论

共计 725 个字符,预计需要花费 2 分钟才能阅读完成。

前言

阿里云服务器上安装了 redis,然后用 RedisDesktopManager 来连接远程服务器上的 redis 服务,一直报这个错误,但是我在服务器都可以使用命令进行操作,证明 reids 服务是正常的。

Snipaste_2019-05-09_15-09-03.png

首先,来分析下原因,

1.* 阿里云服务器,当设计到端口的时候,一定要配置安全组,进行开放端口 (注意两个地方都要开端口)

 解决:阿里云配置下 6379 端口的安全组就好了 

2.linux 中防火墙开放端口,这边也要开放下 6379 端口

 解决:(宝塔的话可以面板开)
    执行这行命令就可以了,firewall-cmd --zone=public --add-port=3306/tcp --permanent 

3、修改下 redis 的配置文件,redis.conf

把 bind 127.0.0.1 注释掉
请输入图片描述

protected-mode yes 把 yes 改为 no
请输入图片描述

4、进入到你安装的 redis 的 src 目录下,执行了这行命令,指定了启动的配置文件

 ./redis-server ../redis.conf

5、成功
请输入图片描述


centOS7 防火墙操作:

启动:systemctl start firewalld
关闭:systemctl stop firewalld
查看状态:systemctl status firewalld
开机禁用:systemctl disable firewalld
开机启用:systemctl enable firewalld

reids 的相关命令:

查看 redis 进程 ps aux | grep redis
查看所有端口 netstat -tlun
打开 redis 的客户端 ./redis-cli
退出 redis 的客户端 quit
关闭 redis 服务器 pkill redis-server
关闭 redis 服务器 ./redis-cli shutdown

正文完
 
alecctv
版权声明:本站原创文章,由 alecctv 2019-05-09发表,共计725字。
转载说明:除特殊说明外本站文章皆由ooly.cc发布,转载请注明出处。
评论(没有评论)
验证码