Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bobrik/ralph
Ralph is a service discovery for twemproxy on mesos
https://github.com/bobrik/ralph
Last synced: 2 months ago
JSON representation
Ralph is a service discovery for twemproxy on mesos
- Host: GitHub
- URL: https://github.com/bobrik/ralph
- Owner: bobrik
- Created: 2015-03-01T14:01:21.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-03-01T16:07:12.000Z (over 9 years ago)
- Last Synced: 2024-04-14T15:52:54.806Z (2 months ago)
- Language: Go
- Size: 125 KB
- Stars: 24
- Watchers: 4
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Lists
- awesome-mesos - Ralph
README
# Ralph
Ralph is a service discovery for twemproxy on mesos. It allows you to run
elastic clusters of memcached and redis and change cluster sizes on
the fly without service interruption and with minimum cache loss.## Running
Ralph uses [marathoner](https://github.com/bobrik/marathoner) to update
twemproxy configuration. You have to run marathoner updaters to use ralph.Ralph is distributed as docker container, to run it:
```
docker run -d --net host --name ralph bobrik/ralph \
-u marathoner-updater1:7676,marathoner-updater2:7676 -b 127.0.0.1 \
-a '-a 0.0.0.0 -s 22222 -i 2000'
```This would run ralph with two updaters. Ralph would publish
twemproxy pools on `127.0.0.1`. Twemproxy would publish stats
on `0.0.0.0:22222`.Ralph is pretty lightweight to run it on every node.
## Adding pools
Your pools are managed by [marathon](https://mesosphere.github.io/marathon/),
here is an example of a pool:```json
{
"app": {
"id": "/twemproxy/one",
"cmd": "exec redis-server --port $PORT",
"instances": 2,
"cpus": 0.1,
"mem": 128,
"ports": [
12334
],
"container": {
"type": "DOCKER",
"volumes": [],
"docker": {
"image": "redis:2.8"
}
},
"healthChecks": [
{
"path": "/",
"protocol": "TCP",
"portIndex": 0,
"gracePeriodSeconds": 15,
"intervalSeconds": 2,
"timeoutSeconds": 5,
"maxConsecutiveFailures": 3
}
],
"labels": {
"twemproxy_pool": "redis_one",
"twemproxy_distribution": "ketama",
"twemproxy_hash": "fnv1a_64",
"twemproxy_server_failure_limit": "10",
"twemproxy_hash_tag": "{}",
"twemproxy_timeout": "500",
"twemproxy_server_retry_timeout": "8000",
"twemproxy_redis": "true",
"twemproxy_auto_eject_hosts": "true"
}
}
}
```To expose your application with a bunch of redis or memcached servers as
twemproxy pool, you need to use application labels. To set configuration
value for your pool, just add prefix `twemproxy_` to the config key
from [twemproxy configuration](https://github.com/twitter/twemproxy#configuration)
and set it as application label. You should also set `twemproxy_pool`,
otherwise your pool will be ignored.