redis 远程连接时报错: 
Exception in thread "main" redis.clients.jedis.exceptions.JedisConnectionException: java.net.ConnectException: Connection refused: connect 

(redis 安装在ubuntu 系统)

 
- 1.首先,我们要把防火墙禁用掉
- 2.安装redis时,Redis 的配置文件默认是绑定本地ip的,所以我们要去系统中找到bind 127.0.0.1,
然后把它注释掉,那么就可以连接上了
- 3.下面是redis.conf配置文件,看到bind 127.0.0.1吗?就是他,搞我们连接不上,注释掉吧

# Redis configuration file example

# Note on units: when memory size is needed, it is possible to specifiy
# it in the usual form of 1k 5GB 4M and so forth:
#
# 1k => 1000 bytes
# 1kb => 1024 bytes
# 1m => 1000000 bytes
# 1mb => 1024*1024 bytes
# 1g => 1000000000 bytes
# 1gb => 1024*1024*1024 bytes
#
# units are case insensitive so 1GB 1Gb 1gB are all the same. # By default Redis does not run as a daemon. Use yes if you need it.
# Note that Redis will write a pid file in /var/run/redis.pid when daemonized.
daemonize yes # When running daemonized, Redis writes a pid file in /var/run/redis.pid by
# default. You can specify a custom pid file location here.
pidfile /var/run/redis/redis-server.pid # Accept connections on the specified port, default is 6379.
# If port 0 is specified Redis will not listen on a TCP socket.
port 6379 # If you want you can bind a single interface, if the bind option is not
# specified all the interfaces will listen for incoming connections.
#
bind 127.0.0.1 # Specify the path for the unix socket that will be used to listen for
# incoming connections. There is no default, so Redis will not listen
# on a unix socket when not specified.
#
# unixsocket /var/run/redis/redis.sock

- 4.注释后,再重启redis服务器 sudo /etc/init.d/redis-server restart (不重启,你修改的配置不会生效)

 

redis Connection refused 远程连接错误的更多相关文章

  1. SQLsever2008 远程连接错误 linq

    如果你也和我一样远程连接一个sqlsever2008数据时出现类似错误 SqlException (0x80131904): 用户 ‘xxxxx' 登录失败. 首先在“服务器资源管理器”中测试一下你的 ...

  2. redis安装以及远程连接

    第一步下载: Window 下安装 下载地址:https://github.com/MSOpenTech/redis/releases. 第二步: 运行安装 记录安装路径 C:\Program Fil ...

  3. 解决ssh远程连接错误问题

    使用 Xshell 远程连接服务器时,经常会出现这么个错误提示 WARNING! The remote SSH server rejected X11 forwarding request. ➜ ~ ...

  4. 用 Redis Desktop Manager 远程连接 redis 数据库。

    环境: 本机OS:window 10(本机没有安装redis) redis 服务器:centos 7 使用 Redis Desktop Manager 工具远程连接 redis. Redis Desk ...

  5. 阿里云服务器远程连接错误:由于一个协议错误(代码:0x112f),远程会话将被中断。

    2019年10月,阿里云服务器远程连接忽然无法登录.当时正在清理c盘空间,C盘只剩下30+M,忽然远程桌面掉线,以为断网了,再次远程桌面连接时,就出现一下错误. 解决方案:万能的重启!!!具体错误原因 ...

  6. 阿里云Centos 7.6安装Redis以及开启远程连接

    下载地址:http://redis.io/download,下载最新稳定版本. 本教程使用的最新文档版本为 5.0.5,下载并安装: $ wget http://download.redis.io/r ...

  7. 配置redis服务器允许远程连接

    说明 默认情况下,redis只允许本机访问.如果需要外部访问,需要修改下配置文件. 配置修改 redis.windows.conf 将bind 127.0.0.1 注释 将protected-mode ...

  8. MySQL远程连接错误解决

    远程连接服务器的MySQL数据库,错误代码是1130,是由于无法给远程连接的用户权限的问题 解决方法: 本机登陆mysql后,将mysql数据库中的user表中的host项,从localhost改为% ...

  9. centos解决bash: telnet: command not found...&& telnet: connect to address 127.0.0.1: Connection refused拒绝连接

    检查telnet是否已安装: [root@hostuser src]# rpm -q telnet-serverpackage telnet-server is not installed[root@ ...

随机推荐

  1. JS——数组、==和===的区别

    创建数组的方式: 1) <script type='text/javascript'> var aRr = new Array(1,2,3,4,'abc',3) </script&g ...

  2. leetcode 91. 解码方法

    题目描述: 一条包含字母 A-Z 的消息通过以下方式进行了编码: 'A' -> 1 'B' -> 2 ... 'Z' -> 26 给定一个只包含数字的非空字符串,请计算解码方法的总数 ...

  3. git commit之后撤销

    先git log 查看日志,找到需要回退的那次commit的哈希值 然后git reset --soft commit_id ok

  4. ST的MCU系列

    一 STM32F1(M3)系列: 超值型系列STM32F100-  24 MHz最高主频 带马达控制和CEC功能 基本型系列STM32F101 - 36 MHz最高主频,具有高达1M字节的片上闪存 U ...

  5. CentOS6.5安装配置详解

    1. 环境要求 VMWare软件: CentOS6.5对应的iso镜像文件(位数对应个人计算机位数). 2. 安装步骤 打开VMWare,文件->新建虚拟机(以下几步默认跳过即可) 命名和选择安 ...

  6. 关于小程序后台post不到数据的问题

    小程序post请求获取不到数据问题 把headers的参数“Content-Type”的值改为application/x-www-form-urlencoded: Request Body Type ...

  7. KBEngine warring项目源码阅读(二) 登录和baseapp的负载均衡

    原本不打算把登录拿出来写的,但是阅读登录部分的代码的时候发现登录和注册还不太一回事,因为登录涉及到分配baseapp的ip,负载均衡的实现,所以水一下. 流程图: 和上次一样,先是找unity控件 找 ...

  8. 零基础逆向工程26_C++_03_Vector

    1 Vector 核心代码 #define SUCCESS 1 // 成功 #define ERROR -1 // 失败 #define MALLOC_ERROR -2 // 申请内存失败 #defi ...

  9. /usr/local/sbin/dsniff

    /usr/local/sbin/dsniff 捕获可用的密码

  10. PagedList.Mvc只有一行时不显示分页

    PagedList.Mvc默认总是显示分页,可以通过设置DisplayMode在只有一行时不显示分页 @Html.PagedListPager(Model, page => Url.Action ...