在Node.js中使用Azure Redis缓存(对于Hubot的大脑)?

问题描述:

我试图使用Azure Redis Cache作为我Hubot大脑的存储。在Node.js中使用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) 

任何帮助将不胜感激。

UPDATE

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

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'} }) 

我会尝试编码网址密码。我想知道,如果你正在运行到此处介绍使用Azure的Redis的PHP的会话同样的问题...

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

+0

感谢乔恩。我试着用'encodeURIComponent()'编码密码,但现在我得到一个'ERROR ReplyError:ERR invalid password'错误。 –

+0

从我们的内部测试看来,使用'{auth_pass:“访问键”}'方法时,它看起来像URL编码**不是必需**。 URL编码只是密码** IS是必需**当使用''redis://[email protected]:6379“'方法 – JonCole

+0

感谢Jon。你有没有在香草节点应用程序和Hubot工作? –