无法连接到托管 redis:就绪检查失败:不允许 ERR 操作 [英] Failing to connect to hosted redis: Ready check failed: ERR operation not permitted

查看:64
本文介绍了无法连接到托管 redis:就绪检查失败:不允许 ERR 操作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试连接到我通过 Nodejitsu 配置的 IrisCouch 上的托管 redis.

I'm trying to connect to a hosted redis on IrisCouch that I provisioned via Nodejitsu.

认为是我的 server.js 的相关部分:

What I think are the relevant parts of my server.js :

var redisUrl = require('url').parse(config.REDIS_CONNECTION_URI);
var client = require('redis').createClient(redisUrl.port, redisUrl.hostname);

我还没有在我的 server.js 中与客户端进行任何交互,这就是为什么我认为它抛出不允许的操作"很奇怪,因为基本上我唯一的操作做的是连接.我没有 redis.conf 文件,我相信我不需要,因为我自己没有托管 redis 实例.

I don't have any interaction with the client in my server.js yet, which is why I think it's weird that it's throwing the "operation not permitted", since basicly the only operation I do is to connect. I don't have a redis.conf file and I believe I shouldn't need one since I do not host the redis instance myself.

日志:

 Express server listening on port 3000

/Users/soroushhakami/dev/projects/projectx/node_modules/redis/index.js:504
                throw callback_err;
                      ^
Error: Ready check failed: ERR operation not permitted
    at RedisClient.on_info_cmd (/Users/soroushhakami/dev/projects/projectx/node_modules/redis/index.js:317:35)
    at Command.RedisClient.ready_check.send_anyway [as callback] (/Users/soroushhakami/dev/projects/projectx/node_modules/redis/index.js:365:14)
    at RedisClient.return_error (/Users/soroushhakami/dev/projects/projectx/node_modules/redis/index.js:500:25)
    at ReplyParser.RedisClient.init_parser (/Users/soroushhakami/dev/projects/projectx/node_modules/redis/index.js:260:14)
    at ReplyParser.EventEmitter.emit (events.js:96:17)
    at ReplyParser.send_error (/Users/soroushhakami/dev/projects/projectx/node_modules/redis/lib/parser/javascript.js:293:10)
    at ReplyParser.execute (/Users/soroushhakami/dev/projects/projectx/node_modules/redis/lib/parser/javascript.js:176:22)
    at RedisClient.on_data (/Users/soroushhakami/dev/projects/projectx/node_modules/redis/index.js:476:27)
    at Socket.<anonymous> (/Users/soroushhakami/dev/projects/projectx/node_modules/redis/index.js:79:14)
    at Socket.EventEmitter.emit (events.js:96:17)

关于可能是什么问题的任何想法?

Any ideas on what could be the problem?

推荐答案

创建客户端后需要直接调用client.auth():

You need to call client.auth() directly after creating the client:

var client = require('redis').createClient(redisUrl.port, redisUrl.hostname);
client.auth(PASSWORD);

令人困惑的是,当您不在 client 上调用 .auth() 但也没有其他任何事情 时,您将得到一个未通过就绪检查错误.

The confusing thing is that when you don't call .auth() on client but nothing else either, you will get a failed ready check error.

这篇关于无法连接到托管 redis:就绪检查失败:不允许 ERR 操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆