This is based in ALA ELK inventories.
To simplify this is a simple cluster with one node. Initially security and SSL/TLS are not enabled and should be enabled after the first deployment.
To use this:
- Edit the
inventory.ini
and addapt your main node domain and IP, nodes to monitor... - edit:
roles/elk_forwarder/tasks/main.yml
ansible-playbook -i inventory.ini ./elasticsearch.yml --become
- In the node:
service elasticsearch start
and verify that elastic is running - Install kibana:
ansible-playbook -i inventory.ini ./kibana.yml --become
- You can start monitoring elk:
ansible-playbook -i inventory.ini ./elk_forwarder.yml --become --limit nbn-elk-1
- adjust
./roles/logstash/files/templates/logstash-solr-template.json
- Install logstash:
ansible-playbook -i inventory.ini ./logstash.yml --become
- Exec to download the geoip db (be sure that your maxmind account are correct in the inventory):
/usr/bin/geoipupdate --config-file /etc/GeoIP.conf --database-directory /usr/share/GeoIP
ansible-playbook -i inventory.ini ./elk_forwarder.yml --become
- Optional: Setup SSL/TLS component by component https://www.elastic.co/blog/configuring-ssl-tls-and-https-to-secure-elasticsearch-kibana-beats-and-logstash
- jvm adjusts (
grep -r "when: 0" .
to verify disabled tasks) - Configure jenkins curator, for instance, using
geerlingguy.elasticsearch-curator
role. Sample task:
- role: geerlingguy.elasticsearch-curator
elasticsearch_curator_cron_jobs:
- {
name: "Delete old elasticsearch indices.",
job: "/usr/local/bin/curator delete --older-than 7",
minute: "0",
hour: "1"
}
- {
name: "Close old elasticsearch indices.",
job: "/usr/local/bin/curator close --older-than 2",
minute: "30",
hour: "1"
}
tags: elastic_curator