【问题标题】:Redis-node : Ready check failed: NOAUTH Authentication requiredRedis-node:就绪检查失败:需要 NOAUTH 身份验证
【发布时间】:2017-07-13 16:02:48
【问题描述】:

从数字海洋指南安装 redis 后,我在 npm 上使用 redis 包,我使用他们帖子的 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 吗?

【问题讨论】:

    标签: node.js security redis


    【解决方案1】:

    我也有同样的问题,网上没找到解决办法。

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

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

    而且效果很好。

    【讨论】:

      猜你喜欢
      • 2018-01-22
      • 1970-01-01
      • 1970-01-01
      • 2017-07-17
      • 2017-02-18
      • 2019-06-11
      • 2020-02-22
      • 2016-01-19
      • 1970-01-01
      相关资源
      最近更新 更多