You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -47,23 +47,23 @@ can work with it. You can either use:
47
47
48
48
1.**String**, this only works if you have are running a single server instance
49
49
of Memcached. It's as easy a suppling a string in the following format:
50
-
`hostname:port`. For example `192.168.0.102:11212` This would tell the client
51
-
to connect to host `192.168.0.102` on port number `11212`.
50
+
`hostname:port`. For example `192.168.0.102:11211` This would tell the client
51
+
to connect to host `192.168.0.102` on port number `11211`.
52
52
53
53
2.**Array**, if you are running a single server you would only have to supply
54
54
one item in the array. The array format is particularly useful if you are
55
55
running a cluster of Memcached servers. This will allow you to spread the keys
56
56
and load between the different servers. Giving you higher availability
57
57
when one of your Memcached servers goes down.
58
58
59
-
3.**Object**, when running a cluster of Memcached servers, some servers may allocate different amounts of memory, e.g. 128, 512, and 128mb. While by default all servers are equally important and dispatch consistently the keys between the servers (33/33/33%), it is possible to send more keys in servers having more memory. To do so, define an object whose `key` represents the server location and whose value represents a server weight, the default weight for a server being 1; so, for instance `{ '192.168.0.102:11212': 1, '192.168.0.103:11212': 2, '192.168.0.104:11212': 1 }` distributes 50% of the keys on server 103, but only 25% on 104 and 25% on 102.
59
+
3.**Object**, when running a cluster of Memcached servers, some servers may allocate different amounts of memory, e.g. 128, 512, and 128mb. While by default all servers are equally important and dispatch consistently the keys between the servers (33/33/33%), it is possible to send more keys in servers having more memory. To do so, define an object whose `key` represents the server location and whose value represents a server weight, the default weight for a server being 1; so, for instance `{ '192.168.0.102:11211': 1, '192.168.0.103:11211': 2, '192.168.0.104:11211': 1 }` distributes 50% of the keys on server 103, but only 25% on 104 and 25% on 102.
60
60
61
61
To implement one of the above formats, your constructor would look like this:
62
62
63
63
```js
64
-
var memcached =newMemcached({ '192.168.0.102:11212':1, '192.168.0.103:11212':2, '192.168.0.104:11212':1 });
65
-
var memcached =newMemcached([ '192.168.0.102:11212', '192.168.0.103:11212', '192.168.0.104:11212' ]);
66
-
var memcached =newMemcached('192.168.0.102:11212');
64
+
var memcached =newMemcached({ '192.168.0.102:11211':1, '192.168.0.103:11211':2, '192.168.0.104:11211':1 });
65
+
var memcached =newMemcached([ '192.168.0.102:11211', '192.168.0.103:11211', '192.168.0.104:11211' ]);
66
+
var memcached =newMemcached('192.168.0.102:11211');
67
67
```
68
68
69
69
### Options
@@ -91,7 +91,7 @@ Memcached server uses the same properties:
91
91
Example usage:
92
92
93
93
```js
94
-
var memcached =newMemcached('localhost:11212', {retries:10,retry:10000,remove:true,failOverServers:['192.168.0.103:11212']});
94
+
var memcached =newMemcached('localhost:11211', {retries:10,retry:10000,remove:true,failOverServers:['192.168.0.103:11211']});
95
95
```
96
96
97
97
If you wish to configure the options globally:
@@ -294,7 +294,7 @@ confirm the server_locations specification.
294
294
*`callback`: *Function*, The callback function that receives the net.Stre
0 commit comments