Skip to content

Instantly share code, notes, and snippets.

@nrocine
Last active January 2, 2016 10:19
Show Gist options
  • Save nrocine/8289326 to your computer and use it in GitHub Desktop.
Save nrocine/8289326 to your computer and use it in GitHub Desktop.
Installation of graphite-ng on OS X (10.9.1)
https://github.com/graphite-ng/graphite-ng Does not include sufficient installation information, so the below is the steps I followed to get the graphite-ng working (or appearing to work)
I first installed golang following the instructions for OS X tarball install http://golang.org/doc/install
golang expects workspaces to have a directory structure like
graphite-ng/
-src/
-pkg/
-bin/
All source code (github repos) live in src/ and the `go install` command generates binaries
Update .bash_profile to include /usr/local/go/bin in $PATH
Update .bash_profile to include these (substitute /Users/nils/tools/graphite-ng for where your graphite-ng root directory lives):
# Go / graphite-ng related
export GOPATH=/Users/nils/tools/graphite-ng
PATH=$PATH:$GOPATH/bin
(don't forget to use a new shell after updating bash_profile)
Now install graphite-ng (you may have already created the graphite-ng root directory)
mkdir graphite-ng
cd graphite-ng/
mkdir bin pkg src
git clone https://github.com/graphite-ng/graphite-ng.git src/github.com/graphite-ng/graphite-ng
cd src/github.com/
mkdir mattbaird
cd mattbaird/
git clone --recursive https://github.com/mattbaird/elastigo.git
mkdir src/github.com/stvp
cd src/github.com/stvp
git clone --recursive http://github.com/stvp/go-toml-config
mkdir src/github.com/pelletier
cd src/github.com/pelletier
git clone http://github.com/pelletier/go-toml
rm -f executor-*.go ; go install github.com/graphite-ng/graphite-ng && graphite-ng
If this succeeds you should be able to run
graphite-ng
I found that just running graphite-ng and hitting the demo URL (see below) failed to find the file `executor.go.tpl`
http://localhost:8080/render/?target=stats.web2&target=derivative(stats.web2)
Running graphite-ng from ~/tools/graphite-ng/src/github.com/graphite-ng/graphite-ng/ resolved the above issue and allowed me to get JSON response from http://localhost:8080/render/?target=stats.web2&target=derivative(stats.web2)
$ tree -L 4
.
├── bin
│   └── graphite-ng
├── pkg
│   └── darwin_amd64
│   └── github.com
│   ├── graphite-ng
│   ├── mattbaird
│   ├── pelletier
│   └── stvp
└── src
└── github.com
├── graphite-ng
│   └── graphite-ng
├── mattbaird
│   └── elastigo
├── pelletier
│   └── go-toml
└── stvp
└── go-toml-config
18 directories, 1 file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment