将Azure Redis缓存与Node.js一起使用(对于Hubot的大脑)?

时间:2016-09-23 10:09:46

标签: azure redis node-redis hubot azure-redis-cache

我正在尝试使用Azure Redis缓存作为我的Hubot大脑的存储空间。

我按照说明here配置了Redis大脑。我还尝试了SSL和未加密的连接,因为我读到here Redis Node客户端不支持SSL。

我还将hubot-redis-brain中的Redis客户端从0.8.4更新为2.6.2,但我的Hubot仍然无法连接到Redis。

以下是Azure中端口配置的屏幕截图:

enter image description here

这是我的Hubot开始时的输出:

[Fri Sep 23 2016 09:00:14 GMT+0100 (GMT Daylight Time)] INFO hubot-redis-brain: Discovered redis from REDISTOGO_URL environment variable
node_redis: Deprecated: The AUTH command contains a "undefined" argument.
This is converted to a "undefined" string now and will return an error from v.3.0 on.
Please handle this in your code to make sure everything works as you intended it to.
[Fri Sep 23 2016 09:00:21 GMT+0100 (GMT Daylight Time)] ERROR hubot-redis-brain: Failed to authenticate to Redis
[Fri Sep 23 2016 09:00:21 GMT+0100 (GMT Daylight Time)] ERROR ReplyError: Ready check failed: NOAUTH Authentication required.
  at parseError (C:\projects\hubot-tryout\node_modules\redis-parser\lib\parser.js:163:12)
  at parseType (C:\projects\hubot-tryout\node_modules\redis-parser\lib\parser.js:224:14)

对此的任何帮助都将非常感激。

更新

这是我用来连接未加密的代码:

client = Redis.createClient("6379", "my-host.redis.cache.windows.net" , { auth_pass: "access-key" } )

这是加密连接:

client = Redis.createClient("6380", "my-host.redis.cache.windows.net" , { auth_pass: "access-key" } ), tls: {servername: 'my-host.redis.cache.windows.net'} }) 

1 个答案:

答案 0 :(得分:0)

我会尝试对密码进行URL编码。我想知道您是否遇到了使用Azure Redis for PHP Session ...

所描述的相同问题

https://azure.microsoft.com/en-us/documentation/articles/cache-faq/#can-i-use-azure-redis-cache-as-a-php-session-cache