Skip to content

Commit

Permalink
example: elk - simplified vagrant + readme update
Browse files Browse the repository at this point in the history
  • Loading branch information
ryane committed Sep 20, 2016
1 parent ff4a52d commit 86bb814
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 13 deletions.
14 changes: 6 additions & 8 deletions examples/elk/README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
# converge-elk

A Converge example that sets up a single node docker-based [ELK](https://www.elastic.co/webinars/introduction-elk-stack) stack.

[Filebeat](https://www.elastic.co/products/beats/filebeat) is used instead of [Logstash](https://www.elastic.co/products/logstash) for the log collection component.
The [ELK stack](https://www.elastic.co/webinars/introduction-elk-stack) is traditionally composed of [Elasticsearch](https://www.elastic.co/products/elasticsearch), [Logstash](https://www.elastic.co/products/logstash), and [Kibana](https://www.elastic.co/products/kibana) and is a great solution for collecting, searching, and visualizing logs. In this example, we are configuring a docker-based ELK stack. However, since this is a single-node demonstration, we are using [Filebeat](https://www.elastic.co/products/beats/filebeat) instead of Logstash for the log collection component.

## Usage

### Vagrant

In the [Vagrantfile](./Vagrantfile), change the file provisioner source to point to a version of the converge binary built with the `linux/amd64` OS architecture.

After running `vagrant up`, you should have a working [Kibana](https://www.elastic.co/products/kibana) instance backed by [Elasticsearch](https://www.elastic.co/products/elasticsearch). Filebeat is installed on the Vagrant host and is configured to send logs to Elasticsearch.
Just run `vagrant up`!

After Vagrant provisioning is complete, you should be able to access the Kibana web interface at [http://localhost:5601](http://localhost:5601).
After Vagrant provisioning completes, you should have a working Kibana instance backed by Elasticsearch. Filebeat is installed on the Vagrant host and is configured to send logs to Elasticsearch. You should be able to access the Kibana web interface at [http://localhost:5601](http://localhost:5601).

### Terraform (AWS)

Expand All @@ -31,14 +27,16 @@ You must have also set valid [AWS credentials](https://www.terraform.io/docs/pro
terraform apply
```

After provisioning completes, you should be able to access the url for the Kibana interface by running:
After provisioning completes, you should be able to retrieve the url for the Kibana interface by running:

```shell
echo "http://$(terraform output ip):5601/"
```

## Graphs

This is the visualization of the graph that Converge applies to the system.

![elk graph](./graphs/elk.png)

## Warning
Expand Down
17 changes: 12 additions & 5 deletions examples/elk/Vagrantfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :

converge_version = "0.2.0-beta1"
release_url = "https://github.com/asteris-llc/converge/releases/download/#{converge_version}/converge_#{converge_version}_linux_amd64.tar.gz"

converge_script = <<SCRIPT
cd /tmp
curl -SL #{release_url} -o converge.tar.gz
tar -xzvf converge.tar.gz
mv converge /usr/local/bin
sudo /usr/local/bin/converge apply --local --log-level=info /vagrant/converge/elk.hcl
SCRIPT

Vagrant.configure("2") do |config|
config.vm.box = "centos/7"
config.vm.synced_folder ".", "/vagrant", type: "rsync", rsync__exclude: ".git/"
config.vm.network "forwarded_port", guest: 5601, host: 5601

# change the source to a linux_amd64 converge binary
config.vm.provision "file", source: "~/Projects/golang/src/github.com/asteris-llc/converge/build/converge_0.2.0-beta1_linux_amd64/converge", destination: "converge"

config.vm.provision "shell", inline: "mv converge /usr/local/bin; sudo /usr/local/bin/converge apply --local --log-level=info /vagrant/converge/elk.hcl"
config.vm.provision "shell", inline: converge_script
end

0 comments on commit 86bb814

Please sign in to comment.