keepwalking
keepwalking

Reputation: 2654

NodeJS Memcached - Use multiple servers

How can i add multiple memcache server in nodejs?

Like i do in php:

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

Thanks Radu

Upvotes: 0

Views: 1331

Answers (2)

Rob Raisch
Rob Raisch

Reputation: 17367

3rd-Eden's node-memcached (https://github.com/3rd-Eden/node-memcached) which you appear to have installed supports multiple servers in its constructor which can accept (among others) an array of strings formatted as "host:port". As is always good advice, "Read The Fascinating Manual".

Upvotes: 1

Nick Mitchinson
Nick Mitchinson

Reputation: 5480

The library installed when you npm install memcached seems to be node-memcached.

Adding multiple memcached servers is explained in the documentation, specifically here.

Upvotes: 2

Related Questions