mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-04-27 03:00:12 -04:00
Install and configure mcrouter.
This commit is contained in:
@@ -197,6 +197,7 @@ make
|
||||
optipng
|
||||
jpegoptim
|
||||
|
||||
mcrouter
|
||||
memcached
|
||||
postgresql
|
||||
postgresql-client
|
||||
@@ -294,6 +295,50 @@ fi
|
||||
|
||||
sudo -u postgres psql reddit < $REDDIT_HOME/src/reddit/sql/functions.sql
|
||||
|
||||
###############################################################################
|
||||
# Configure mcrouter
|
||||
###############################################################################
|
||||
if [ ! -d /etc/mcrouter ]; then
|
||||
mkdir -p /etc/mcrouter
|
||||
fi
|
||||
|
||||
if [ ! -f /etc/mcrouter/global.conf ]; then
|
||||
cat > /etc/mcrouter/global.conf <<MCROUTER
|
||||
{
|
||||
// route all valid prefixes to the local memcached
|
||||
"pools": {
|
||||
"local": {
|
||||
"servers": [
|
||||
"127.0.0.1:11211",
|
||||
],
|
||||
"protocol": "ascii",
|
||||
"keep_routing_prefix": false,
|
||||
},
|
||||
},
|
||||
"route": {
|
||||
"type": "PrefixSelectorRoute",
|
||||
"policies": {
|
||||
"rend:": {
|
||||
"type": "PoolRoute",
|
||||
"pool": "local",
|
||||
},
|
||||
"page:": {
|
||||
"type": "PoolRoute",
|
||||
"pool": "local",
|
||||
},
|
||||
"pane:": {
|
||||
"type": "PoolRoute",
|
||||
"pool": "local",
|
||||
},
|
||||
},
|
||||
"wildcard": {
|
||||
"type": "NullRoute",
|
||||
},
|
||||
},
|
||||
}
|
||||
MCROUTER
|
||||
fi
|
||||
|
||||
###############################################################################
|
||||
# Configure RabbitMQ
|
||||
###############################################################################
|
||||
|
||||
14
upstart/reddit-mcrouter-global.conf
Normal file
14
upstart/reddit-mcrouter-global.conf
Normal file
@@ -0,0 +1,14 @@
|
||||
description "Memcache protocol router for scaling Memcached deployments."
|
||||
|
||||
start on networking or starting reddit-paster
|
||||
stop on runlevel [!2345]
|
||||
|
||||
respawn
|
||||
respawn limit 10 5
|
||||
|
||||
setuid Debian-mcrouter
|
||||
setgid Debian-mcrouter
|
||||
|
||||
script
|
||||
exec /usr/bin/mcrouter -f /etc/mcrouter/global.conf -R /././ -p 5050 --stats-root=/var/mcrouter/stats
|
||||
end script
|
||||
Reference in New Issue
Block a user