using mcrouter routes to access memcached

295 views
Skip to first unread message

George Chilumbu

unread,
Jan 28, 2018, 1:26:30 AM1/28/18
to memcached

We have two sets or pools of memcached, and would like to use mcrouter for scaling our memcached deployments as well as provide us with HA protection. Memcached hosts in each pool should have the same data.

I have setup 2 mcrouters to perform routes as well as HA protection just for testing purposes. The mcrouter config file on each mcrouter server looks like this:

 {
  "pools": {
    "memcache-event": {
      "servers": [
        "10.1.9.100:11211",
        "10.1.9.101:11211"
      ]
    },
    "memcache-notification": {
      "servers": [
        "10.1.9.200:11211",
        "10.1.9.201:11211"
      ]
    },
"route": {
     "type": "OperationSelectorRoute",
     "operation_policies": {
       //***routes for hosts in the event pool***
       "add": "AllSyncRoute|Pool|memcached-event",
       "delete": "AllSyncRoute|Pool|memcached-event",
       "get": "LatestRoute|Pool|memcached-event",
       "set": "AllSyncRoute|Pool|memcached-event"
       //***routes for hosts in the notification pool***
       "add": "AllSyncRoute|Pool|memcached-notification",
       "delete": "AllSyncRoute|Pool|memcached-notification",
       "get": "LatestRoute|Pool|memcached-notification",
       "set": "AllSyncRoute|Pool|memcached-notification"
   }
}

The mcouters are both up and running, and can telnet to a memcached host from an mcrouter server with a command like this for example:

telnet 10.1.9.100 11211

However, i would like to know 2 things:

  1. With my config above, how can i access a memcached server using the mcrouter routes? I am basically trying to see an example of how routes in mcrouter are used to access memcached.

  2. How can i check that my mcrouters are working as a cluster? How can i check that they are communicating?





dormando

unread,
Jan 30, 2018, 12:20:40 AM1/30/18
to memcached
> 1.
>
> With my config above, how can i access a memcached server using the mcrouter routes? I am basically trying to see an example of how routes in
> mcrouter are used to access memcached.

You configure a client to use the mcrouter as a server instead of directly
talking to the memcached's? I think that's what you're asking.

> 2.
>
> How can i check that my mcrouters are working as a cluster? How can i check that they are communicating?

They don't talk to each other. they only talk to the memcached's for each
pool.

George Chilumbu

unread,
Jan 30, 2018, 6:30:56 AM1/30/18
to memc...@googlegroups.com
Thanks for the response. So the mcrouters do not operate as a cluster, and hence do not communicate in any kind of way?

In the terminal, what command on the mcrouter can I use to test accessing memcached using the configured routes? I would like to see an example script to do this.

Sent from my iPhone
> --
>
> ---
> You received this message because you are subscribed to a topic in the Google Groups "memcached" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/memcached/oBmkFSoIEBI/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to memcached+...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

dormando

unread,
Jan 30, 2018, 9:15:43 PM1/30/18
to memc...@googlegroups.com
They do not communicate with each other, no.

Just run "get key" or "set key" and it should route. I don't actually know
enough about mcrouter to say more. you should stick with their
documentation or ask them.
> You received this message because you are subscribed to the Google Groups "memcached" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to memcached+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages