An example Graphite application built using the factorish toolkit.
This will spin up a CoreOS VM in vagrant and then proceed to build and deploy a graphite container and a statsd container. It will also launch and run a local docker registry to cache the containers and a registrator
container which helps with the service discovery.
It uses etcd and confd to automatically configure both graphite and statsd to talk to eachother.
The images are all cached on the host under registry/
you can clean it out by running ./clean_registry
on your host.
$ git https://github.com/factorish/factorish-graphite.git
$ cd factorish-graphite
$ vagrant up
rewriting userdata
Bringing machine 'core-01' up with 'virtualbox' provider...
==> core-01: Importing base box 'coreos-beta'...
==> core-01: Matching MAC address for NAT networking...
...
==> core-01: ++ echo Creating a Private Registry
==> core-01: Creating a Private Registry
...
$ vagrant ssh core-01
$ journalctl -f -u factorish-graphite
This will spin up the VM and watch for graphite to be built and started. Once the logs indicate that graphite is running you can CTRL-C
out of the logs and access graphite via http://localhost:8080
.
You can send test metrics to graphite via statsd by running:
$ echo "foo:1|c" | nc -u -w0 127.0.0.1 8125
If you get 500 - server error
when accessing graphite it may be in a weird state with the shitty mysqlite database. This can be fixed by killing apache in the container which will be restarted by supervisord and the race condition should clear up.
$ vagrant ssh core-01
$ graphite
$ ps aux | apache
$ kill $PID
These can all be run from inside the coreos VM.
kill_graphite
- kill and remove the graphite containerbuild_graphite
- rebuild the graphite containerrun_graphite
- run the graphite containergraphite
- get a shell prompt in the graphite containerkill_statsd
- kill and remove the statsd containerbuild_statsd
- rebuild the statsd containerrun_statsd
- run the statsd containerstatsd
- get a shell prompt in the statsd container
Paul Czarkowski (paul@paulcz.net)
Copyright 2015 Paul Czarkowski
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.