Created
November 5, 2012 16:37
-
-
Save solar/4018177 to your computer and use it in GitHub Desktop.
install memcached from source with supervisord
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
version="1.4.15" | |
priority="10415" | |
libevent="/usr/local/libevent/2.0.20-stable/" | |
supervisordir="/etc/supervisord.d" | |
# create user | |
sudo groupadd memcached | |
sudo useradd -r -g memcached -s /sbin/nologin -M -d /var/run/memcached memcached | |
# download and install | |
curl -sL http://memcached.googlecode.com/files/memcached-${version}.tar.gz | tar zx | |
cd memcached-${version}/ | |
ll | |
./configure --prefix=/usr/local/memcached/${version} --enable-64bit --with-libevent=${libevent} | |
make | |
sudo make install | |
cd ../ | |
sudo alternatives --install /usr/local/bin/memcached memcached /usr/local/memcached/${version}/bin/memcached ${priority} | |
sudo cp ./memcached.ini $supervisordir/memcached.ini | |
sudo supervisorctl reread | |
sudo supervisorctl add memcached |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[program:memcached] | |
command=/usr/local/bin/memcached -p 11211 -u memcached -m 256 -c 1024 -t 4 | |
autostart=true | |
autorestart=true | |
user=root | |
priority=100 | |
redirect_stderr=true | |
stdout_logfile=/var/log/memcached/stdout.log |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment