Skip to content

Instantly share code, notes, and snippets.

@alekc
Created April 14, 2016 12:37
Show Gist options
  • Save alekc/3a71b21954cf25c3624a9c80dd72dfba to your computer and use it in GitHub Desktop.
Save alekc/3a71b21954cf25c3624a9c80dd72dfba to your computer and use it in GitHub Desktop.
Installation of carbon relay ng
# Installing carbon-relay-ng requirements
go get -d github.com/graphite-ng/carbon-relay-ng
go get github.com/jteeuwen/go-bindata/...
# Build and install carbon
cd /root/.gvm/pkgsets/go1.6.1/global/src/github.com/graphite-ng/carbon-relay-ng
mv carbon-relay-ng /usr/local/bin/
mkdir -p /etc/carbon-relay-ng/
cp carbon-relay-ng.ini /etc/carbon-relay-ng/
# change your config file
mkdir /var/spool/carbon-relay-ng/
vi /etc/carbon-relay-ng/carbon-relay-ng.ini
#change
spool_dir = "/var/spool/carbon-relay-ng"
pid_file = "/var/run/carbon-relay-ng.pid"
# Check if carbon-relay-ng can run (you should not see any errors)
carbon-relay-ng /etc/carbon-relay-ng/carbon-relay-ng.ini
# Create systemd
echo "CONFIG_FILE=/etc/carbon-relay-ng/carbon-relay-ng.ini" > /etc/default/carbon-relay-ng
vi /etc/systemd/system/carbon-relay-ng.service
[Unit]
Description=Carbon service control supervisor
[Service]
EnvironmentFile=-/etc/default/carbon-relay-ng
ExecStart="/usr/local/bin/carbon-relay-ng $CONFIG_FILE"
KillMode=process
Restart=on-failure
RestartSec=1min
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment