Browse the Repo

file-type-icon.circleci
file-type-icon_docs
file-type-iconexamples
file-type-iconmodules
file-type-iconauto-discovery
file-type-iconbeats-iam-policies
file-type-iconelastalert-iam-policies
file-type-iconelastalert-security-group-rules
file-type-iconelastalert
file-type-iconelasticsearch-cluster-backup
file-type-iconelasticsearch-cluster-restore
file-type-iconelasticsearch-cluster
file-type-iconelasticsearch-iam-policies
file-type-iconelasticsearch-security-group-rules
file-type-iconinstall-collectd
file-type-iconinstall-elastalert
file-type-iconinstall-elasticsearch
file-type-iconinstall-filebeat
file-type-iconinstall-kibana
file-type-iconinstall-logstash
file-type-iconkibana-cluster
file-type-iconkibana-security-group-rules
file-type-iconload-balancer-alb-target-group
file-type-iconlogstash-cluster
file-type-iconlogstash-iam-policies
file-type-iconlogstash-security-group-rules
file-type-iconrun-collectd
file-type-iconbin
file-type-iconREADME.md
file-type-iconinstall.sh
file-type-iconrun-elastalert
file-type-iconrun-elasticsearch
file-type-iconrun-filebeat
file-type-iconrun-kibana
file-type-iconrun-logstash
file-type-icontest
file-type-icon.gitignore
file-type-icon.pre-commit-config.yaml
file-type-iconCODEOWNERS
file-type-iconCONTRIBUTING.md
file-type-iconLICENSE.md
file-type-iconREADME.md
file-type-iconterraform-cloud-enterprise-private-module-...

Browse the Repo

file-type-icon.circleci
file-type-icon_docs
file-type-iconexamples
file-type-iconmodules
file-type-iconauto-discovery
file-type-iconbeats-iam-policies
file-type-iconelastalert-iam-policies
file-type-iconelastalert-security-group-rules
file-type-iconelastalert
file-type-iconelasticsearch-cluster-backup
file-type-iconelasticsearch-cluster-restore
file-type-iconelasticsearch-cluster
file-type-iconelasticsearch-iam-policies
file-type-iconelasticsearch-security-group-rules
file-type-iconinstall-collectd
file-type-iconinstall-elastalert
file-type-iconinstall-elasticsearch
file-type-iconinstall-filebeat
file-type-iconinstall-kibana
file-type-iconinstall-logstash
file-type-iconkibana-cluster
file-type-iconkibana-security-group-rules
file-type-iconload-balancer-alb-target-group
file-type-iconlogstash-cluster
file-type-iconlogstash-iam-policies
file-type-iconlogstash-security-group-rules
file-type-iconrun-collectd
file-type-iconbin
file-type-iconREADME.md
file-type-iconinstall.sh
file-type-iconrun-elastalert
file-type-iconrun-elasticsearch
file-type-iconrun-filebeat
file-type-iconrun-kibana
file-type-iconrun-logstash
file-type-icontest
file-type-icon.gitignore
file-type-icon.pre-commit-config.yaml
file-type-iconCODEOWNERS
file-type-iconCONTRIBUTING.md
file-type-iconLICENSE.md
file-type-iconREADME.md
file-type-iconterraform-cloud-enterprise-private-module-...
Elasticsearch (self-hosted)

Elasticsearch (self-hosted)

Deploy a self-hosted Elasticsearch cluster. Supports automatic bootstrap, zero-downtime rolling deployment, auto healing, backup, and recovery.

Code Preview

Preview the Code

mobile file icon

README.md

down

CollectD Run Script

This folder contains a script for configuring and running CollectD on an AWS EC2 instance. This script has been tested on the following operating systems:

  • Ubuntu 16.04
  • Ubuntu 18.04
  • CentOS 7
  • Amazon Linux 2

Quick start

This module depends on bash-commons, so you must install that project first as documented in its README.

The easiest way to use this module is with the Gruntwork Installer:

gruntwork-install \
  --module-name "run-collectd" \
  --repo "https://github.com/gruntwork-io/terraform-aws-elk" \
  --tag "<VERSION>"

Checkout the releases to find the latest version.

<Plugin write_http>
	<Node "logstash">
		URL "<__LOGSTASH_URL__>"
		Format "JSON"
	</Node>
</Plugin>

Now you can fill in those placeholders and start CollectD by executing the run-collectd script as follows:

run-collectd --auto-fill "<__LOGSTASH_URL__>=http://s4JSnd.gruntwork-sandbox.com"

This will:

  1. Replace all instances of the text <__LOGSTASH_URL__> in the CollectD config file with the path to the log file that CollectD will read from
  2. Start CollectD on the local node.

We recommend using the run-collectd command as part of User Data, so that it executes when the EC2 Instance is first booting.

See the examples folder for fully working sample code.

Command line Arguments

Run run-collectd --help to see all available arguments.

Usage: run-collectd [options]

This script can be used to configure and run CollectD. This script has been tested with Ubuntu 16.04 + 18.04, CentOS 7 and Amazon Linux 2.

Options:

  --config-file                         The path to the config file for CollectD.
  --auto-fill KEY=VALUE                 Search the CollectD config file for KEY and replace it with VALUE. May be repeated.
  --help                                Show this help text and exit.

Example:

  run-collectd --auto-fill '<__LOGSTASH_URL__>=http://s4JSnd.gruntwork-sandbox.com'

Questions? Ask away.

We're here to talk about our services, answer any questions, give advice, or just to chat.

Ready to hand off the Gruntwork?