Skip to content

Instantly share code, notes, and snippets.

@tkuchiki
Last active May 2, 2018 12:27
Show Gist options
  • Save tkuchiki/c6374ebc9c8f1801858493f2852c3e90 to your computer and use it in GitHub Desktop.
Save tkuchiki/c6374ebc9c8f1801858493f2852c3e90 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