Sign inSign up

jamescarr/mcrouter-rest-api

By jamescarr

•Updated almost 11 years ago

A RESTful API interface to mcrouter

Image
0

546

jamescarr/mcrouter-rest-api repository overview

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

⁠Usage

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

172.17.0.2

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

172.17.0.3

$ 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":["172.17.0.2:11211", "172.17.0.3:11211"]}},"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

Tag summary

Content type

Image

Digest

sha256:809ebea29…

Size

158.5 MB

Last updated

almost 11 years ago

docker pull jamescarr/mcrouter-rest-api