navin kumar
navin kumar

Reputation: 191

how to find which memcached server store which key-value pair

I am using two memcached server currently and storing the key value pair as above.after this I am not able to find out which server store which key-value pair...

I know that memcached distributed randomly .

If I remove one server and then I try to fetch all value as above

I will get half of the value null.

Is there any way I can find the which key-value pair is on which server.

please help

Upvotes: 0

Views: 543

Answers (1)

mikewied
mikewied

Reputation: 5333

The keys aren't distributed randomly they are hashed to a particular server and all of this is done by the client. In order to figure out which server they are going to you will need to figure out what the hash function is that your client is using. That will ultimately tell you which server a key is going to. Note that this process is totally up to the client and that memcached has no knowledge of other memcached servers.

Upvotes: 1

Related Questions