Comments (11)
Hello @jeffbyrnes,
Do you still need help with it? Did you manage to setup runit?
Thanks
from mcrouter.
Would love some help. Writing an upstart script, actually, since I'm using Ubuntu 14.04. I'll post my script once I get to my desk.
from mcrouter.
@andreazevedo ok, here's what I have right now:
# mcrouter - memcached protocol router
#
# mcrouter is a memcached protocol router for
# scaling memcached deployments
description "memcached protocol router"
start on runlevel [2345]
stop on runlevel [2345]
expect daemon
setuid mcrouter
env PID_PATH="/var/run/"
script
PROG_ARGS="--async-dir=/mnt/mcrouter/spool"
PROG_ARGS="$PROG_ARGS --route-prefix=/dc1/all/"
PROG_ARGS="$PROG_ARGS --send-invalid-route-to-default"
PROG_ARGS="$PROG_ARGS --num-proxies=16"
PROG_ARGS="$PROG_ARGS --stats-root=/mnt/mcrouter/stats"
PROG_ARGS="$PROG_ARGS --log-path=/mnt/mcrouter/log/mcrouter.log"
PROG_ARGS="$PROG_ARGS --background"
PROG_ARGS="$PROG_ARGS --managed-mode"
PROG_ARGS="$PROG_ARGS --port=11211"
PROG_ARGS="$PROG_ARGS --config-file=/etc/mcrouter/mcrouter.json"
exec /usr/local/bin/mcrouter "$PROG_ARGS"
end script
which results in:
I0224 14:30:31.232331 22647 main.cpp:466] /usr/local/bin/mcrouter --async-dir=/mnt/mcrouter/spool --route-prefix=/dc1/all/ --send-invalid-route-to-default --num-proxies=16 --stats-root=/mnt/mcrouter/stats --log-path=/mnt/mcrouter/log/mcrouter.log --background --managed-mode --port=11211 --config-file=/etc/mcrouter/mcrouter.json
E0224 14:30:31.232633 22647 mcrouter_config.cpp:52] no configuration source
mcrouter 1.0
usage: /usr/local/bin/mcrouter [options] -p port(s) -f config
from mcrouter.
Hello @jeffbyrnes,
Did you try to run this generated command line (i.e. /usr/local/bin/mcrouter --async-dir=/mnt/mcrouter/spool --route-prefix=/dc1/all/ --send-invalid-route-to-default --num-proxies=16 --stats-root=/mnt/mcrouter/stats --log-path=/mnt/mcrouter/log/mcrouter.log --background --managed-mode --port=11211 --config-file=/etc/mcrouter/mcrouter.json
) yourself? What result do you get?
from mcrouter.
@andreazevedo yep, works great. Mcrouter kicks off and runs without issues. Apologies for not mentioning that earlier.
from mcrouter.
I'm most confused why it thinks there's “no configuration source”, when I’m clearly specifying one.
from mcrouter.
Damned bash… quoting works weirdly in this case. Removed the double quotes around $PROG_ARGS
in the exec
call and it works.
Full script:
# mcrouter - memcached protocol router
#
# mcrouter is a memcached protocol router for
# scaling memcached deployments
description "memcached protocol router"
start on runlevel [2345]
stop on runlevel [2345]
expect daemon
setuid mcrouter
env PID_PATH="/var/run/"
script
PROG_ARGS="--async-dir=/mnt/mcrouter/spool"
PROG_ARGS="$PROG_ARGS --route-prefix=/dc1/all/"
PROG_ARGS="$PROG_ARGS --send-invalid-route-to-default"
PROG_ARGS="$PROG_ARGS --num-proxies=16"
PROG_ARGS="$PROG_ARGS --stats-root=/mnt/mcrouter/stats"
PROG_ARGS="$PROG_ARGS --log-path=/mnt/mcrouter/log/mcrouter.log"
PROG_ARGS="$PROG_ARGS --background"
PROG_ARGS="$PROG_ARGS --managed-mode"
PROG_ARGS="$PROG_ARGS --port=11211"
PROG_ARGS="$PROG_ARGS --config-file=/etc/mcrouter/mcrouter.json"
exec /usr/local/bin/mcrouter $PROG_ARGS
end script
from mcrouter.
Closed this too soon… starts up properly now, but then Upstart loses track of mcrouter & isn't aware of status or how to stop mcrouter.
from mcrouter.
Ok, final version of said script. No longer using the background
or managed-mode
flags:
# mcrouter - memcached protocol router
#
# mcrouter is a memcached protocol router for
# scaling memcached deployments
description "memcached protocol router"
start on runlevel [2345]
stop on runlevel [2345]
respawn
setuid mcrouter
script
PROG_ARGS="--async-dir=/mnt/mcrouter/spool"
PROG_ARGS="$PROG_ARGS --route-prefix=/dc1/all/"
PROG_ARGS="$PROG_ARGS --send-invalid-route-to-default"
PROG_ARGS="$PROG_ARGS --num-proxies=16"
PROG_ARGS="$PROG_ARGS --pid-file=/var/run/mcrouter/mcrouter.pid"
PROG_ARGS="$PROG_ARGS --stats-root=/mnt/mcrouter/stats"
PROG_ARGS="$PROG_ARGS --log-path=/mnt/mcrouter/log/mcrouter.log"
PROG_ARGS="$PROG_ARGS --port=11211"
PROG_ARGS="$PROG_ARGS --config-file=/etc/mcrouter/mcrouter.json"
exec /usr/local/bin/mcrouter $PROG_ARGS
end script
This works solidly, starts & stops properly, and respawns the mcrouter process if it dies.
from mcrouter.
Hello @jeffbyrnes,
Great! One thing that I would suggest is the use of flavor files, so that you would be able to change your mcrouter configs without touching your script again! :)
Thanks!
from mcrouter.
@andreazevedo oh MAN! That is hugely helpful for writing a Chef cookbook. Being able to render out JSON files is way simpler than building a set of CLI flags. Thanks!
from mcrouter.
Related Issues (20)
- Simple replication model not working as expected HOT 1
- `mg` for WarmupRoute?
- CentOS 8 RPM/Build Support HOT 1
- Cannot build ubuntu20 docker file HOT 5
- Memcached server specification (TLS/SSL) documentation HOT 1
- Error to build docker image with docker file... HOT 1
- Last stable version
- Warmup related configuration incase we are running mcrouter and memcache on kubernetes
- Mcrouter adds MC_MSG_FLAG_BIG_VALUE flag but never removes it HOT 4
- AsyncSocketException: AsyncMcClient, type = Socket not open HOT 1
- unable to build new py3 thrift changes in upstream
- ubuntu 20.04 building issue HOT 1
- Failed to build on Ubuntu 22.04 HOT 1
- Addition of a pre-populated replica
- New Ubuntu package HOT 2
- Failed to build on ubuntu18.04
- How can I traverse a server in the pool? HOT 1
- Issues after memcached version upgrade
- does AllFastestRoute route consider miss as errors?
- folly build error
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mcrouter.