0

如何在 nodejs 中添加多个 memcache 服务器?

就像我在 php 中所做的那样:

$memcache = new Memcache;
$memcache->addServer('memcache_host', 11211);
$memcache->addServer('memcache_host2', 11211);

谢谢拉杜

4

2 回答 2

2

当您npm install memcached似乎是node-memcached时安装的库。

文档中解释了添加多个 memcached 服务器,特别是这里

于 2013-08-28T17:35:14.140 回答
1

您似乎已安装的 3rd-Eden 的 node-memcached ( https://github.com/3rd-Eden/node-memcached ) 在其构造函数中支持多个服务器,这些服务器可以接受(除其他外)格式为“主机”的字符串数组:港口”。一如既往的好建议,“阅读迷人的手册”。

于 2013-08-28T17:40:40.567 回答