Skip to content

Instantly share code, notes, and snippets.

@tkuchiki
Last active October 6, 2016 05:56
Show Gist options
  • Save tkuchiki/d1ea819ebdb3375e26d6a8a3c9399c5d to your computer and use it in GitHub Desktop.
Save tkuchiki/d1ea819ebdb3375e26d6a8a3c9399c5d to your computer and use it in GitHub Desktop.
mcrouter の設定例

Consistent Hash による分散

https://github.com/facebook/mcrouter/wiki/Config-Files#representing-route-handles-in-json

{
   "pools": {
      "A": {
         "servers": [
           "192.168.1.11:11211",
           "192.168.1.12:11211"
         ]
      }
   },
   "route": {
     "type": "HashRoute",
     "children": "Pool|A"
   }
}

データのレプリケーション

https://github.com/facebook/mcrouter/wiki/Replicated-pools-setup

{
   "pools": {
      "A": {
         "servers": [
           "192.168.1.11:11211",
           "192.168.1.12:11211"
         ]
      }
   },
   "route": {
     "type": "OperationSelectorRoute",
     "operation_policies": {
       "add": "AllSyncRoute|Pool|A",
       "delete": "AllSyncRoute|Pool|A",
       "get": "LatestRoute|Pool|A",
       "set": "AllSyncRoute|Pool|A"
     }
   }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment