3

我正在尝试将 node.js 快速会话存储在 Azure 缓存中。

在这篇文章http://blogs.msdn.com/b/silverlining/archive/2013/01/03/november-updates-to-windows-azure-powershell-cmdlets之后,我们已经在工作角色上设置了专用缓存。 aspx

Add-AzureCacheWorkerRole mycacherole

Enable-AzureMemcacheRole mywebrole mycacherole

在示例中,他们使用 mc 模块

您能帮我了解如何使用该模块将快速会话存储在 azure 缓存上吗?

我还尝试了 connect-memcached https://github.com/balor/connect-memcached作为 AzureCache:

MemcachedStore = require('connect-memcached')(express);

app.use(express.session({ 
     secret: 'CatOnTheKeyboard', 
     store: new MemcachedStore 
 }));

我们得到了这个跟踪的错误。是否可以快速将会话存储在 azureCache 上?感谢您的帮助。

TypeError: Cannot call method 'reverse' of null
    at Client.connect
(E:\approot\node_modules\connect-memcached\node_modules\memcached\lib\memcached.js:129:42)
    at Client.memcachedCommand [as command]
(E:\approot\node_modules\connect-memcached\node_modules\memcached\lib\memcached.js:299:10)
    at Client.get
(E:\approot\node_modules\connect-memcached\node_modules\memcached\lib\memcached.js:794:10)
    at MemcachedStore.get
(E:\approot\node_modules\connect-memcached\lib\connect-memcached.js:82:19)
    at Object.session [as handle]
(E:\approot\node_modules\connect\lib\middleware\session.js:309:11)
    at next (E:\approot\node_modules\connect\lib\proto.js:190:15)
    at Object.cookieParser [as handle]
(E:\approot\node_modules\connect\lib\middleware\cookieParser.js:60:5)
    at next (E:\approot\node_modules\connect\lib\proto.js:190:15)
    at Object.handle
(E:\approot\node_modules\express-validator\lib\express_validator.js:148:10)
    at next (E:\approot\node_modules\connect\lib\proto.js:190:15)
4

0 回答 0