|
1 | 1 | # Ansible Vagrant profile for ELK (Elasticsearch, Logstash, Kibana)
|
2 | 2 |
|
3 |
| -## Background |
| 3 | +This project builds a two-server ELK stack using Elasticsearch, Logstash, Kibana, and Filebeat to ship, store, and expose logs. |
4 | 4 |
|
5 |
| -Vagrant and VirtualBox (or some other VM provider) can be used to quickly build or rebuild virtual servers. |
| 5 | +The first server (`logs`) has the entire ELK stack running, and pushes local auth.log entries into Elasticsearch via Filebeat and Logstash. The second server (`webs`) runs an Nginx webserver and pushes the webserver access.log file and the server's auth.log entries into Elasticsearch via the `logs` server's Logstash instance. |
6 | 6 |
|
7 |
| -This Vagrant profile configures two servers: |
| 7 | +Logs are transmitted securely using a self-signed certificate (see the `elk-vagrant-example` certificate). |
8 | 8 |
|
9 |
| - 1. A server with the ELK stack ([Elasticsearch](http://www.elasticsearch.org/), [Logstash](http://logstash.net/), and [Kibana](http://www.elasticsearch.org/overview/kibana/)) using the [Ansible](http://www.ansible.com/) provisioner. |
10 |
| - 2. A server with the Nginx and [Filebeat](https://www.elastic.co/products/beats/filebeat) using the [Ansible](http://www.ansible.com/) provisioner, which routes Nginx access logs to the first server. |
| 9 | +## Building the VMs |
11 | 10 |
|
12 |
| -## Getting Started |
| 11 | + 1. Download and install [VirtualBox](https://www.virtualbox.org/wiki/Downloads). |
| 12 | + 2. Download and install [Vagrant](http://www.vagrantup.com/downloads.html). |
| 13 | + 3. [Mac/Linux only] Install [Ansible](http://docs.ansible.com/intro_installation.html). |
| 14 | + 4. Run `ansible-galaxy install -r requirements.yml` in this directory to get the required Ansible roles. |
| 15 | + 5. Run `vagrant up` to build the VMs. |
13 | 16 |
|
14 |
| -This README file is inside a folder that contains a `Vagrantfile` (hereafter this folder shall be called the [vagrant_root]), which tells Vagrant how to set up your virtual machine in VirtualBox. |
15 |
| - |
16 |
| -To use the vagrant file, you will need to have done the following: |
17 |
| - |
18 |
| - 1. Download and Install [VirtualBox](https://www.virtualbox.org/wiki/Downloads) |
19 |
| - 2. Download and Install [Vagrant](https://www.vagrantup.com/downloads.html) |
20 |
| - 3. Install [Ansible](https://www.ansible.com/) ([guide for installing Ansible](http://docs.ansible.com/ansible/latest/intro_installation.html)) |
21 |
| - 4. Open a shell prompt (Terminal app on a Mac) and cd into the folder containing the `Vagrantfile` |
22 |
| - 5. Run the following command to install the necessary Ansible roles for this profile: `$ ansible-galaxy install -r requirements.yml` |
23 |
| - |
24 |
| -Once all of that is done, you can simply type in `vagrant up`, and Vagrant will create both new VMs and configure them. |
25 |
| - |
26 |
| -Once the VMs are up and running (after `vagrant up` is complete and you're back at the command prompt), you can log into either one via SSH if you'd like by typing in `vagrant ssh [name]` (either `logs` for the ELK server, or `webs` for the Nginx server). Otherwise, the next steps are below. |
| 17 | +Once the VMs are up and running (after `vagrant up` is complete and you're back at the command prompt), you can log into either one via SSH if you'd like by typing in `vagrant ssh [name]` (either `logs` for the ELK server, or `webs` for the Nginx web server). Otherwise, the next steps are below. |
27 | 18 |
|
28 | 19 | ### Setting up your hosts file
|
29 | 20 |
|
|
0 commit comments