1

我在节点 js 服务器中为我的新应用程序使用 Node-Memcached npm。在这段时间里,只有当我连接并从 memcache 获取数据时才会收到错误消息。请帮我解决这个..

错误:连接在获取聊天数据时未提供服务器

我的内存缓存连接和获取语法是:

chatmemcached   = require('memcached'); 
memcache = new chatmemcached(dbconfig['memcachehost'][server]+":"+dbconfig['memcacheport']);
memcache.get("chat_"+userid, function (err,result) {
     if(err) {
         console.log("Error : "+err+" at get the chat data"); 
     } else {
         process the result;
     }
     memcache.end();
});

提前致谢。

塞尔瓦

4

1 回答 1

0

你配置安装的memcached。如果没有,您需要编辑 /etc/memcached.conf 以将“-l”参数设置为服务器的正确 IP 地址。对端口的“-p”参数执行相同的操作。

于 2013-10-23T13:42:49.877 回答