gpt4 book ai didi

node.js - Redis Node : Ready check failed: NOAUTH Authentication required

转载 作者:可可西里 更新时间:2023-11-01 11:29:17 25 4
gpt4 key购买 nike

我正在使用 redis从 digital ocean 指南安装 redis 后在 npm 上打包 我使用 one 保护它他们的职位。我将 requirepass 设置为密码,然后登录到我的 redis-cli 并成功验证了自己。但是我无法从我的 Node.js 应用程序中执行相同的操作。

这是我在 Node 中的配置

client = redis.createClient({
no_ready_check: true,
host : 'ip address',
port : port
});
client.auth('secretPassword', function(err, doc){
if(err)
throw err;
else if(doc === "OK"){
console.log("Authenticated");
}
});
client.on('error' , function (err) {
console.log("Error");

});

在我运行它之后。我得到这个错误

events.js:160
throw er; // Unhandled 'error' event
^
ReplyError: Ready check failed: NOAUTH Authentication required.
at parseError (/home/ubuntu/demo/vehico-workers/node_modules/redis-parser/lib/parser.js:181:12)
at parseType (/home/ubuntu/demo/vehico-workers/node_modules/redis-parser/lib/parser.js:291:14)

根据我的猜测,node-redis 驱动程序没有正确实现它,因为我能够从 cli 而不是 Node 应用程序进行身份验证。有人在 AWS EC2 上成功运行过安全的 redis.conf 吗?

最佳答案

我也遇到了同样的问题,网上也没找到解决方法。

我在 setting.js 中将指令传递更改为密码

redis: { host: "192.168.x.xx", password: '******', port: 6379 },
storageModule: require("node-red-contrib-redis-storage"),

而且效果很好。

关于node.js - Redis Node : Ready check failed: NOAUTH Authentication required,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42411247/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com