Public | Automated Build

Last pushed: 2 years ago
Short Description
A RESTful API interface to mcrouter
Full Description

Provides a RESTful interface to modifying mcrouter configuration at runtime. Also exposes many of the special admin requests exposed mcrouter.


Some assumptions are made... it assumes you are running mcrouter via jamescarr/mcrouter and uses links and a shared volume to work with mcrouter.

Start up mcrouter

$ sudo docker run --name memcached0 -d -p 11211 sylvainlasnier/memcached
$ sudo docker run --name memcached1 -d -p 11211 sylvainlasnier/memcached
$ sudo docker inspect -f "{{.NetworkSettings.IPAddress}}" memcached0

$ sudo docker inspect -f "{{.NetworkSettings.IPAddress}}" memcached1

$ sudo docker run -d -p 5000:5000 jamescarr/mcrouter:1.0.0

Now startup the API

docker run  --link mcrouter:mcrouter -d -p 5002:5002 -e FLASK_PORT=5002 --volumes-from=mcrouter mcrouter-rest-api:1.0.0

Overwrite the configuration:

curl -X PUT  -H "Content-Type: application/json" -d '{"pools": {"A":{"servers":["", ""]}},"route":"PoolRoute|A"}' http://localhost:5002/config

API Reference

  • PUT /config - sets the configuration
  • GET /config - get the currently active configutation
  • GET /options - list options for the current running instance
  • GET /options/:option - get a single option
  • GET /route/key - compute which backends a key will be routed to
Docker Pull Command
Source Repository