Skip to content

Instantly share code, notes, and snippets.

@csrutil
Forked from tkuchiki/install.sh
Created February 13, 2018 09:55
Show Gist options
  • Save csrutil/1a83cca17a283336094eb21d388215ff to your computer and use it in GitHub Desktop.
Save csrutil/1a83cca17a283336094eb21d388215ff to your computer and use it in GitHub Desktop.
nutcracker(twemproxy) for systemd
curl -L "https://drive.google.com/uc?id=0B6pVMMV5F5dfb1YwcThnaVZXbjg" -o nutcracker-0.4.1.tar.gz
tar zxf nutcracker-0.4.1.tar.gz
cd nutcracker-0.4.1
./configure --prefix=/usr
make
make install
mkdir /etc/nutcracker
cp conf/nutcracker.yml /etc/nutcracker
cat << 'EOC' > /lib/systemd/system/nutcracker.service
[Unit]
Description=nutcracker - High performance proxy server for memcached/redis
After=network.target
[Service]
Type=simple
ExecStartPre=/usr/sbin/nutcracker -t -c /etc/nutcracker/nutcracker.yml
ExecStart=/usr/sbin/nutcracker -c /etc/nutcracker/nutcracker.yml
ExecReload=/bin/kill -HUP $MAINPID
[Install]
WantedBy=multi-user.target
EOC
systemctl enable nutcracker.service
systemctl start nutcracker.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment